CODESYS is an IDE for application development on programmable logic controllers (PLCs) distributed by the CODESYS Group in Germany. Use this tag only for questions about CODESYS installation and usage as well as related CODESYS software like CODESYS Control Runtime System and CODESYS Automation Server. Use the tags [structured-text], [ladder-logic], and [sfc], for (ide-agnostic) questions about [plc] or [servo] programming.
Questions tagged [codesys]
240 questions
1
vote
2 answers
Codesys how to write to output in Wago 750
I have Wago 750-880 with different sensors. Someone wrote already a program to control it in Codesys. I would like to return (I have a Java background :D) - to write some variables to output in the driver, e.g. holding registers. I would like to to…

chris
- 11
- 2
1
vote
2 answers
Defining a falling edge detection in Codesys
For one of my programs I need a normally closed, timed-closing (NCTC) relay in Ladder Diagram.
I do not know of a standard method to implement such, so I'm trying to construct one myself. My current approach needs a falling-edge detection. The code…

Mast
- 1,788
- 4
- 29
- 46
1
vote
0 answers
Making a library with external C functions Codesys
Someone help me please
I have this problem when I try to use my c library in CODESYS project.
The traduction of error in English:
The device version on the hardware seems to diverge from that used within the project. Try to synchronize the version…

Ksouri Wissem
- 49
- 1
- 5
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
2 answers
OPC server that support general PLC's and CoDeSys PLC's
I’m at the start of a HMI project, the goal is to develop an C# .NET HMI application that runs on an windows PC.
The HMI must be able to read and write PLC variables
In the first stadium of the project the HMI must be able to communicate with
• …

Rob Heijligers
- 193
- 1
- 2
- 9
1
vote
1 answer
Shift operation returning weird error
I'm programming a plc by ABB in the codesys environment, and I can't figure out why I'm getting this error:
Error 4024: ... Expecting ELSIF, ELSE or END_IF before 'SHL'
The code returning this error is something like:
IF flag THEN
iState :=…

clabacchio
- 1,047
- 1
- 17
- 28
1
vote
1 answer
Writing textlist in codesys
How should I write a text list in CODESYS dynamically at runtime ?
I am using the text list as a source to display in a combo box (drop down list box)
Thanks in advance

user1271454
- 21
- 2
1
vote
2 answers
How to display Text in new line in CoDesys visualization
In CoDeSys visualization, how to display Text in newline.
I have a csv file which reads by CoDeSys and display the csv column text in CoDesys rectangle text block.
In csv file I tried giving $N, \n\r,\n, no chance

Kumar
- 23
- 1
- 8
1
vote
0 answers
C# + CoDeSys Automation Platform SDK -> PLC's variable = VarRefState.NotMonitoredYet
I'm trying to read the variable of the PLC.
In the Automation Platform, I have a plugin who start a my test (that I've write in C#).
When I execute the plugin for the first time, it always give me the same error. But if a execute it again it's…

Félix LD
- 372
- 1
- 5
- 19
1
vote
2 answers
Track program change on WAGO PLC with CoDeSys
I need to increment an integer value each time the PLC program is updated to track changes.
There are system events like online_change and before_download, but I have no idea how to implement their functions.
Also I need to save value between…
user1364014
0
votes
1 answer
How to convert LD ladder to ST literal language?
I'm using CoDeSys software to develop. Now, I have just completed code in LD (ladder). I would like to change (convert) LD to ST (structured text).
Is that possible?

RePRO
- 67
- 1
- 9
0
votes
2 answers
CoDeSys: BOOL becomes "*** INVALID: 16#02 ***" outside case (link between two vars)
When I trace my program (online with breakpoint and singlestep) I see,
that the VAR SOpen becomes "* INVALID: 16#02 *" when the line Step:=Step+1; is reached.
Watching the trace more careful, I saw, that Step changes from 0 to 1, in the first call…

Nikodemus RIP
- 1,369
- 13
- 20
0
votes
0 answers
Tabular view for enumeration on TwinCAT3
There is a visual problem as I declare an enumeration on TwinCAT3 as has been shown in the following:
here is my simple declaration;
VAR
state:(init , operate, stop);//a simple example of enum declaration
END_VAR
and here is the code that I faced…

asys
- 667
- 5
- 20
0
votes
1 answer
Codesys RTE Softmotion Cycle Time Problem
I worked on Sinumerik CNC systems. Those systems have a postion control cycle. Typical control cycle for Sinumerik CNC is 250us. CNC task runs on Linux NCU controller and to carry on other tasks there is a PLC.
Now I am working on Codesys RTE…

Esat Genç
- 113
- 3
0
votes
0 answers
Enforcing Strong Private Key Protection for X509Certificate2 Objects in .Net/Modifying X509Certificate2 Bag Attributes
I am trying to use .Net 7 to programmatically add an X509 certificate and private key to the Windows certificate store.
The intended use of the certificate is for encrypting a CODESYS project file. The certificate has to be added to the current user…

t.probst
- 11
- 4