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 access VAR_IN_OUT variable when FB cannot be extended?
I have been trying to gain access to the AXIS_REF_SM3 i.e. Axis of SM3_Basic.MC_MoveAbsolute in order to return the wDriveId of the axis.
Since Axis is declared as a VAR_IN_OUT variable, I am unable to access it outside of the FB using the .Axis…

void
- 7
- 3
0
votes
0 answers
About __POUNAME() behavior
I have written a custom logger and wanted to add the name of POUs as the pszComponent for easier debugging.
I wrote a custom FB_init which accepts as input the name of the POU as a string and encountered puzzling behavior (to me at least).
Could…

void
- 7
- 3
0
votes
1 answer
Can I use Structured Text in Codesys to initialize a Global Variable List
I'm trying to get my head into the Codesys world and since I'm not a Menu-click type I'm wondering if there is a way to stick to the keyboard and for instance add a PersistentVarsList and Global Vars List via Structured Text in the Editor.

aerioeus
- 1,348
- 1
- 16
- 41
0
votes
3 answers
How do you group variables in Structured Text?
How do you group variables in Structured Text?
Say I have n global variables for lamps:
lamp1
lamp2
lamp3
... // and so on
Then I have a button, and pressing it should set all variables to TRUE:
IF buttonPressed Then
lamp1 := TRUE;
lamp2…

Kai Lee
- 3
- 2
0
votes
1 answer
Codesys Control RTE V3 - Network Adapter configuration for Ethercat real time bus
I am quite new to the Codesys platform and I am experiencing some problems when trying to use the RTE on a Windows IPC as a target device.
I am using an IPC (Windows 7 Embedded) with the following runtime version -> CODESYS Control RTE V3…

Isidro91
- 11
- 4
0
votes
2 answers
How to cast enum to uint in structured text
I have a structured text program running in codesys 3.5, in which I want to set the mode of some motor to several values. In order to have good encapsulated code I defined the following struct:
{attribute 'strict'}
TYPE PD4_modes :
(
no_mode :=…

U_flow
- 475
- 5
- 18
0
votes
0 answers
CoDeSys 2.3 - coils won't activate upon receiving a signal
Like I've stated in the title, I have a problem with coils not changing their state. I'm a newbie when it comes to programming PLC, so it's probably something basic. Could someone take a quick look? coil doesn't react

Dumbo
- 1
0
votes
2 answers
Assign a string variable with contents from GlobalTextList
Is there a way to assign a string variable with the contents of a string from the GlobalTextList?
Also of import, when it assigns the variable from the GlobalTextList it uses the correct language from the GlobalTextList.

da66en
- 275
- 1
- 11
0
votes
2 answers
Festo CPX-E Codesys - Can't set any persistent variables
I've been programming on our CPX-E-CEC-C1-PN but every time I just try to set one persistent variable it already says "out of memory".
Anyone ideas what setting/information I'm missing?

Roel
- 97
- 1
- 11
0
votes
0 answers
Decentralized PLC Network using Soft-PLC
My setup is a tracked mobile robot which needs to be controlled using a PLC. For numerous reasons, it is necessary to have a decentralized computing unit (e.g. located in the office) which sends the commands to the tracked robot. The computing unit…

Dr No
- 118
- 5
0
votes
0 answers
J1939 - Yamaha Rudder Position ADDRESS
Using a PCAN VIEW, I determined the "rudder position" address (Yamaha Outboard), to be 166792448, and using CAN_Rx_MessageProc_ST_0 got the outboard position from bytes 4 and 5 of the 8 byte array:
RUDDER_ANGLE_RAW :=…

LlewV
- 1
0
votes
1 answer
Best variable structure for initialization of several motors in CodeSys
Problem
I have a PLC hooked up to several motors (which are all of the same type) via CanOpen. The PLC is programmed using CodeSys with "Structured Text". In order to activate the motors each one has to run through an initialization state machine,…

U_flow
- 475
- 5
- 18
0
votes
0 answers
How can I store Negative value in ABB codesys
I am writing my code in codesys in CFC Language and performing multiplication and store the answer in variable of LREAL data type. My issue is when the answer comes negative it still shows positive answer. I looked to solve the problem by changing…

Mar_60
- 13
- 3
0
votes
2 answers
Display query in ABB HMI using software panel builder 600
I am using ABB HMI and programming it on panel builder 600. I have used meters to display angles and set the scale from -100 to +100. I have acheived success in displaying angles but the problem is the change in angle is very frequent and the needle…

Mar_60
- 13
- 3
0
votes
1 answer
How to get char from a Byte ASCII value in Codesys
Good morning,
I would like to get the char which corresponds to a ASCII code. For example, if I have a byte with a value 16#68, I would like to get a char with value 'h'.
Thanks!

Soul1986
- 3
- 3