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
0
votes
1 answer
How to convert Data types of array in Codesys
I am receiving data into an array from the energy meters which is of REAL datatype.
My array: ARRAY[0..49] OF Real;
I want to convert this data into string data type like i want all the values enclosed in commas "" separately.
Waiting for your…

Maria Abdullah
- 55
- 8
0
votes
0 answers
How do I load the Codesys control for Pfc100 package?
I am using Codesys v3. Sp14 patch. When I update PCF100 with V3.5.14.20. My 750-8100 firmware version is 11. I get an error Expected exit value of command failed: expected 0, received -1. I also get
Error output:ipkg * couldn't kill old gunzip…
0
votes
2 answers
If a VAR_INPUT is of INTERFACE type, is the value pass-by-reference or pass-by-value?
In the TwinCAT and CodeSys IEC-61131 programming environments, it's possible to declare POU VAR_INPUTs using an INTERFACE as a type specification. I believe the support for interfaces in TwinCAT and CoDeSys is an extension to the standard IEC-61131…

Hydrargyrum
- 3,378
- 4
- 27
- 41
0
votes
2 answers
How to fix a bug on my queue of devices in PLC
I am trying to create a simple queue in .st with 6 devices that should be turned on and off in the queue order only the ones that are available should be connected. For example I did a test with 6 devices available and then I was unavailable one by…

Apach3
- 3
- 2
0
votes
2 answers
Strange file output when using Concat in CodeSys
I'm using the CAA-File library in CodeSyS to write data to a text file. When I write a string to the file it works fine, but if I combine 2 strings with CONCAT, I get a strange file output with random characters (see below). Does anyone know how to…

Wout Rombouts
- 1,479
- 2
- 9
- 15
0
votes
1 answer
CoDeSys Visualization Dropdown Menu Custom Values in modelTextList
Using CoDeSys, I have a drop down list for a visualization that uses an enumeration of values for the options in the list. The enumeration comes from a separate library and for my particular application I would like to use only a subset of the…

Michael LeVan
- 528
- 2
- 8
- 21
0
votes
2 answers
Initialize Array of Custom Types in Structured Text Syntax
In my project I have a type like:
TYPE myDataStruct :
STRUCT
A : UINT;
B : WORD;
C : REAL;
D : Custom_Obj;
END_STRUCT
END_TYPE
And I need to keep an array of this type for persistent memory. I can't just use VAR RETAIN because this…

Michael LeVan
- 528
- 2
- 8
- 21
0
votes
1 answer
Define multiple variables in a condition in ST
I am currently programming/simulating a small plant in CODESYS.
I have several outputs (that correspond to engines) that I need to test several times, so I want to create a condition that incorporates this test so I dont need to write the entire…

L8call
- 87
- 1
- 1
- 6
0
votes
1 answer
How can I create a drop down list in a interface for a PLC using Codesys v2. 3
I'm doing an interface for a WAGO PLC and I'm using codesys v2. 3 software. But I'm needing to create a drop down list to choose some variables depending of the process I want to realize with the system. But I haven't found how to do it. Also, I…
0
votes
2 answers
CoDeSys size of pointer reference
Using Codesys v2.3, I'm trying to make a function block that checks the size of the pointer data, as to not write to parts of the memory beyond this.
Ex:
VAR_INPUT
pData: POINTER TO REAL; // Or pointer to WORD or ARRAY[1..x]…

Jabbl
- 59
- 7
0
votes
1 answer
Codesys V3 and Raspberry Pi SL - How to read values from addresses
Good evening.
I have a short question regarding the use of CODESYS Development System V3 and the associated CODESYS Control for Raspberry Pi SL. How do I manage to acquire the values of the connected sensors (e.g. si705x, vcnl) or to write certain…

jdoe
- 1
0
votes
1 answer
Commenting elements of array for Codesys online view
Codesys has a nice (IMO) feature where comments adjacent to a variables declaration are shown in the table view when online which makes it easier for others to understand original programmers intent.
It would be very nice if there was some way to…

Dave
- 142
- 7
0
votes
1 answer
Memory leak with ActiveX in C++ Builder
I'm encountering a memory leak while using an activeX component in my project.
I'm working with Embarcadero Rad Studio 10.2 and developing a C++ industrial program that needs to communicate with a Codesys soft PLC on the same machine.
So, i have a…

LucaM
- 13
- 6
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
- 97
- 1
- 2
- 11
0
votes
1 answer
Average value of input Data in Mitsubishi GX Works 2
I need to obtain an average value of my input signals from mitsubishi input module Q64AD. I'm working in GX Works 2 in structured text.
This is how i used to obtain average value in Codesys:
timer_sr(IN:= NOT timer_sr.Q , PT:= T#5s );
SUM1:= SUM1…

Roman Selin
- 109
- 1
- 16