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 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
Post by monteta on Automation without UI
CODESYS Forge
talk
(Post)
Problem solved, Once the perform_network_scan() is done, y just had to recover the address and using set_gateway_and_address(). Now i'm looking how to deploy all my device's applications on the PLC, I guess it will looks like : for app in allapplication: with online.create_online_application(app) as onlineapp onlinedevice = onlineapp.get_online_device() online.set_default_credentials(x,y) try: onlineapp.login(OnlineChangeOption.Keep, False) except Exception as e: msg = str(e).lower() if "rescan" in msg : print("PLC service might be off") elif "targetdo" in msg: print("Bad credentials") else print(msg) else: onlineapp.create_boot_application()
Last updated: 2025-09-29
Post by esther on subdevicesCollapsed attribute in deviceDescriptor
CODESYS Forge
talk
(Post)
I was trying to use subdevicesCollapsed attribute in device descriptor in order to not expand the subdevices when a new device with subdevices is inserted in the device tree. I use this as follows:<fixed subdevicescollapsed="true">. But it seems it doesn`t work. I am ussing Codesys v3.5 SP16 Patch4. Is anything wrong with this? Or am I mistaken with the use of this attirbute?</fixed>
Last updated: 2025-10-01
Post by gseidel on MC_MoveAbsolute: C0138: No matching 'FB_Init' method found for instantiation of SMC_MoveAbsRelPerformerImpl [ERROR]
CODESYS Forge
talk
(Post)
Hi imdatatas, sorry to hear this issue caused so much overhead for you. Frankly, I'd expect a project created with an older version to compile without errors after opening > it with the latest Codesys version and updating all libraries. Yes, that is a reasonable expectation. I tried a few times but could not reproduce the problem. In case you run into the problem again, we can investigate the issue if you send a project archive. Best regards, Georg
Last updated: 2025-10-02
Post by svn123 on Can V3.5.19 and V2.3.9 be installed on same Windows10 PC without affecting each other?
CODESYS Forge
talk
(Post)
Hi All, Seasons Greetings! I have Codesys V3.5.19 patch 5 installed on a Windows 10 PC. I have received a program which is for Codesys V2.3.9. First I tried to convert it but had many conversion errors. I am wondering if it is possible to install Codesys V2.3.9 on same PC without affecting the V2.5.19 installations. Is this possible? SVN123
Last updated: 2023-12-28
Post by hermsen on Control Runtime Toolkit
CODESYS Forge
talk
(Post)
Hi, there is a plethora of hardware available for it to be succesful on. In theory every ARM32/64 or x86/64 device is a potential target. Next to this there are embedded device platforms for which specific toolchains are available. A good starting for manufactureres of CODESYS capable devices is available here: https://www.codesys.com/the-system/codesys-inside.html. That should give you a good reference point.
Last updated: 2023-12-31
Post by tvm on SEND_RECV_MSG function block on Schneider Machine Expert
CODESYS Forge
talk
(Post)
Anyone else using the SEND_RECV_MSG function block for RS-485 communication on Schneider Machine Expert? I have had ongoing issues with it for several years, which Schneider tech support is aware of, but hasn't been able to fix. The latest version of Machine Expert (v2.2) appears to have broken some of the functionality altogether. I'd be interested in hearing from anyone else using this platform for serial communication.
Last updated: 2024-01-03
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.