Questions tagged [structured-text]

Structured text is one of the five languages supported by the IEC 61131-3 standard, designed for programmable logic controllers (PLCs).

From Wikipedia: Structured text is one of the five languages supported by the IEC 61131-3 standard, designed for programmable logic controllers (PLCs). It is a high level language that is block structured and syntactically resembles Pascal, on which it is based. All of the languages share IEC61131 Common Elements.

78 questions
0
votes
1 answer

How can I add a timer within a function in codesys using structured text?

I'm having a problem with structured text in Codesys V3.5 SP9 Patch 5. What I want to do is to be able to use a timer within a function created by me, which is called in a POU. I've done the same without using function by putting timer directly into…
MetalxBeat
  • 87
  • 1
  • 1
  • 9
0
votes
1 answer

Mitsubishi PLC - The parameter Set Value is Out of Range - GX Works3

We have a PLC application that has been created in GXWorks3. We're using an IQ-F FX5U-32MR/DS with two analogue components: We're able to run our very simple program on the simulator and are having no issues, however when writing the changes to the…
Wizard
  • 1,066
  • 3
  • 14
  • 35
0
votes
2 answers

Pulsing Multiple LEDs simultaneously with Beckhoff

This should be a nice question for different approaches.I am very new, so pardon my simple question. Say I have 6 LEDs. LED1 AT %Q* : BOOL; LED2 AT %Q* : BOOL; LED3 AT %Q* : BOOL; LED4 AT %Q* : BOOL; LED5 AT %Q* : BOOL; LED6 AT %Q* : BOOL; My…
0
votes
4 answers

Iterating over structures in Twincat PLC (Structured text)

Say I have the following structure that is filled with information about an Axis: TYPE AxisInfo : STRUCT AxisStatus : ARRAY [0..3] OF BYTE; DriveStatis : ARRAY [0..3] OF BYTE; FeedRate : ARRAY [0..3] OF BYTE; Inputs : BYTE; …
0
votes
2 answers

Error 4024 structured Text programming

IF IP_emo:=FALSE THEN State:= OFF_Mode; ELSE State :=OFF AND IP_emo:=TRUE AND start_Btn:=TRUE OR start_Btn:=False; State:= Monitor_Mode; END_IF I am not sure why I am getting error 4024 on this code requiring a := before "THEN". Can…
Ruach02
  • 1
  • 1
0
votes
1 answer

Wago codesys PLC word to bool conversion

I am programing a solarcell tracker with the use of Wago PFC100 and Ecockpit software. I have a principle problem regarding converting some counter values in a 16-bit WORD to a pulsetrain in form of BOOL. The 16-bit word register counts up/down from…
user7715540
0
votes
1 answer

Is it possible to vary the ON time of a digital output pin of a PLC via structured text?

I am trying to simulate a PWM signal output from a digital only PLC. So is it possible to define the digital output pin ON and OFF time in each cycle? Thanks in advance.
0
votes
1 answer

Counter in Tia Portal software

I have an issue with a counter in the Tia portal software. When I hover over the CV, it says you can insert Int, DInt, SInt UInt, USint, UDint. I want to insert a Dint value because the number can be bigger than 32767. But when I do this, it still…
Bart88
  • 133
  • 1
  • 2
  • 9
0
votes
1 answer

Is it possible to specify PLC execution on a certain 'n' Scan Cycle in Structured Text?

I am currently working on coding a PLC to execute certain commands in which I would like to be performed at specific scan cycles. Is there a way I could code a program in Structured Text to where I can flag statements to only execute at an 'n' scan…
0
votes
2 answers

How to establish a connection between PLC and MongoDB (NoSQL) using Structured Text programming?

How do I send data (a character, an integer or a string, for example) from a PLC (Indraworks) to MongoDB using Structured Text programming (IEC 61131-3)? None of the function blocks available (RIL_SocketComm.library) are compatible with NoSQL…
Arjun
  • 9
  • 7
0
votes
1 answer

Data streaming to MongoDB using sockets with Structured Text programming

How do I stream a string (hello world, for example) from a PLC by Structured Text programming (IEC 61131-3) to MongoDB using sockets? I heard that function blocks like SysLibSockets have to be used but I am not sure how. It would be great if you…
Arjun
  • 9
  • 7
0
votes
2 answers

Converting 32-Bit Real to 2x 16-Bit Bytes

I'm trying to send a 32-Bit Real across a CAN communications (IFM) but the CAN comms only accepts a 16-Bit value. If the value I'm trying to send goes above 255, it resets back to 0 and continues in that pattern. I therefore need to split the 32-Bit…
0
votes
4 answers

Change system time of Beckhoff controller by programming

For the last couple of hours, I am facing problems with changing system date and time by structured-text programming. I have used function block FB_LocalSystemTime where I can read the system time. But I could not find any function or function block…
krishna
  • 81
  • 1
  • 8
0
votes
3 answers

I need to concatenate several strings

I am new to stuctured text and I would like to know how to concatenate several string. The cleanest way possible. I this instance I only need to change one variable when creating the string. I have another where I need to do 2. That number will…
TheColonel26
  • 2,138
  • 5
  • 22
  • 43
0
votes
1 answer

Frequency calculation in Beckhoff TwinCAT3.1

I am trying to determine the frequency of a pulsing input, which is tacho feedback of a pump. I have tried to create two timers which are a second each, and counts up every time there is rising edge. Based on the number of rising edges in a second,…
Vinny
  • 48
  • 7