Questions tagged [iec61131-3]

IEC 61131-3 specifies a family of programming languages for PLCs.

IEC 61131-3 specifies a family of programming langues for programmable logic controllers (PLCs). It describes both textual and graphical languages.

  • Instruction List (IL): textual, assembly-like
  • Structured Text (ST): textual, Pascal-like
  • Ladder Diagram (LD): graphical
  • Function Block Diagram (FBD): graphical

References:

68 questions
1
vote
1 answer

How to avoid literals in case labels in CCW using structured text?

I'm using Connected Components Workbench (CCW) and the syntax for a case statement that is given in the documentation is: CASE OF : ; ; :…
Sparkler
  • 2,581
  • 1
  • 22
  • 41
1
vote
2 answers

Architecture of 61131 program

In my 61131 program I have Objects/Information that needs to be shared between different program parts. What is best practice regarding this, should the Objects that needs to be shared be VAR in the PRG POU or global in a GVL? From "high-level"…
krakers
  • 111
  • 10
1
vote
1 answer

How to transfer the concepts of real-time control from "C" environment to "IEC61131 (CODESYS)"?

We are trying to perform a real-time measurement/calculation on sampled data. Our previous experience was based on C programming. I wonder if anyone can help me transfer the real-time c programming structure into the PLC IEC61131 Structured…
aghd
  • 685
  • 2
  • 9
  • 20
1
vote
2 answers

Nontrivial IEC 61131-3 Code Examples

I am currently developing a method for symbolically executing and testing IEC 61131-3 applications. For evaluating my approach, I require non-trivial programs written in any of the languages defined in the standard. Are there any openly accessible…
LocalToast
  • 397
  • 1
  • 5
  • 13
1
vote
0 answers

Antlr4 CodeGenerator Language

I am making a IEC-61131 to C++ converter, which is being done using C#. I have a good Antlr4 grammar file for IEC-61131 and I am using a custom Listener to generate the output C++ code. I know StringTemplate C# could be used to replace my custom…
C James
  • 11
  • 2
1
vote
1 answer

How to toggle variable in Codesys CFC by pressing same momentary button?

The question pity much say it all. I have a momentary button. I click it one time, variable start gets HIGH. I click it another time variable start goes LOW Sounds like trivial task, but with САС I was not able to do that. That is because of data…
Sergey Romanov
  • 2,949
  • 4
  • 23
  • 38
1
vote
1 answer

How do I program an Interpolated Position Mode sequence in IEC-61131 Structured Text using the Maxon EPOS Libraries?

The Maxon EPOS libraries define some Function Blocks that seemingly handle Interpolated Position Mode, however there are no samples, as far as I can determine, that specify how to use them. Here is what I have so far but at the moment it just skips…
Brendan
  • 18,771
  • 17
  • 83
  • 114
1
vote
2 answers

How to perform mathematical operations on large numbers

I have a question about working on very big numbers. I'm trying to run RSA algorithm and lets's pretend i have 512 bit number d and 1024 bit number n. decrypted_word = crypted_word^d mod n, isn't it? But those d and n are very large numbers! Non of…
user1916778
  • 137
  • 1
  • 4
  • 13
1
vote
2 answers

Using COM Callable Wrappers in PLC components

I have a Motorolla based, Programmable Logic Control (PLC) device and I write code in it using IEC-61131 structured programming language. The problem is that I have some complex computation to do, so I am trying to write the code in COM Callable…
Irfan
  • 2,713
  • 3
  • 29
  • 43
0
votes
0 answers

Codesys 3, Is there any way to stop CANopen_Manager sending NMT Reset node command on enable?

I've noticed that when enabling the 3S CANopen_manager device (as declared in the device tree, _3SCOS.CANOpenManager_Diag), by CANopen_Manager.Enable := TRUE; (I'm not talking about NMT start) the PLC automatically sends NMT Reset command to…
e-mal
  • 1
  • 1
0
votes
2 answers

Iterating through variable list

I'm writing an App on CODESYS that has a set of alarms in a variable list whose state I'd like to check in a program. Right now I'm just referencing those variables individually in the program, but I was wondering if there's a way to iterate through…
0
votes
1 answer

How do I automate/optimize D/Y connection selection based on selected input voltage and motor plate voltage values?

I have a test setup with six (6) selectable load motors and four (4) possible input voltage options. The motors are divided into three (3) motor sets, each containing two (2) motors (i.e. 1M1 1M2, 2M1 2M2 and 3M1 3M2 where the first number is the…
0
votes
0 answers

Error "An invalid device OR an invalid constant is being used" when compile simple GX Works 2 program in FX3G PLC

I have FXCPU PLC FX3G series and I create ST Structured Project in GX Works 2. The problem is I cannot loop through an array of bits. Here are my local variables. Now this code in a program compiles with error (* Do not compile! *) FOR iCount := 0…
Sergey Romanov
  • 2,949
  • 4
  • 23
  • 38
0
votes
1 answer

How to adjust the time in a trend object in Codesys?

I have a trend object which takes the time of the Raspberry Pi. In my project I take the time of the main board and now the time of the trend object, the date range selection and the time displayed on the screen are different. My question is how do…
SGKlee
  • 70
  • 6
0
votes
1 answer

C0222 error when opening project (then goes away)

I have many methods the return value of which is a REFERENCE TO in my libraries. When I open the library, I see a C0222 error in the message window for each of these. If I compile the library, the message goes away. The code compiles and works under…
Fred
  • 6,590
  • 9
  • 20