Post by mubeta on Profibus DP master with EL6731 and automatic restart of slaves
CODESYS Forge
talk
(Post)
The problem is looking for a bug somewhere in CoDeSys in that, when the slave returns, the cyclic data exchange resumes, but the diagnostics do not update and the node continues to resulting off-line. it is not a problem with the PB master, but with its 3S/CoDeSys management. CoDeSys 3.5.19.20 runtime. Any ideas on how to fix it? Thank you.
Last updated: 2025-02-03
Post by imdatatas on Remote to PLC device in City-B from City-A
CODESYS Forge
talk
(Post)
Hello, In an example scenario like below figure, can the developer in City-A connect to the device in City-B remotely using only "Codesys Automation Server" and "Edge Gateway" with the following structure? If no, what should be done with Automation Server for this remote connection requirement? If yes, how should it be configured for this remote connection requirement? Thank you in advance for your answers. Regards, Imdat
Last updated: 2025-02-04
Post by hismoon on Inheritence of struct,
CODESYS Forge
talk
(Post)
Using a UNION instead of a STRUCT alone should give you that flexibility and only occupy memory once. And if you want to be really elegant, you could use an FB, which only holds PUBLIC VAR. Because a POU can use "EXTENDS"/inheritance. In CODESYS V3, an FB has a lot in common with C++ classes. Using ANY or ALIAS is rarely a good idea. It neither won't be pretty, nor have good readability and requires you to create a lot of error-prone things around it.
Last updated: 2025-03-14
Post by trusty-squire on Codesys for raspberry pi 5 not working exactly
CODESYS Forge
talk
(Post)
Not sure if you've resolved this yet, but the Codesys runtime user/password is different than the Linux user/password. You'll need the Linux user credentials when you log in over SSH (for example, to install the Codesys runtime). When you first log in to Codesys on the RaspPi you'll set up a Codesys user and password. If you lost those credentials, you could try uninstalling and then re-installing the Codesys runtime on the RaspPi so you can setup a new user/password.
Last updated: 2025-03-16
Post by pistola on How to change font and font color rectangle/or related object
CODESYS Forge
talk
(Post)
Here is the help sections for visual elements rectangle. https://content.helpme-codesys.com/en/CODESYS%20Visualization/_visu_elem_rectangle.html Under "Font Variable" there is "Color" which is a Dword, you can make a variable that changes colour within your code to the color needed. Note the format for the Dword variable is: colorVariable := 16#TTRRGGBB Where: TT = Transparency 00-FF RE = Red 00-FF GG = Green 00-FF BB = Blue 00-FF https://content.helpme-codesys.com/en/CODESYS%20Visualization/_visu_animate_color.html
Last updated: 2025-03-17
Post by imdatatas on Problem of assigning physical addresses to variables of type ARRAY OF ARRAY as MW and QW
CODESYS Forge
talk
(Post)
Hello, I am encountering an interesting problem as below in SP20patch5 variable definition area. I think this is a bug. As can be seen in the attached screenshot, it assigns the same %MW or %QW address to all elements of the array. I hope Codesys team can solve this problem in the next version. Best regards, Imdat
Last updated: 2025-03-17
Post by krisj on ScriptEngine POU property Get and Set accessor.
CODESYS Forge
talk
(Post)
Hey! I am trying to generate a function block with properties from a list with script engine. Codesys/ScriptEngine creates both the Get and the Set accessor. I cannot find a way to delete the Set method/accessor. Anyone encountered the same problem or have a solution for this? for prop_name, prop_type in list: property = pou.create_property(prop_name, prop_type) get = pou.find("Get", recursive=True)[i] get.textual_declaration.replace("") get.textual_implementation.replace(prop_name + " := " + struct_name + "." + prop_name + ";") set = pou.find("Set", recursive=True)[i] set.textual_declaration.replace("") set.textual_implementation.replace("") i += 1
Last updated: 2025-03-17
Post by simone on Preferred way of managing Ip-adress/es for linux (debian) host?
CODESYS Forge
talk
(Post)
Hi pernockham, I think you should ask your device vendor. For some time I used one from an Italian company where they had made a library where you can manage the ip with a function (something like SetIPAddr...), it was based on connmann on linux. From my little experience is better to use the "default" way, so for me is to manage the config file on interfaces or use the ip addr utility
Last updated: 2025-03-24
Post by dkugler on Beckhoff EL6652-0010 with Codesys
CODESYS Forge
talk
(Post)
we use successful for many years the KEB MFI terminal for Profinet, EtherCAT, Ethernet/IP,... You'll need a EtherCAT Coupler as "head" from KEB, Kendrion or Berghof. It's all the same board inside: https://www.kebamerica.com/products/ethercat-bus-coupler/ Or the coupler with 16Di/Do integrated: https://www.kebamerica.com/products/ethercat-digital-io-module/ last year I got a EK1100 with EL6731 Profibus treminal runnig. But it was a lot of reverse engineering and thinkering in Codesys and TwinCAT to be done, to get it up, fulfilling my needs. Good luck!
Last updated: 2025-03-25
Post by imdatatas on TO_STRING operator not working for IMPLICIT ENUM
CODESYS Forge
talk
(Post)
Hi Everyone, It is a very useful feature to be able to obtain the enum value as a string with the TO_STRING operator by defining {attribute 'to_string'}. However, unfortunately the same function does not work for IMPLICIT ENUMs. I hope that {attribute 'to_string'} behavior can also work for Implicit Enumeration data types in one of the upcoming Codesys versions. https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_to_string.html https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_datatype_implicit_enumeration.html Best regards, Imdat
Last updated: 2025-03-27
Post by andrej on Creating, using an external Function.
CODESYS Forge
talk
(Post)
Hello all, could you tell me whether I need an additional license in order for v3x64 to execute the DLL? Is there some manual on how to proceed? Other than the rather generic message loading Component failed Lib_XMATH.dll I have no further hints. Many thanks for your feed back. PS: I tried a similar experiment (i.e. generating a native dll for windows and having it executed by the Python VM this worked without an issue).
Last updated: 2025-05-05
Post by mariacugnier on Equal Objects at Unstaged Changes - Git (Codesys Pro)
CODESYS Forge
talk
(Post)
I'm having a serious issue with codesys-pro/git, because everytime I load my project I get around 40 unstaged changes with equal objects. If I only commit everything along with my real changes I strugle to locate them later. I've tried creating a new git repository, it didn't work. I've commited everything, it kept appearing. I've tried rolling back everything but it also didn't work. Does anyone know why this happens and how to manage it?
Last updated: 2025-05-20
Post by jvfred on Reading a negative number
CODESYS Forge
talk
(Post)
I have a Codesys-based Eurotherm E+PLC400 connected to Codesys HMI SL for visualization. I am also bringing in several Pressure Indicators via the Ethernet. Everything works; however, the Pressure indicators sometimes read a negative value. When they do, the displayed value on the screen reads "65532." While I know what it represents, the customer freaks out and wants it to read "0" or a negative number. The value comes in as an integer, just in case that matters. Does anyone have any ideas?
Last updated: 2025-05-22
Post by lbouchard on CANOpen SIL2 error: UNSAFESTACK_NOT_OPERATIONAL
CODESYS Forge
talk
(Post)
Update: I still have no idea what was causing my issues, but it went away as soon as I identified that another device on the CAN was generating a Sync message at 16#7F. Changing this to be on 16#80 made the problem go away. I have no idea why this solves the problem and would love to hear from anyone who knows why these two things might be related.
Last updated: 2025-05-26
Post by berkdan on SMC_ReadNCFile2 is always busy
CODESYS Forge
talk
(Post)
Hello, I’m using CODESYS V3.5 SP18. When I try to use SMC_ReadNCFile2 to read the file /PlcLogic/gcode.nc, the function block's bBusy output remains TRUE indefinitely. Can you help me understand what I might be doing wrong? Here is how I’m calling the function block. The value of strFileName is 'gcode.nc'. fbReadFile( bExecute := bExecute, sFileName := strFileName, bAbort := bCycleStop, fDefaultVel := RetainVariables.xSlowVelocity, fDefaultAccel := RetainVariables.xAcc, fDefaultDecel := RetainVariables.xDec, b3DMode := TRUE, bParenthesesAsComments := TRUE, fDefaultVelFF := RetainVariables.xFastVelocity, fDefaultAccelFF := RetainVariables.xAcc, fDefaultDecelFF := RetainVariables.xDec, ErrorID => gCNC.eErrorId, errorPos => gCNC.eErrorPos, ErrorProgramName => gCNC.eErrorProgName, bBusy => bReadFileBusy, sentences => sentencesss ); Thanks in advance for your help.
Last updated: 2025-06-16
Post by attarzade on Servo motor as an slave and AC motor as an Mster
CODESYS Forge
talk
(Post)
Hello, I would like to control a servo motor via EtherCAT as a slave axis, and have it follow a master axis that is driven by a Control Techniques C200 AC drive (ethercat communication).Could anyone help me with how to achieve this setup? I use codesys version 3.5.20 and crevis Ethercat cards. AC drive is master axis and Servo drive is slave axis Thanks in advance
Last updated: 2025-07-14
Post by jonasz on Device diagnosis ( EtherCAT IO card )
CODESYS Forge
talk
(Post)
Hi, I'll link to the topic not wanting to start a new one. In the application I am building, I wanted to use the diagnostics described in the CAA Device Diagnosis library. In principle, everything is ok, except for the elements related to ModbusTCP. Despite the fact that ModbusTCP is taken into account in the documentation, it is not recognised via the interfaces. FUNCTION_BLOCK NET_HW_DIAG VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR (* Referencja do struktury z danymi dla HMI ASTRAADA.*) Visu: REFERENCE TO VISU; (* Wskaźnik na mastera EtherCAT.*) pEtherCATMaster : POINTER TO IoDrvEtherCAT; (* Wskaźnik na slave EtherCAT.*) pEtherCATSlave : POINTER TO EtcSlave; (* Interfejs dla węzła w drzewie urządzeń.*) _itfNode: DED.INode; (* Ogólny interfejs magistrali. Zapewnia podstawowe informacje o magistrali polowej.*) _itfBus: DED.IBus; (* Interfejs urządzenia. Zapewnia rozszerzone informacje o urządzeniu (magistralowym).*) _itfDevice2: DED.IDevice2; (* Ogólny interfejs magistrali. Zapewnia podstawowe informacje o magistrali polowej.*) _itfStack: DED.IStack; (* Numer węzła w drzewie urządzeń.*) uiNodes: UINT; (* Operator jest rozszerzeniem normy IEC 61131-3. W czasie wykonywania operator wykonuje konwersję typu odwołania do interfejsu na inny typ. Operator zwraca wynik BOOL. Wartość TRUE oznacza, że CODESYS pomyślnie wykonał konwersję. *) xQueryResultBus: BOOL; xQueryResultDevice2: BOOL; xQueryResultStack: BOOL; (* Struktura danych dotyczących węzłów w drzewie urządzeń.*) NetHwDiag: NW_HW_STAT; ModbusTcpClientDeviceInfo: IoDrvModbusTCP.DED.DEVICE_INFO; ModbusTcpClientDeviceState: IoDrvModbusTCP.DED.DEVICE_STATE; ModbusTcpDeviceInfo: IoDrvModbusTCP.DED.DEVICE_INFO; ModbusTcpDeviceState: IoDrvModbusTCP.DED.DEVICE_STATE; END_VAR (* Pobranie wskaźników dla pierwszego mastera i pierwszego slave w sieci EtherCAT.*) pEtherCATMaster := g_pFirstMaster; pEtherCATSlave := pEtherCATMaster^.FirstSlave; (* Diagnostyka sieci EtherCAT.*) pEtherCATMaster := g_pFirstMaster; pEtherCATSlave := pEtherCATMaster^.FirstSlave; NetHwDiag.xConfigFinished := pEtherCATMaster^.xConfigFinished; NetHwDiag.xDistributedClockInSync := pEtherCATMaster^.xDistributedClockInSync; NetHwDiag.xError := pEtherCATMaster^.xError; NetHwDiag.xSyncInWindow := pEtherCATMaster^.xSyncInWindow; NetHwDiag.sLastMessage := pEtherCATMaster^.LastMessage; NetHwDiag.LastError := pEtherCATMaster^.LastError; (* Diagnostyka drzewa urządzeń.*) uiNodes := 0; _itfNode := DED.GetRoot(); REPEAT NetHwDiag.asDeviceName[uiNodes] := DED.GetDeviceNameString(itfNode := _itfNode); xQueryResultBus := __QUERYINTERFACE(_itfNode,_itfBus); IF xQueryResultBus THEN _itfBus.GetBusInfo(buiInfo := NetHwDiag.aBusInfo[uiNodes]); NetHwDiag.aBusState[uiNodes] := _itfBus.GetBusState(); END_IF xQueryResultDevice2 := __QUERYINTERFACE(_itfNode,_itfDevice2); IF xQueryResultDevice2 THEN _itfDevice2.GetDeviceInfo(deiInfo := NetHwDiag.aDeviceInfo[uiNodes]); NetHwDiag.aDeviceState[uiNodes] := _itfDevice2.GetDeviceState(); IF pEtherCATSlave <>0 THEN pEtherCATSlave^(); IF pEtherCATSlave^.SlaveAddr = NetHwDiag.aDeviceInfo[uiNodes].idSystem THEN NetHwDiag.aAlStatus[uiNodes] := pEtherCATSlave^.ALStatus; pEtherCATSlave := pEtherCATSlave^.NextInstance; END_IF END_IF ELSE xQueryResultStack := __QUERYINTERFACE(_itfNode,_itfStack); IF xQueryResultStack THEN _itfStack.GetDeviceInfo(deiInfo := NetHwDiag.aDeviceInfo[uiNodes]); NetHwDiag.aDeviceState[uiNodes] := _itfStack.GetDeviceState(); END_IF END_IF uiNodes := uiNodes + 1; _itfNode := DED.GetNextNode(_itfNode); UNTIL _itfNode = 0 END_REPEAT (* Diagnostyka Modbus.*) Modbus_TCP_Client.GetDeviceInfo(deiInfo := ModbusTcpClientDeviceInfo); ModbusTcpClientDeviceState := Modbus_TCP_Client.GetDeviceState(); PAC_3200T.GetDeviceInfo(deiInfo := ModbusTcpDeviceInfo); ModbusTcpDeviceState := PAC_3200T.GetDeviceState(); Of course, you can take the easy way out and refer directly to the devices, but I wanted a reusable component. Any constructive help is very welcome Best regards Jonasz
Last updated: 2025-07-15
Post by pernockham on Persistence Manager: Config File not found?
CODESYS Forge
talk
(Post)
I still cannot enable persistent manager for my project (and successfully login to a device). Project compiles with no errors but during download/login it fails with the fairly limited message "one or more errors occurred". The only clue I get from the system that this messages is displayed during "Generating code..: relocation pou". Any tips pointing me in a direction how to solve this very much appreciated!
Last updated: 2025-08-22
Post by eboyd on AOI's
CODESYS Forge
talk
(Post)
Hello, I'm currently working on transferring a project I recently created on Studio 5000 to CODESYS and unfortunately CODESYS isn't compatible with AOI's so I was wondering if there was anyone who could help me transfer these L5X AOI blocks to ST Function Blocks that I can import into CODESYS so I can use them for this project or if you know where I can find preexisting Function Blocks for these AOI's. Thank you so much!
Last updated: 2025-09-02
Post by eboyd on AOI's
CODESYS Forge
talk
(Post)
Hello, I'm currently working on transferring a project I recently created on Studio 5000 to CODESYS and unfortunately CODESYS isn't compatible with AOI's so I was wondering if there was anyone who could help me transfer these L5X AOI blocks to ST Function Blocks that I can import into CODESYS so I can use them for this project or if you know where I can find preexisting Function Blocks for these AOI's. Thank you so much!
Last updated: 2025-09-02
Post by sandro66 on Application-based license Modbus Channels
CODESYS Forge
talk
(Post)
Hi Gatto, Using version 3.5.21.xx, it is no longer possible to use Modbus function blocks (I make extensive use of these FBs.)as shown in the example. https://content.helpme-codesys.com/en/CODESYS%20Examples/_ex_modbus_example.html The compiler detects one Modbus instance for each instance of the communication FB block. The example program above, although simple, reports 8 Modbus instances when compiled with the latest version. Codesys Support says that you must use fieldbus I/O mapping, but this will result in the loss of the ability to programmatically modify communication parameters. Sandro
Last updated: 2025-09-04
Post by sigurdrb on Network log messages
CODESYS Forge
talk
(Post)
Hi, I'm having some trouble with an OPC client connecting to the PLC. It could be that the problem is on the client side of things. The PLC have UPS power, but the switch and OPC client does not. It could explain some of the log messages. Could any of you help debugging by the log messages in the attachment? And if possible point me to the right library that explains the different messages? Thanks for all the help.
Last updated: 2025-09-11
Post by nha451 on EIP Scanner not receiving data from adapter
CODESYS Forge
talk
(Post)
Hello, I have an EtherNet IP adapter (GoPxL) running with a virtual PLC. I have successfully connected the adapter with green icons next to it. On WireShark I can see the data coming from GoPxL but on CODESYS it shows up as all 0. My firewall is turned off and I have enabled the device to always update variables. I tested my set up with Profinet and I can receive the data. Please let me know if you have any suggestions!
Last updated: 2025-09-12
Post by astutoski on MCP23017: inputs OK, but outputs won’t switch (CODESYS on Raspberry Pi)
CODESYS Forge
talk
(Post)
Hi everyone, I’ve connected and configured an MCP23017 over I²C on a Raspberry Pi using the available CODESYS/RPi library. Input reading works fine (I can reliably read a digital input). However, I can’t get any output pin to change state. Example: when I try to drive PB0, the watch shows MCP23017.Out_B.0 = TRUE (1), but there is no actual output on the pin (no voltage change). Anyone solved this?
Last updated: 2025-09-17
Post by timvh on How to change keyboard layout on the virtual keyboard?
CODESYS Forge
talk
(Post)
Maybe you have the "Devices" tab open(?), but the "templates" are in the POU pool. You can open it from the menu: View - POUs, or if it is already open, select the POUs tab which is normally next to the Devices tab. All objects which are part of a library are in the POU pool, because they should be device independent (at least most of them).
Last updated: 2025-09-18
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND or OR.