Post by jroddball79 on PM556-TP-ETH — How to change IP address without overwriting the PLC program?
CODESYS Forge
talk
(Post)
Hi, I need to change the IP address of an ABB PM556-TP-ETH using ABB Automation Builder. The situation is: I have connectivity to the PLC using the current IP (configured in Communication Settings) Online Login works fine The Network Scan does not detect the PLC IP-Configuration tool shows all fields disabled I don't have the original project source, only an empty project The PLC has no SD card inserted The Online menu does not show an Upload option When I modify the IP in the project and connect, Automation Builder shows: "The PLC configuration needs to be updated. A full PLC download is required" I'm afraid a full download will overwrite the running program. Is there any way to change only the IP address without overwriting the application? I'm also open to solutions using third-party tools, Python scripts, or any other method (DCP protocol, direct TCP communication, etc.) as long as it doesn't overwrite the running application. Thank you
Last updated: 2026-05-19
Post by timvh on USB Game Controller with Raspberry Pi
CODESYS Forge
talk
(Post)
I'm not sure it will work, but you could try it with the CmpCharDevice library. You could create a function block that looks something like this: As input for the filename, you have to use your Linux device, e.g.: '/dev/input/event0' '/dev/input/by-path/platform-button@23-event' Off course you must also pass the pointer to the memory where the data can be written to and the size (count in number of bytes) of the buffer. FUNCTION_BLOCK FB_CharDevice VAR_INPUT szFilename: STRING; pbyBuffer : POINTER TO BYTE; udCount : UDINT; END_VAR VAR_OUTPUT iState : INT := 0; nrBytesRead : DINT; END_VAR VAR xInit : BOOL := TRUE; dFlags: DINT := CmpCharDevice.ACCESS_MODE.O_RDONLY + DINT#4000; // see details for flags: http://linux.die.net/man/2/open, + DINT#4000 is for non-blocking hDevice: CmpCharDevice.CmpCharDevice_Implementation.RTS_IEC_HANDLE := -1; Result : CmpCharDevice.CmpCharDevice_Implementation.RTS_IEC_RESULT; END_VAR IF xInit THEN hDevice := CmpCharDevice.CDOpen(szFilename, dFlags ,Result); // if it would not succeed, the result is -1 (Invalid handle) IF hDevice <> 16#FFFFFFFF AND Result = 0 THEN iState := 5; END_IF xInit := FALSE; END_IF IF iState = 5 THEN nrBytesRead := CmpCharDevice.CDRead(hDevice, pbyBuffer, udCount, Result); ELSE nrBytesRead := 0; END_IF Make sure you close the connection properly, maybe by overwriting the default FB_Exit method of the FB: // Clean up device IF hDevice <> 16#FFFFFFFF THEN __TRY CmpCharDevice.CDClose(hDevice,Result); __CATCH ; __ENDTRY iState := 0; END_IF
Last updated: 2026-05-01
Post by wallandreas008 on OPC-Server V3 - keine Items zu sehen...
CODESYS Forge
talk
(Post)
Hallo ich habe ebenfalls Probleme mit dem Verbindungsaufbau zu 3 ABB SPSen nach einem Windows Update. hier meine OPCServer.ini [Server] updaterate=200 publicgroups=0 logevents=1 syncinit=1 PLCs=3 PLC0=PLC1 PLC1=PLC2 PLC2=PLC3 [PLC:PLC1] interfacetype=GATEWAY motorola=1 nologin=0 timeout=10000 tries=3 buffersize=4800 project=ZE_PC01 reconnecttime=10 waittime=12 active=1 logevents=1 logfilter=0 gateway=Tcp/Ip gatewayaddress=localhost gatewayport=1210 parameters=3 device=Tcp/Ip instance=TCPIP_0_101 parameter0=Address value0=192.168.0.101 parameter1=Port value1=1201 parameter2=Motorola byteorder value2=Yes [PLC:PLC2] interfacetype=GATEWAY motorola=1 nologin=0 timeout=10000 tries=3 buffersize=4800 project=ZE_PC02 reconnecttime=15 waittime=10 active=1 logevents=1 logfilter=10 gateway=Tcp/Ip gatewayaddress=localhost gatewayport=1210 parameters=3 device=Tcp/Ip instance=TCPIP_0_102_ parameter0=Address value0=192.168.0.102 parameter1=Port value1=1201 parameter2=Motorola byteorder value2=Yes [PLC:PLC3] interfacetype=GATEWAY motorola=1 nologin=0 timeout=10000 tries=3 buffersize=4800 project=ZE_PC03 reconnecttime=15 waittime=10 active=1 logevents=1 logfilter=10 gateway=Tcp/Ip gatewayaddress=localhost gatewayport=1210 parameters=3 device=Tcp/Ip instance=TCPIP_0_103_ parameter0=Address value0=192.168.0.103 parameter1=Port value1=1201 parameter2=Motorola byteorder value2=Yes [Redundancy] NumOfGroups=0 Im Logfile habe ich immer diese Meldungen: ;********* ;<loggername>OPCServer.log</loggername> ;<logoptions> ; <maxfiles>0</maxfiles> ; <maxfilesize>1048576</maxfilesize> ;</logoptions> ;********* 2026-09-29T12:01:40.598+0200, OPC-Server V3.5.20.0 by CODESYS Development GmbH. 2026-09-29T12:01:40.598+0200, Path for ini-File: C:\ProgramData\CODESYSOPC\OPCServer.ini 2026-09-29T12:01:40.598+0200, Path for AE-Config: C:\Program Files (x86)\CODESYS 3.5.20.0\CODESYS OPC Server 3\OPCServerA.ini 2026-09-29T12:01:40.598+0200, AE-Configuration unused. 2026-09-29T12:01:40.598+0200, 3 PLCs configured 2026-09-29T12:01:40.598+0200, [PLC1]: Try to open connection... 2026-09-29T12:01:40.599+0200, [PLC2]: Try to open connection... 2026-09-29T12:01:40.599+0200, [PLC3]: Try to open connection... 2026-09-29T12:01:40.599+0200, [PLC1]: Open communication successful 2026-09-29T12:01:40.600+0200, [__CommState] : Initially added implicit variable. 2026-09-29T12:01:40.601+0200, [__CommStateOK] : Initially added implicit variable. 2026-09-29T12:01:40.601+0200, [PLC1]: ---------- Configuration ---------- 2026-09-29T12:01:40.601+0200, [PLC2]: Open communication successful 2026-09-29T12:01:40.601+0200, [__CommState] : Initially added implicit variable. 2026-09-29T12:01:40.601+0200, [PLC1]: PLCHandler Version: 3.5.20.0 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->ulId = 0, m_pPlcConfig->pszName = PLC1 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->it = IT_GATEWAY, m_pPlcConfig->bActive = 1 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->bLogToFile = 1, m_pPlcConfig->ulLogFilter = 0xF 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->bMotorola = 1, m_pPlcConfig->bLogin = 1 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->ulBufferSize = 4800, m_pPlcConfig->bPreCheckIdentity = 0 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->ulHwVersion = 0 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->ulTimeout = 10000, m_pPlcConfig->ulNumTries = 3 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->ulWaitTime = 12000, m_pPlcConfig->ulReconnectTime = 10000 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->pszProjectName = ZE_PC01 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->gwc->pszDeviceName = Tcp/Ip 2026-09-29T12:01:40.601+0200, [PLC1]: m_pPlcConfig->gwc->pszAddress = localhost, m_pPlcConfig->gwc->ulPort = 1210 2026-09-29T12:01:40.601+0200, [__CommStateOK] : Initially added implicit variable. 2026-09-29T12:01:40.601+0200, [PLC2]: ---------- Configuration ---------- 2026-09-29T12:01:40.601+0200, [PLC3]: Open communication successful 2026-09-29T12:01:40.601+0200, [PLC2]: PLCHandler Version: 3.5.20.0 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->ulId = 1, m_pPlcConfig->pszName = PLC2 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->it = IT_GATEWAY, m_pPlcConfig->bActive = 1 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->bLogToFile = 1, m_pPlcConfig->ulLogFilter = 0xF 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->bMotorola = 1, m_pPlcConfig->bLogin = 1 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->ulBufferSize = 4800, m_pPlcConfig->bPreCheckIdentity = 0 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->ulHwVersion = 0 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->ulTimeout = 10000, m_pPlcConfig->ulNumTries = 3 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->ulWaitTime = 10000, m_pPlcConfig->ulReconnectTime = 15000 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->pszProjectName = ZE_PC02 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->gwc->pszDeviceName = Tcp/Ip 2026-09-29T12:01:40.601+0200, [PLC2]: m_pPlcConfig->gwc->pszAddress = localhost, m_pPlcConfig->gwc->ulPort = 1210 2026-09-29T12:01:40.601+0200, [PLC2]: m_pDeviceDesc->pszName = Tcp/Ip 2026-09-29T12:01:40.601+0200, [__CommState] : Initially added implicit variable. 2026-09-29T12:01:40.601+0200, [PLC2]: m_pDeviceDesc->pszInstance = TCPIP_0_102_ 2026-09-29T12:01:40.601+0200, [PLC2]: m_pDeviceDesc->ulNumParams = 5 2026-09-29T12:01:40.601+0200, [PLC2]: parameter0 = Address, value0 = 192.168.0.102 2026-09-29T12:01:40.601+0200, [PLC2]: parameter1 = Port, value1 = 1201 2026-09-29T12:01:40.601+0200, [PLC2]: parameter2 = Motorola byteorder, value2 = Yes 2026-09-29T12:01:40.601+0200, [PLC2]: parameter3 = SymbolFilePath, value3 = C:\Windows\system32\ 2026-09-29T12:01:40.601+0200, [PLC2]: parameter4 = WriteThroughReadCache, value4 = 1 2026-09-29T12:01:40.601+0200, [PLC2]: ----------------------------------- 2026-09-29T12:01:40.601+0200, [PLC2]: CPLCHandler: Interface: IT_GATEWAY used 2026-09-29T12:01:40.602+0200, [PLC1]: m_pDeviceDesc->pszName = Tcp/Ip 2026-09-29T12:01:40.602+0200, [PLC1]: m_pDeviceDesc->pszInstance = TCPIP_0_101 2026-09-29T12:01:40.602+0200, [__CommStateOK] : Initially added implicit variable. 2026-09-29T12:01:40.602+0200, [PLC3]: ---------- Configuration ---------- 2026-09-29T12:01:40.602+0200, [PLC3]: PLCHandler Version: 3.5.20.0 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->ulId = 2, m_pPlcConfig->pszName = PLC3 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->it = IT_GATEWAY, m_pPlcConfig->bActive = 1 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->bLogToFile = 1, m_pPlcConfig->ulLogFilter = 0xF 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->bMotorola = 1, m_pPlcConfig->bLogin = 1 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->ulBufferSize = 4800, m_pPlcConfig->bPreCheckIdentity = 0 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->ulHwVersion = 0 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->ulTimeout = 10000, m_pPlcConfig->ulNumTries = 3 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->ulWaitTime = 10000, m_pPlcConfig->ulReconnectTime = 15000 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->pszProjectName = ZE_PC03 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->gwc->pszDeviceName = Tcp/Ip 2026-09-29T12:01:40.602+0200, [PLC3]: m_pPlcConfig->gwc->pszAddress = localhost, m_pPlcConfig->gwc->ulPort = 1210 2026-09-29T12:01:40.602+0200, [PLC3]: m_pDeviceDesc->pszName = Tcp/Ip 2026-09-29T12:01:40.602+0200, [PLC3]: m_pDeviceDesc->pszInstance = TCPIP_0_103_ 2026-09-29T12:01:40.602+0200, [PLC3]: m_pDeviceDesc->ulNumParams = 5 2026-09-29T12:01:40.602+0200, [PLC3]: parameter0 = Address, value0 = 192.168.0.103 2026-09-29T12:01:40.602+0200, [PLC3]: parameter1 = Port, value1 = 1201 2026-09-29T12:01:40.602+0200, [PLC3]: parameter2 = Motorola byteorder, value2 = Yes 2026-09-29T12:01:40.602+0200, [PLC3]: parameter3 = SymbolFilePath, value3 = C:\Windows\system32\ 2026-09-29T12:01:40.602+0200, [PLC3]: parameter4 = WriteThroughReadCache, value4 = 1 2026-09-29T12:01:40.602+0200, [PLC3]: ----------------------------------- 2026-09-29T12:01:40.602+0200, [PLC3]: CPLCHandler: Interface: IT_GATEWAY used 2026-09-29T12:01:40.603+0200, [PLC1]: m_pDeviceDesc->ulNumParams = 5 2026-09-29T12:01:40.603+0200, [PLC1]: parameter0 = Address, value0 = 192.168.0.101 2026-09-29T12:01:40.603+0200, [PLC1]: parameter1 = Port, value1 = 1201 2026-09-29T12:01:40.603+0200, [PLC1]: parameter2 = Motorola byteorder, value2 = Yes 2026-09-29T12:01:40.603+0200, [PLC1]: parameter3 = SymbolFilePath, value3 = C:\Windows\system32\ 2026-09-29T12:01:40.603+0200, [PLC1]: parameter4 = WriteThroughReadCache, value4 = 1 2026-09-29T12:01:40.603+0200, [PLC1]: ----------------------------------- 2026-09-29T12:01:40.603+0200, [PLC1]: CPLCHandler: Interface: IT_GATEWAY used 2026-09-29T12:01:40.623+0200, [PLC2]: CPLCHandler: Reconnect[1]: Reconnect cycle begin... 2026-09-29T12:01:40.623+0200, [PLC3]: CPLCHandler: Reconnect[1]: Reconnect cycle begin... 2026-09-29T12:01:40.623+0200, [PLC1]: CPLCHandler: Reconnect[1]: Reconnect cycle begin... 2026-09-29T12:01:40.623+0200, [PLC1]: CPLCHandler: Reconnect[1]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:01:40.623+0200, [PLC3]: CPLCHandler: Reconnect[1]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:01:40.625+0200, [PLC2]: CPLCHandler: Reconnect[1]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:01:40.850+0200, * ERROR: [PLC2]: CPLCHandler: Reconnect[1]: FAILED! Symbols were loaded offline 2026-09-29T12:01:40.850+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[1]: FAILED! Symbols were loaded offline 2026-09-29T12:01:40.851+0200, [PLC2]: Open communication successful 2026-09-29T12:01:40.851+0200, [PLC2]: Starting adding new symbols 746... 2026-09-29T12:01:40.852+0200, [PLC3]: Open communication successful 2026-09-29T12:01:40.852+0200, [PLC3]: Starting adding new symbols 1168... 2026-09-29T12:01:40.875+0200, [PLC2]: Adding symbols finished 2026-09-29T12:01:40.875+0200, [PLC2]: CPLCHandler: Reconnect[1]: Reconnect cycle end 2026-09-29T12:01:40.881+0200, [PLC3]: Adding symbols finished 2026-09-29T12:01:40.881+0200, [PLC3]: CPLCHandler: Reconnect[1]: Reconnect cycle end 2026-09-29T12:01:45.928+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[1]: FAILED! Symbols were loaded offline 2026-09-29T12:01:45.928+0200, [PLC1]: Open communication successful 2026-09-29T12:01:45.929+0200, [PLC1]: Starting adding new symbols 499... 2026-09-29T12:01:45.933+0200, [PLC1]: Adding symbols finished 2026-09-29T12:01:45.933+0200, [PLC1]: CPLCHandler: Reconnect[1]: Reconnect cycle end 2026-09-29T12:01:46.110+0200, OPC-Server started successful. 2026-09-29T12:01:50.625+0200, [PLC1]: CPLCHandler: Reconnect[2]: Reconnect cycle begin... 2026-09-29T12:01:50.625+0200, [PLC1]: CPLCHandler: Reconnect[2]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:01:55.625+0200, [PLC3]: CPLCHandler: Reconnect[2]: Reconnect cycle begin... 2026-09-29T12:01:55.625+0200, [PLC2]: CPLCHandler: Reconnect[2]: Reconnect cycle begin... 2026-09-29T12:01:55.625+0200, [PLC2]: CPLCHandler: Reconnect[2]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:01:55.625+0200, [PLC3]: CPLCHandler: Reconnect[2]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:01:55.625+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[2]: FAILED! 2026-09-29T12:01:55.625+0200, [PLC3]: CPLCHandler: Reconnect[2]: Reconnect cycle end 2026-09-29T12:01:55.699+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[2]: FAILED! 2026-09-29T12:01:55.699+0200, [PLC1]: CPLCHandler: Reconnect[2]: Reconnect cycle end 2026-09-29T12:01:59.341+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[2]: FAILED! 2026-09-29T12:01:59.341+0200, [PLC2]: CPLCHandler: Reconnect[2]: Reconnect cycle end 2026-09-29T12:02:00.626+0200, [PLC1]: CPLCHandler: Reconnect[3]: Reconnect cycle begin... 2026-09-29T12:02:00.626+0200, [PLC1]: CPLCHandler: Reconnect[3]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:05.700+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[3]: FAILED! 2026-09-29T12:02:05.700+0200, [PLC1]: CPLCHandler: Reconnect[3]: Reconnect cycle end 2026-09-29T12:02:10.626+0200, [PLC3]: CPLCHandler: Reconnect[3]: Reconnect cycle begin... 2026-09-29T12:02:10.626+0200, [PLC2]: CPLCHandler: Reconnect[3]: Reconnect cycle begin... 2026-09-29T12:02:10.626+0200, [PLC3]: CPLCHandler: Reconnect[3]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:10.626+0200, [PLC2]: CPLCHandler: Reconnect[3]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:10.626+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[3]: FAILED! 2026-09-29T12:02:10.626+0200, [PLC2]: CPLCHandler: Reconnect[3]: Reconnect cycle end 2026-09-29T12:02:10.627+0200, [PLC1]: CPLCHandler: Reconnect[4]: Reconnect cycle begin... 2026-09-29T12:02:10.627+0200, [PLC1]: CPLCHandler: Reconnect[4]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:10.627+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[4]: FAILED! 2026-09-29T12:02:10.627+0200, [PLC1]: CPLCHandler: Reconnect[4]: Reconnect cycle end 2026-09-29T12:02:15.693+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[3]: FAILED! 2026-09-29T12:02:15.693+0200, [PLC3]: CPLCHandler: Reconnect[3]: Reconnect cycle end 2026-09-29T12:02:20.627+0200, [PLC1]: CPLCHandler: Reconnect[5]: Reconnect cycle begin... 2026-09-29T12:02:20.627+0200, [PLC1]: CPLCHandler: Reconnect[5]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:25.626+0200, [PLC3]: CPLCHandler: Reconnect[4]: Reconnect cycle begin... 2026-09-29T12:02:25.626+0200, [PLC2]: CPLCHandler: Reconnect[4]: Reconnect cycle begin... 2026-09-29T12:02:25.626+0200, [PLC2]: CPLCHandler: Reconnect[4]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:25.626+0200, [PLC3]: CPLCHandler: Reconnect[4]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:25.626+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[4]: FAILED! 2026-09-29T12:02:25.626+0200, [PLC3]: CPLCHandler: Reconnect[4]: Reconnect cycle end 2026-09-29T12:02:25.699+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[5]: FAILED! 2026-09-29T12:02:25.699+0200, [PLC1]: CPLCHandler: Reconnect[5]: Reconnect cycle end 2026-09-29T12:02:30.629+0200, [PLC1]: CPLCHandler: Reconnect[6]: Reconnect cycle begin... 2026-09-29T12:02:30.629+0200, [PLC1]: CPLCHandler: Reconnect[6]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:30.675+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[4]: FAILED! 2026-09-29T12:02:30.675+0200, [PLC2]: CPLCHandler: Reconnect[4]: Reconnect cycle end 2026-09-29T12:02:34.710+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[6]: FAILED! 2026-09-29T12:02:34.710+0200, [PLC1]: CPLCHandler: Reconnect[6]: Reconnect cycle end 2026-09-29T12:02:40.627+0200, [PLC2]: CPLCHandler: Reconnect[5]: Reconnect cycle begin... 2026-09-29T12:02:40.627+0200, [PLC2]: CPLCHandler: Reconnect[5]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:40.628+0200, [PLC3]: CPLCHandler: Reconnect[5]: Reconnect cycle begin... 2026-09-29T12:02:40.628+0200, [PLC3]: CPLCHandler: Reconnect[5]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:40.628+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[5]: FAILED! 2026-09-29T12:02:40.628+0200, [PLC3]: CPLCHandler: Reconnect[5]: Reconnect cycle end 2026-09-29T12:02:40.630+0200, [PLC1]: CPLCHandler: Reconnect[7]: Reconnect cycle begin... 2026-09-29T12:02:40.630+0200, [PLC1]: CPLCHandler: Reconnect[7]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:40.630+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[7]: FAILED! 2026-09-29T12:02:40.630+0200, [PLC1]: CPLCHandler: Reconnect[7]: Reconnect cycle end 2026-09-29T12:02:44.711+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[5]: FAILED! 2026-09-29T12:02:44.711+0200, [PLC2]: CPLCHandler: Reconnect[5]: Reconnect cycle end 2026-09-29T12:02:50.631+0200, [PLC1]: CPLCHandler: Reconnect[8]: Reconnect cycle begin... 2026-09-29T12:02:50.631+0200, [PLC1]: CPLCHandler: Reconnect[8]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:55.628+0200, [PLC2]: CPLCHandler: Reconnect[6]: Reconnect cycle begin... 2026-09-29T12:02:55.628+0200, [PLC2]: CPLCHandler: Reconnect[6]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:55.629+0200, [PLC3]: CPLCHandler: Reconnect[6]: Reconnect cycle begin... 2026-09-29T12:02:55.629+0200, [PLC3]: CPLCHandler: Reconnect[6]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:02:55.629+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[6]: FAILED! 2026-09-29T12:02:55.629+0200, [PLC3]: CPLCHandler: Reconnect[6]: Reconnect cycle end 2026-09-29T12:02:55.690+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[8]: FAILED! 2026-09-29T12:02:55.690+0200, [PLC1]: CPLCHandler: Reconnect[8]: Reconnect cycle end 2026-09-29T12:02:59.692+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[6]: FAILED! 2026-09-29T12:02:59.692+0200, [PLC2]: CPLCHandler: Reconnect[6]: Reconnect cycle end 2026-09-29T12:03:00.632+0200, [PLC1]: CPLCHandler: Reconnect[9]: Reconnect cycle begin... 2026-09-29T12:03:00.632+0200, [PLC1]: CPLCHandler: Reconnect[9]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:04.716+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[9]: FAILED! 2026-09-29T12:03:04.716+0200, [PLC1]: CPLCHandler: Reconnect[9]: Reconnect cycle end 2026-09-29T12:03:10.628+0200, [PLC2]: CPLCHandler: Reconnect[7]: Reconnect cycle begin... 2026-09-29T12:03:10.628+0200, [PLC2]: CPLCHandler: Reconnect[7]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:10.629+0200, [PLC3]: CPLCHandler: Reconnect[7]: Reconnect cycle begin... 2026-09-29T12:03:10.629+0200, [PLC3]: CPLCHandler: Reconnect[7]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:10.629+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[7]: FAILED! 2026-09-29T12:03:10.629+0200, [PLC3]: CPLCHandler: Reconnect[7]: Reconnect cycle end 2026-09-29T12:03:10.632+0200, [PLC1]: CPLCHandler: Reconnect[10]: Reconnect cycle begin... 2026-09-29T12:03:10.632+0200, [PLC1]: CPLCHandler: Reconnect[10]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:10.632+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[10]: FAILED! 2026-09-29T12:03:10.633+0200, [PLC1]: CPLCHandler: Reconnect[10]: Reconnect cycle end 2026-09-29T12:03:14.762+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[7]: FAILED! 2026-09-29T12:03:14.762+0200, [PLC2]: CPLCHandler: Reconnect[7]: Reconnect cycle end 2026-09-29T12:03:20.634+0200, [PLC1]: CPLCHandler: Reconnect[11]: Reconnect cycle begin... 2026-09-29T12:03:20.634+0200, [PLC1]: CPLCHandler: Reconnect[11]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:24.730+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[11]: FAILED! 2026-09-29T12:03:24.730+0200, [PLC1]: CPLCHandler: Reconnect[11]: Reconnect cycle end 2026-09-29T12:03:25.630+0200, [PLC2]: CPLCHandler: Reconnect[8]: Reconnect cycle begin... 2026-09-29T12:03:25.630+0200, [PLC2]: CPLCHandler: Reconnect[8]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:25.631+0200, [PLC3]: CPLCHandler: Reconnect[8]: Reconnect cycle begin... 2026-09-29T12:03:25.631+0200, [PLC3]: CPLCHandler: Reconnect[8]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:25.631+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[8]: FAILED! 2026-09-29T12:03:25.631+0200, [PLC3]: CPLCHandler: Reconnect[8]: Reconnect cycle end 2026-09-29T12:03:29.742+0200, ERROR: [PLC2]: CPLCHandler: Reconnect[8]: FAILED! 2026-09-29T12:03:29.742+0200, [PLC2]: CPLCHandler: Reconnect[8]: Reconnect cycle end 2026-09-29T12:03:30.635+0200, [PLC1]: CPLCHandler: Reconnect[12]: Reconnect cycle begin... 2026-09-29T12:03:30.635+0200, [PLC1]: CPLCHandler: Reconnect[12]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:34.717+0200, ERROR: [PLC1]: CPLCHandler: Reconnect[12]: FAILED! 2026-09-29T12:03:34.718+0200, [PLC1]: CPLCHandler: Reconnect[12]: Reconnect cycle end 2026-09-29T12:03:40.630+0200, [PLC2]: CPLCHandler: Reconnect[9]: Reconnect cycle begin... 2026-09-29T12:03:40.630+0200, [PLC2]: CPLCHandler: Reconnect[9]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:40.631+0200, [PLC3]: CPLCHandler: Reconnect[9]: Reconnect cycle begin... 2026-09-29T12:03:40.632+0200, [PLC3]: CPLCHandler: Reconnect[9]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:40.632+0200, ERROR: [PLC3]: CPLCHandler: Reconnect[9]: FAILED! 2026-09-29T12:03:40.632+0200, [PLC3]: CPLCHandler: Reconnect[9]: Reconnect cycle end 2026-09-29T12:03:40.637+0200, [PLC1]: CPLCHandler: Reconnect[13]: Reconnect cycle begin... 2026-09-29T12:03:40.637+0200, [PLC1]: CPLCHandler: Reconnect[13]: STATE_PLC_NOT_CONNECTED: tries to open channel... 2026-09-29T12:03:40.637+0200, * ERROR: [PLC1]: CPLCHandler: Reconnect[13]: FAILED! 2026-09-29T12:03:40.637+0200, [PLC1]: CPLCHandler: Reconnect[13]: Reconnect cycle end Ich kenne mich nicht so gut aus mit dem Thema OPC. Aber bis vor dem Windows Update hat es funktioniert.. Bin mit meiner Fehlersuche langsam am Ende...!
Last updated: 2026-09-29
Post by ofey on Testing of Codesys program
CODESYS Forge
talk
(Post)
Hi! I thought to hear what you guys think is the best way to test the program in my scenario. I have some PLC programs that have been made and deployed on different PLC's. The program has added the specific devices and IO that is applicable. I have made a test environment for everything outside of the PLC, ie. the same SCADA system that is talking to the PLC, and a program running locally is simulating the plant (level regulation of different tanks). Pr. now I have had to manually change the variables that are reading/writing values from the IO so they read/write via OPC instead. I also have to change the device tree from the specific PLC rack, to the soft PLC. So I kind of end up with two different programs that I have to maintain. I was just wondering if you believe there is an easier way to do this. So I can have the exactly same program and kind of switch between the soft mode, and the "real" mode.
Last updated: 2023-12-07
Post by bbm1995 on Camera RTSP Feed
CODESYS Forge
talk
(Post)
Hi dgrard, I had the same issue for a long time, but on a WAGO webvisu. Now I'm glad that I can share my solution. I don't know if you are trying to use the webvisu or the target visu, but this works on webvisu: Get "go2rtc" and set it up according to the documentation. I'm running the Windows binary. Here's my example of the go2rtc.yaml config file (contains working example streams): api: listen: ":1984" # default ":1984", HTTP API port ("" - disabled) origin: "*" # default "", allow CORS requests (only * supported) static_dir: "www" # default "", folder for static files (custom web interface) tls_listen: ":443" # default "", enable HTTPS server tls_cert: "./SSL/fullchain.pem" tls_key: "./SSL/privatekey.pem" streams: # Streams with multiple links will fall back on the next link. ABUS TVIP48511: - rtsp://<username>:<password>@<hostname>:<port>/ch1/main - rtsp://<username>:<password>@<hostname>:<port>/ch1/sub # Diagnostic connections Kirchhoff Institute for Physics - Germany: http://pendelcam.kip.uni-heidelberg.de/mjpg/video.mjpg Blanton Bottling, Kentucky - USA: http://camera.buffalotrace.com/mjpg/video.mjpg Tokyo - Japan: http://61.211.241.239/nphMotionJpeg?Resolution=320x240&Quality=Standard Tampere Hacklab - Finland: http://tamperehacklab.tunk.org:38001/nphMotionJpeg?Resolution=640x480&Quality=Clarity Soltorget Pajala - Sweden: http://195.196.36.242/mjpg/video.mjpg Kaiskuru Skistadion - Norway: http://77.222.181.11:8080/mjpg/video.mjpg webrtc: listen: ":8555" #ice_servers: # - urls: [ "stun:localhost:3478" ] # username: "" # credential: "" Access the webinterface of go2rtc and get the link of your stream. Use the link as for your browser frame in the visualization. Depending on your device, you need to be able to access the file /etc/lighttpd/lighttpd.conf or /etc/lighttpd/webvisu.conf and change the contents similar to this one, otherwise you'll get CORS and CSP errors in the browser and you won't be able to view the stream on the webvisu: # Webvisu specific settings $SERVER["socket"] =~ port_webvisu_used_any { url.redirect += ( "^/webvisu/?$" => "/webvisu/webvisu.htm" ) $HTTP["url"] =~ "^/webvisu/?" { var.response_header_policy_webvisu = ( # CSP for WebVisu, allowing inline sources. "Content-Security-Policy" => "default-src 'self' 'unsafe-inline'; media-src *; frame-src *", # CORS for WebVisu, allowing any origin to access. "Access-Control-Allow-Origin" => "*", # Tell older browsers that this page can only be displayed if all ancestor # frames are same origin to the page itself. "X-Frame-Options" => "SAMEORIGIN" ) # Response header policy for WebVisu setenv.set-response-header = var.response_header_policy_webvisu setenv.set-response-header += var.response_header_policy_common }
Last updated: 2023-11-14
Post by danp1406 on Question about Demo License limitations for Modbus TCP communication and Fieldbus Instances
CODESYS Forge
talk
(Post)
Hello everyone, I am currently working with CODESYS Virtual Control for Linux running in Docker on a Debian virtual machine. I am deploying my application using Deploy Control SL, and in my project I am using the ModbusFB library to implement Modbus TCP communication. My setup is the following: I am trying to establish a Modbus TCP connection between a virtual PLC (CODESYS acting as Modbus TCP Client/Master) and a Siemens S7-1200 PLC acting as a Modbus TCP Server. From the Debian VM, I can successfully ping the S7-1200 and verify that port 502 is open using tools like nc. Network-wise, everything appears to be correct. However, when running the application in CODESYS, I receive messages such as “Demo mode for Modbus/TCP Master started. Will expire and stop!” and socket errors like “ClientSocket.UpdateStatus socket error 111 disconnecting.” The ClientTCP block from the ModbusFB library attempts to connect, but the connection does not remain stable. My main question is whether the CODESYS demo license explicitly limits or interrupts Modbus TCP Master communication. Is it expected that in demo mode the runtime will automatically close sockets after some time or prevent stable Modbus TCP connections? I would like to confirm whether this behavior is normal when using ModbusFB in demo mode, or if I should continue troubleshooting the configuration. Additionally, I would like clarification regarding the “fieldbus instances” mentioned in CODESYS licensing options (for example, 2, 4, or 16 instances). What exactly is considered one fieldbus instance? Does one Modbus TCP Client block count as one instance? Does each active connection to a different device count separately? Do Modbus TCP Master and Server count independently toward the total number of instances? Finally, I would appreciate clarification on any other practical limitations of demo mode when using industrial communication libraries such as ModbusFB. Are there limits on the number of connections, number of requests, or communication duration? I am trying to determine whether demo mode is sufficient for testing a virtual PLC communicating with a Siemens S7-1200 over Modbus TCP, or whether a full license is required even for this kind of validation scenario. Thank you in advance for any guidance.
Last updated: 2026-02-25
Post by alexgooi on Modbus TCP interface get stuck
CODESYS Forge
talk
(Post)
Dear Forum, I'm currently experimenting with Modbus interfaces in combination with a virtual controller. I have the following setup (Modbus_Setup.png): I have an IPC with Debian installed on it (Debian 13). On this Debian machine I have installed a docker server and on this docker server a Codesys runtime container is deployed (Codesys_image.png). The Modbus scanner makes connection with and IO coupler and this works well. But when I physically disconnect the ethernet connection between the IPC and the IO coupler the Modbus interface gets stuck in a state where it gets stuck in the busy state (Modbus_Stuck.png). When I plug the cable back in, the IO coupler isn't communicating until the xBusy variable is manually set to False, after this action is performed the communication goes back to normal. I have tried to set the container network to host and bridge (Network.png), but both version gives the same result (stuck scanner). I would expect that the Modbus interface is generating a timeout after 1 sec, because this is how it is setup (Modbus_settings.png), but this is not what happens. I have thought to write a piece of code that writes xBusy to false when it is stuck but because it is an output I'm not able to write to it. I have tried this with another PC (different CPU/motherboard) but this gives the same outcome. I tried updating to the latest version of Virtual control (4.20) but this gives the same result. I also tried to do the same thing with an ethernet IP scanner, and this gives an error after the timeout is expired (so this works well). I have tried to connect to the IO coupler using the Modbus_FB lib (Modbus_FB.png) the FB's are giving the correct errors and behaving as expected. At last I have tried to use a Scanner on a Codesys controller (no IPC) and here the scanner behaves as expected (an alarm is triggered after the timeout has been expired). The version of the Codesys components are listed in the picture Versions.png Is there anyone that can give me a push in the right direction? Kind regards Alex
Last updated: 2026-04-14
Post by mondinmr on COL.IMap2 and HashTableFactory cause frequent Access Violation
CODESYS Forge
talk
(Post)
Good morning, I’ve been using the Collection library for a long time, mostly with Stack, LinkedList, and List. From your examples I was able to manage the different factories, even for custom elements. Now I need a hashtable, but with this object I’m running into a lot of random access violations. If I append something inside FB_Init after constructing the hashtable, it crashes, even though the list was already created. If I only create the hashtable in FB_Init and append afterwards, it usually works. I don’t understand the meaning of the dispose call in this code: pSlave := ADR(slave); uSlave := TO_ULINT(pSlave); iKey := fKey.Create(uSlave); IF hash.CountKeys() = 0 THEN Service.logger.appendLog('Filling hashtable', 'HashManager', AdvLogType.AdvDebugMsg); ok := FALSE; ELSE eError := hash.ContainsKey(iKey, xResult => ok); END_IF IF NOT ok THEN pI := __NEW(UINT); iVal := fKey.Create(TO_ULINT(pI)); Service.logger.appendLog(CONCAT('New slave', TO_STRING(uSlave)), 'HashManager', AdvLogType.AdvDebugMsg); hash.AddKeyValuePair(iKey, iVal); appendNewSlave := pI; ELSE eError := hash.GetElementByKey(iKey, itfValue => iElem); xResult := __QUERYINTERFACE(iKey, itfIInstance); IF xResult THEN itfIInstance.Dispose(); END_IF IF eError <> COL.COLLECTION_ERROR.NO_ERROR THEN Service.logger.appendLog(CONCAT('ERROR ', TO_STRING(eError)), 'HashManager', AdvLogType.AdvCriticalMsg); appendNewSlave := nullptr; RETURN; END_IF __QUERYINTERFACE(iElem, iVal); {warning disable C0033} pI := TO___UXINT(iVal.UlintValue); {warning restore C0033} appendNewSlave := pI; END_IF Without the dispose call, every second cold reset crashes immediately when I try to access iVal, even if eError doesn’t report any error. With the dispose call, the cold reset issue disappears, but I get other problems: a) If I start the runtime using systemctl start codesyscontrol, it crashes at IF hash.CountKeys() = 0 THEN b) If I delete the files in PlcLogic and download again, it works and survives multiple cold resets. But as soon as I run systemctl restart codesyscontrol, everything gets corrupted again and it starts crashing at that point. FUNCTION_BLOCK SlaveMapCounter VAR hash : COL.IMap2; eError : COL.COLLECTION_ERROR; END_VAR In its FB_Init I create it: METHOD FB_Init: BOOL VAR_INPUT bInitRetains: BOOL; // TRUE: retain variables are initialized (reset warm / reset cold) bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change) END_VAR VAR hF : COL.HashTableFactory; END_VAR hash := hF.Create(256); In another FB I instantiate it statically: FUNCTION_BLOCK ABSTRACT AbstractServoEthercatController EXTENDS AbstractServoController VAR_STAT hashSlaves : SlaveMapCounter; END_VAR VAR field : REFERENCE TO ADVAbstractFieldUnitEthercatCia402; initCnt : REFERENCE TO UINT; END_VAR The append method is the one shown above, and I call it after the runtime has started. The accesses are performed by a single task, and in any case I’m working on an isolated single core. I’ve tried everything, moving the create, the instances, and all the rest several times, but nothing seems to work. I’d like to point out that these FBs are part of our own library, which is used in many applications.
Last updated: 2025-09-11
Post by brouwyka on JSONByteArrayWriter string result incorrect order
CODESYS Forge
talk
(Post)
Hi @TimvH, As discussed in our email contact, your example does not actually test/reproduce the bug I am describing: Adding to the JSON builder on later cycles works fine. Your example works because you do the following: 1. You finish the first cycle (xFirst) with adding an object to the array with 2 fields; 2. When the next cycle is triggered (xAdd), you immediately start with adding another object to that array. This works fine as the last thing you did before #2 was the addition of the array and an object to it. To reproduce the bug you should be doing the following instead, as I showed with the code I shared with my first post: 1. Create the array - save the index that is returned; 2. Add an item, either a primitive or an object, to the array; 3. Add an item outside the array (anything: a primitive, a new array, a nested object, etc); 4. Add another item to the array using the index you saved at #1. You will now see, as I shared in my initial post, that the second item is placed completely outside the root JSON object. This also happens to anything else you try to add after step #4: everything after this point will be added outside the root JSON object: the JSON is completely broken. Important to note is that this not only happens with arrays, but also with nested JSON objects. Once you add something outside of a nested JSON object, you can no longer add anything to that nested JSON object, as that causes the exact same bug. This also applies to arrays of objects, so if in your test you had tried adding a new key-value pair to the first nested object in your array after you created the second nested object, you would also run into this bug. It seems that the JSONByteArrayWriter (I haven't tested the other writers in the JSON Utilities SL library, so I don't know if they suffer from the same problem) simply does not handle any JSON fields that add brackets (so arrays with "[" & "]" and nested objects with "{" & "}") well, and closes them prematurely instead of checking if any later JSONElements in the JSONData's array belong to any of these bracketed fields. After reviewing the objects & functions of the JSON Utilities SL library, my guess is that either the JSONByteArrayWriter linearly goes through the array of JSONElements in the JSONData and only checks the diParentIndex of each JSONElement in direct ascending order, OR if it does use the JSONElement.GetChildren(); method, that this method is either broken and doesn't give all children correctly to the writer. Neither explains why everything completely breaks, and you cannot even add to the root JSON object anymore, however, so there is probably more than just that going wrong in the writer. To me, after a full week of testing and attempting workarounds, this seems like a bug in the library that needs to be fixed by Codesys, as I cannot see anything wrong in the JSONData constructed by the JSONBuilder - this seems purely a problem in the writer.
Last updated: 2026-06-15
Post by edson-bueno on SysProcess Execute Command unable to run commands with special characters
CODESYS Forge
talk
(Post)
Hi, I found the same issue, and I fixed with this steps: 1st go to codesys .cfg file. sudo nano CODESYSControl.cfg Then insert this: [SysProcess] BasePriority=Realtime Command=AllowAll Now we need to grant codesys root rights on Linux. Step 1: Create or edit the systemd override configuration: sudo systemctl edit codesyscontrol In the editor that opens, insert: [Service] User=root Save and exit: Press Ctrl+O to save Press Ctrl+X to exit Step 2: Reload systemd and reboot To apply the override: sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo reboot Step 3: Confirm CODESYS is running as root After reboot, open the terminal and run: ps aux | grep codesyscontrol You should see something like: root 1234 ... /opt/codesys/bin/codesyscontrol.bin ... If instead it shows admin or another user, the override was not applied correctly. Step 4: (Optional) Confirm from within CODESYS In your CODESYS project, insert this test code to run the Linux command whoami: Make sure the lib SysProcessImplementation, SysTypes, and CmpErrors is on the project. VAR sCommand : STRING := '/usr/bin/whoami'; sOutput : STRING(255); refCommand : REFERENCE TO STRING; refOutput : REFERENCE TO STRING; resultCmd : UDINT; END_VAR refCommand REF= sCommand; refOutput REF= sOutput; SysProcessExecuteCommand2( pszCommand := refCommand, pszStdOut := refOutput, udiStdOutLen := SIZEOF(sOutput), pResult := ADR(resultCmd) ); Notes & Warnings This method gives full system access to the CODESYS runtime — do not expose this system to the public network without protection. Do not use sudo in commands inside CODESYS when the runtime is already running as root. @tomas111, in case you want to read the temperatur, use this command: sCommand:STRING:='/usr/bin/vcgencmd measure_temp';
Last updated: 2025-05-20
Post by e13740e on Сalling the context menu from the keyboard
CODESYS Forge
talk
(Post)
Hello. I have a question for you, perhaps you have an answer to it. Regarding calling the Context menu from the keyboard in Devices, specifically calling the context menu window from the keyboard via an assigned combination. Goal: to have the ability to navigationally add internal Objects (Methods, Properties) to Function Blocks from the keyboard without using the mouse. The Codesys environment interface does not allow Windows access to this via Shift+F10. Externally (outside the Codesys environment), the hotkey call for the context menu (Shift+F10) from the keyboard works in various environments, but at the same time, in Codesys it does not (it doesn't work). I have already tried various options on my own to achieve this (but unsuccessfully): Tools\Customize\Keyboard\Objects (the set combination does not give the desired result) Tools\Customize\Keyboard\Objects... (the set combination is extremely useful as it provides access to adding objects directly to Devices but does not provide the ability to add an internal object (Method/Property) to a Function Block). Thank you in advance for your help!!! P.S. I have already started trying to implement a script-based solution to call the context menu via AutoHotkey - by relocating the mouse cursor to the area of the navigational selection with a subsequent call of the context menu on it and relocating the mouse cursor back to its initial position. And in order not to "reinvent the wheel," I am writing this request to you!!!
Last updated: 2025-10-05
Post by e13740e on Сalling the context menu from the keyboard
CODESYS Forge
talk
(Post)
Hello. I have a question for you, perhaps you have an answer to it. Regarding calling the Context menu from the keyboard in Devices, specifically calling the context menu window from the keyboard via an assigned combination. Goal: to have the ability to navigationally add internal Objects (Methods, Properties) to Function Blocks from the keyboard without using the mouse. The Codesys environment interface does not allow Windows access to this via Shift+F10. Externally (outside the Codesys environment), the hotkey call for the context menu (Shift+F10) from the keyboard works in various environments, but at the same time, in Codesys it does not (it doesn't work). I have already tried various options on my own to achieve this (but unsuccessfully): Tools\Customize\Keyboard\Objects (the set combination does not give the desired result) Tools\Customize\Keyboard\Objects... (the set combination is extremely useful as it provides access to adding objects directly to Devices but does not provide the ability to add an internal object (Method/Property) to a Function Block). Thank you in advance for your help!!! P.S. I have already started trying to implement a script-based solution to call the context menu via AutoHotkey - by relocating the mouse cursor to the area of the navigational selection with a subsequent call of the context menu on it and relocating the mouse cursor back to its initial position. And in order not to "reinvent the wheel," I am writing this request to you!!!
Last updated: 2025-10-05
Post by john-robinson on Limiting Memory Access of an Array to Within its Bounds
CODESYS Forge
talk
(Post)
Recently we had an issue regarding some simple code to calculate a rolling average. The code indexes from zero to 199 to properly store the current input into a circular buffer which then allows us to calculate a rolling average: VAR input_5s : REAL; outs_arr : ARRAY[0..199] OF REAL; i : USINT := 0; END_VAR ___ //this code runs every five seconds, calculating a rolling average outs_arr[i] := input_5s; i := i + 1; output := OSCAT_BASIC.ARRAY_AVG(ADR(outs_arr), SIZEOF(outs_arr)); IF i >= SIZEOF(outs_arr) THEN i := 0; END_IF There is a simple bug in this code where the index will be set to 0 when it has surpassed the length of the array in bytes (800 in this case) rather than larger than the number of reals in the array (200). The solution here is simple, replacing i >= SIZEOF(outs_arr) with i >= SIZEOF(outs_arr)/SIZEOF(outs_arr[0]). In this example when the index increased to 201 and the line outs_arr[201] := input_5s was called, codesys arbitrarily wrote to the address in memory that is where outs_arr[201] would be if the array was that long. I would like to find a way to wrap the codesys array inside of a wrapper class that checks if an input is within the bounds of an array before writing to that value. I know how I would implement that for a specific array, I could create a method or class that takes an input of an array of variable length, ie. ARRAY[*] OF REAL, but I don't know how to make this for any data type. I am wondering if anyone has ever done anything similar to this, or has any better suggestions to ensure that none of the programmers on this application accidentally create code that can arbitrarily write to other locations in memory.
Last updated: 2024-03-05
Post by xcqt on Oop best practice
CODESYS Forge
talk
(Post)
Hi all, I’m currently trying to improve my OOP structure in CODESYS and I’m looking for some input on how others approach this. I understand the basics like inheritance, interfaces, abstract FBs, methods, and properties, but I still struggle a bit with the overall architecture and what’s considered clean or scalable in bigger projects. As an example, I’m working on two different energy meter function blocks: FB_EnergyMeter_MQTT reads data from MQTT (strings) FB_EnergyMeter_Modbus reads data from Modbus (words) Both have their own Update() method and implement the same interface (something like IF_EnergyMeter). Later on, I’ll probably add more meter types, but they should all behave the same from the controller’s point of view. Now, there’s a FB_GridControl block that needs power data from these meters. I see two options here: Define the meter blocks inside FB_GridControl and call them directly (for example fbModbusMeter.UpdateModbus()). Keep the meter blocks outside and pass them into FB_GridControl as interface references, so the control block doesn’t know which specific type of meter it’s dealing with. Option 2 feels cleaner and more flexible to me, but I’m not entirely sure how to handle the data flow in that case. Should I pass the meter instance through an interface reference (REFERENCE TO IF_EnergyMeter)? Or is there a better way to link the external FBs to the control block? I’d like to hear how you structure this kind of setup or see an example from someone who has done something similar. EDIT: I think i need to do something like this fbModbusUpdateInput(wInput:= wWordValue); fbMqttUpdateInput(strInput:= strStringValue); IF bUseMqtt THEN Meter REF = fbMqttUpdateInput; ELSE Meter REF = fbModbusUpdateInput; END_IF fbControl.SetMeter(UsedMeter := Meter); Or am i thinking wrong? Thanks, Thomas
Last updated: 2025-10-16
Post by dclements on Feature Request: Read-Only References / Pointer-to-Const Support
CODESYS Forge
talk
(Post)
I would like to suggest adding support for persistent read-only references or pointers in CODESYS, similar to a C++ pointer-to-const (const T*). For example, something conceptually similar to: POINTER TO CONSTANT ST_MyData or REFERENCE TO CONSTANT ST_MyData The important distinction is that the reference itself may still be passed around or reassigned, but the referenced object cannot be modified through that reference. CODESYS currently supports VAR_IN_OUT CONSTANT, which provides read-only reference semantics for parameters, but there does not appear to be an equivalent type that can be stored in a variable or returned from a method. A practical use case is a registry that owns long-lived definitions. The registry needs to retain ownership of the data while downstream systems maintain persistent references to it. Currently, the main options are: Return the struct by value, which loses reference semantics and requires a copy. Return POINTER TO ST_Definition, which allows consumers to modify registry-owned data. Convert the structure into a Function Block and expose a getter-only interface, which provides the desired encapsulation but introduces more complexity and memory overhead. A read-only reference/pointer type would allow libraries to expose persistent, zero-copy access to internally owned data while preserving encapsulation. This would be particularly useful for library APIs and object-oriented CODESYS architectures where ownership of data should remain with one component while other components are allowed to observe it. Similar requests for constant references/pointers have been discussed on CODESYS Forge previously, so this appears to be a recurring use case rather than something specific to one application.
Last updated: 2026-09-01
Post by kishan on SMC_Interpolator / CNC Abort – ControlAxisByPos Sometimes Remains Busy and Axis Continues Moving
CODESYS Forge
talk
(Post)
Hello, I am working with CODESYS SoftMotion CNC using a preprocessing chain, SMC_Interpolator, and SMC_ControlAxisByPos for controlling the CNC axes. I have noticed an issue when aborting CNC execution. When I execute the Abort command, I abort both the CNC preprocessing blocks and SMC_Interpolator. Normally the CNC process stops correctly. However, occasionally after the abort: SMC_Interpolator has already been aborted. CNC preprocessing has also been aborted/reset. But SMC_ControlAxisByPos.bBusy remains TRUE. The corresponding physical axis can still continue moving for some distance. This does not happen every time. My basic sequence is similar to: G-code / CNC preprocessing ↓ SMC_Interpolator ↓ Transformation ↓ SMC_ControlAxisByPos ↓ SoftMotion Axis When the operator requests CNC Abort, I set the Abort inputs of the interpolator and preprocessing function blocks. My questions are: Does SMC_Interpolator.bAbort only stop/reset the interpolator, or should it also stop the motion currently being executed by SMC_ControlAxisByPos? Can SMC_ControlAxisByPos remain Busy after the interpolator has been aborted? If bAvoidGaps = TRUE, could SMC_ControlAxisByPos still be trying to reach the last fSetPosition using the fGapVelocity / fGapAcceleration / fGapDeceleration settings after the interpolator has stopped? What is the recommended sequence for safely aborting a running CNC program? For example, should the sequence be something like: Stop / Abort Interpolator Disable SMC_ControlAxisByPos Execute MC_Stop for all physical axes Wait until all axes reach standstill Abort/reset preprocessing blocks and CNC queues Reset CNC state Re-enable axis controllers Or is there a recommended CODESYS CNC method for performing a complete CNC Abort? I would especially like to understand why SMC_ControlAxisByPos.bBusy can occasionally remain TRUE and continue moving the axis even though the interpolator and preprocessing blocks have already been aborted. CODESYS SoftMotion CNC is being used with real EtherCAT servo axes. Any explanation about the correct abort/stop sequence would be appreciated.
Last updated: 2026-09-25
Post by mondinmr on Direct Pointers in IOMapping for EtherCAT with IoDrvEthercatLib.ETCSlave_Dia
CODESYS Forge
talk
(Post)
I have found a very interesting solution using: IoConfigTaskMap IoConfigConnectorMap IoConfigChannelMap The first is the list of IO tasks. The second is the connector for each IO module in the IOMap. The third is the individual input or output on the IOMap. One of the properties of the connector is another pointer to a connector, which corresponds with the connector of the EtherCAT slave. Through this information, it is possible to understand to which EtherCAT slave an IO connectormap corresponds. I am attaching an FB that allows for the construction of an IO map and finding the pointer to the actual IOs in the IOMap based on the bitoffset. FUNCTION_BLOCK IOExplorer VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR inputChannels: COL.LinkedList; outputChannels: COL.LinkedList; ulintFactory: COL.UlintElementFactory; END_VAR METHOD inputAtBitOffsetOfConnector : POINTER TO BYTE VAR_INPUT conn: POINTER TO IoConfigConnectorMap; bitOffset: UDINT; END_VAR VAR it: COL.LinkedListIterator; itf: COL.IElement; elem: COL.iUlintElement; channelInfo: POINTER TO ADVChannelInfo; bitOffsetR: UDINT; END_VAR inputChannels.ElementIterator(it); WHILE it.HasNext() DO it.Next(itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} channelInfo := TO___UXINT(elem.UlintValue); {warning restire C0033} IF channelInfo^.connectorField = conn THEN IF bitOffsetR = bitOffset THEN inputAtBitOffsetOfConnector := channelInfo^.addr; RETURN; END_IF bitOffsetR := bitOffsetR + channelInfo^.size; ELSE bitOffsetR := 0; END_IF END_WHILE inputAtBitOffsetOfConnector := 0; END_METHOD METHOD outputAtBitOffsetOfConnector : POINTER TO BYTE VAR_INPUT conn: POINTER TO IoConfigConnectorMap; bitOffset: UDINT; END_VAR VAR it: COL.LinkedListIterator; itf: COL.IElement; elem: COL.iUlintElement; channelInfo: POINTER TO ADVChannelInfo; bitOffsetR: UDINT; END_VAR outputChannels.ElementIterator(it); WHILE it.HasNext() DO it.Next(itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} channelInfo := TO___UXINT(elem.UlintValue); {warning restire C0033} IF channelInfo^.connectorField = conn THEN IF bitOffsetR = bitOffset THEN outputAtBitOffsetOfConnector := channelInfo^.addr; RETURN; END_IF bitOffsetR := bitOffsetR + channelInfo^.size; ELSE bitOffsetR := 0; END_IF END_WHILE outputAtBitOffsetOfConnector := 0; END_METHOD METHOD scanIO VAR_INPUT END_VAR VAR numTasks: DINT := IoConfig_Globals.nIoConfigTaskMapCount; tType: WORD; ioTask: POINTER TO IoConfigTaskMap; numCon: WORD; connector: POINTER TO IoConfigConnectorMap; numCh: DWORD; channelInfo: POINTER TO ADVChannelInfo; iTsk: DINT; iCon: WORD; iCh: DWORD; i: DINT; _tmpConnList: COL.IList; elem: COL.IUlintElement; itf: COL.IElement; tmpCh: POINTER TO ADVChannelInfo; lastE: DINT; e: COL.COLLECTION_ERROR; e1: Error; END_VAR VAR_INST lF: COL.ListFactory; END_VAR IF outputChannels.CountElements() > 0 OR inputChannels.CountElements() > 0 THEN RETURN; END_IF _tmpConnList := lF.CreateDynamicList(16, 16); //Iterate through all IO tasks FOR iTsk := 0 TO numTasks - 1 DO ioTask := ADR(IoConfig_Globals.pIoConfigTaskMap[iTsk]); //Store the type of the task (Input or Output) tType := ioTask^.wType; numCon := ioTask^.wNumOfConnectorMap; //Iterate through all connectors of the task FOR iCon := 0 TO numCon - 1 DO connector := ADR(ioTask^.pConnectorMapList[iCon]); numCh := connector^.dwNumOfChannels; //Iterate through all channels of the connector FOR iCh := 0 TO numCh - 1 DO //Create a new channel info object and fill it with the address, connector and size of the channel //Connectors is address of field connector in this case like EtherCAT slave //Address is the address of the IOMap //Size is the size of channel data in bits in IOMap channelInfo := __NEW(ADVChannelInfo); channelInfo^.addr := connector^.pChannelMapList[iCh].pbyIecAddress; channelInfo^.connectorField := connector^.pConnector; channelInfo^.size := connector^.pChannelMapList[iCh].wSize; //We put the channel info a temporary ordered list //Order is based on the address of IOMap lastE := TO_DINT(_tmpConnList.CountElements()) - 1; FOR i := 0 TO lastE DO _tmpConnList.GetElementAt(udiPosition := TO_UDINT(i), itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} tmpCh := TO___UXINT(elem.UlintValue); {warning restire C0033} //If the address of the channel is smaller than the address of the channel in the list IF tmpCh^.addr > channelInfo^.addr THEN //Insert the channel in the list at the current position _tmpConnList.InsertElementAt(TO_UDINT(i), ulintFactory.Create(TO_ULINT(channelInfo))); //Clear the channel info pointer channelInfo := 0; //Exit the loop i := lastE + 1; END_IF END_FOR //If the channel info is not 0, it means that the channel was not inserted in the list IF channelInfo <> 0 THEN //Add the channel to the end of the list elem := ulintFactory.Create(TO_ULINT(channelInfo)); _tmpConnList.AddElement(elem); END_IF END_FOR //Iterate temporary list and add the channels to the input or output list lastE := TO_DINT(_tmpConnList.CountElements()) - 1; FOR i := 0 TO lastE DO _tmpConnList.GetElementAt(udiPosition := TO_UDINT(i), itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} tmpCh := TO___UXINT(elem.UlintValue); {warning restire C0033} //If type is input, add the channel to the input list IF tType = TaskMapTypes.TMT_INPUTS THEN e := inputChannels.AddElement(ulintFactory.Create(TO_ULINT(tmpCh))); //If type is output, add the channel to the output list ELSIF tType = TaskMapTypes.TMT_OUTPUTS THEN e := outputChannels.AddElement(ulintFactory.Create(TO_ULINT(tmpCh))); ELSE __DELETE(tmpCh); END_IF END_FOR //Clear the temporary list _tmpConnList.RemoveAllElements(); END_FOR END_FOR END_METHOD
Last updated: 2024-02-13
Post by simone on Cannot connect to webvisu on localhost
CODESYS Forge
talk
(Post)
As I wrote before on the title, I have difficulties to connect to see webvisu from localhost. The story: while waiting for the plc+hmi to arrive, I'm preparing the software, mainly the visual parts trough the control Win3 x64 (same version as the ide 3.5.20.10). The problem is that I can't see the webvisu with the installed webbrowser. I don't know if this is a problem, but I changed the port to 9001 (randomly "free") because 80, 8000, 8080, 8088, 3000 are all occupied by other projects (all on the Apache server). Is there something wrong with the config file? This is the url: localhost:9001/webvisu_app.htm and here the config file part "CmpWebServer". [CmpWebServer] ;The handling of startup/shutdown of the webserver: ;0->automatically start, shutdown only on shutdown of the runtime;1->automatically start, could be shutdown on demand ;2(default)->start/shutdown on demand;3->start on demand, shutdown only on shutdown of the runtime StartupType=0 ;The TCP port the webserver listens on WebServerPortNr=9001 LocalAddress=localhost ;LocalAdapterName=LAN-Connection LocalAdapterName=EthernetPCPLC ;LocalAdapterNameUnicode=L\00A\00N\00-\00C\00o\00n\00n\00e\00c\00t\00i\00o\00n\00 LocalAdapterNameUnicode=E\00t\00h\00e\00r\00n\00e\00t\00P\00C\00P\00L\00C\00 Thanks for all the help!
Last updated: 2024-07-11
Post by etienneneu on loading delay with the option "check client animations and overlay of native elements"
CODESYS Forge
talk
(Post)
Hey NicolaG_89, thanks for the tip. But I have seen in the developer tools of the Webclient that a multiple fetching of the image and script data occurs when changing frames (HTTP code 304 NOT Modified), although these are already in the clients cache, which leads to unnecessary loading of resources from the web server. This behavior can also be found if the option “Support client animations and overlay of native elements” is deactivated, but this does not lead to such long delays. I had already tested loading all Visu elements so that everything was fetched once before they could be used. But that didn't help either. To prevent this behavior (permanent fetching), I have used a different way of switching the Visu elements in the VisuDemo Project, which also uses HTML5 control elements. I implemented this with the visibility of entire Visu elements. As a result, it only has to be fetched once and does not have to be fetched again when reloading. But I am still unsure about this implementation if the scope of the visualization becomes larger, as the Codesys visualization documentation advises against using many invisible elements. Best regards Etienne
Last updated: 2024-11-19
Post by george32 on TCP Server
CODESYS Forge
talk
(Post)
Thank you for your advice Rinie, I have tried to follow this example but found one problem.When I disconnect with Hercules the system does not acknowledge the lost of its connection this could result in critical errors. Because of this error I am trying to implement the Syssocket library. With this library I am having a problem which I could not solve. I have the following code: ip_adres : STRING :='0.0.0.0'; port : WORD := 5000; iStep : INT := 1; // Socket information Socket_handler : SysSocket_Interfaces.RTS_IEC_HANDLE; Socket_handler_result : SysSocket_Interfaces.RTS_IEC_RESULT; Socket_adress : SysSocket_Interfaces.SOCKADDRESS; Addres_Convert : SysSocket_Implementation.RTS_IEC_RESULT; // Bind information Bind_handler : SysSocket_Interfaces.RTS_IEC_RESULT; // Listener Information Listener_handler : SysSocket_Interfaces.RTS_IEC_RESULT; Addres_Convert := SysSocket_Implementation.SysSockInetAddr(szIPAddress:= ip_adres,pInAddr:= ADR(Socket_adress.sin_addr)); Socket_adress.sin_family:= SysSocket_Interfaces.SOCKET_AF_INET; Socket_adress.sin_port := SysSocket_Implementation.SysSockHtons(usHost:= port); CASE iStep OF 1: // Create Socket Socket_handler :=SysSockCreate( iAddressFamily :=SysSocket_Interfaces.SOCKET_AF_INET, diType:=SysSocket_Interfaces.SOCKET_STREAM, diProtocol:=SysSocket_Interfaces.SOCKET_IPPROTO_TCP, pResult:=ADR(Socket_handler_result)); IF Socket_handler = SysSocket_Interfaces.RTS_INVALID_HANDLE THEN iStep := 1; ELSE iStep := 2; END_IF 2: Bind_handler := SysSocket_Implementation.SysSockBind( hSocket:=Socket_handler, pSockAddr :=ADR(Socket_adress), diSockAddrSize:=SIZEOF(Socket_adress) ); 3: Listener_handler := SysSocket_Implementation.SysSockListen( hSocket :=Socket_handler, diMaxConnections :=1); END_CASE When I am trying to get this working, the SysSockBind function gives a value of 16#207 which means adress already in use. I find this weird because of the IP-adress of 0.0.0.0. I think I am converting the Ip-adress in the wrong way, but the code does not give a error arround this. So therefore I cannot find the solution to this problem. I hope someone could help me with this problem. Thanks in advance George
Last updated: 2025-02-20
Post by timvh on Licensing info not available.
CODESYS Forge
talk
(Post)
In the VPLC configuration settings there is an entry for the IP address of the license server. In this setting fill in the IP address of your device (host IP address). Then when the virtual PLC starts up, it will get the license from the license container on the host. You can do this for all VPLC's running on your device. The VPLC will always take the smallest license which fits the required license. So if you have 2 licenses for VPLC's with small and large applications, then this will work fine if you start up one VPLC which requires the small license and the other which requires the large license. PS, personally I find it much easier, especially for testing and experimenting, to activate the licenses on a CODESYS (USB) key. This is easy to activate (on your development PC) and easier to move to another device. Addtionally you don't loose the license when you need to install a completely new image on the device.
Last updated: 2025-10-02
Post by nicetuxedo on Can not activate license on Raspberry pi
CODESYS Forge
talk
(Post)
Hello everyone, I'm hoping for some assistance with a license activation issue: a software crash has left my license in a strange state. Here is the sequence of events: I purchased a new license for the Raspberry PI from the official CODESYS web store. I opened the CODESYS and started the online activation process using the ticket number I received. During the activation, the CODESYS software threw an exception and crashed. I was not able to see if the activation completed. After restarting CODESYS, I attempted to run the activation process again with the same ticket number. The License Manager now gives me an error stating that the ticket has already been activated/used. I am now stuck because my installation is not licensed, but the activation server believes my ticket has been consumed. Has anyone encountered this before? Is there a way to have the ticket status reset?
Last updated: 2025-10-08
Post by brell on Automatic xExecute NBS.TCP_write
CODESYS Forge
talk
(Post)
I've recently started experimenting with CODESYS for a project and am fairly new to it. I'm currently working with Function Block Diagrams (FBD) to set up TCP communication between a server and a client, where the client is implemented as a Python script. Once the communication is established, my connection status changes to True, which is the expected behavior. My challenge arises with the TCP write module, which requires the xEnable_write flag to toggle between True and False. If xEnable_write remains True, the module only performs a single write operation. To address this, I introduced a falling edge trigger (F_TRIG), expecting it to help in toggling xEnable_write and it does, However, I've encountered an issue where in the beginning after connxion established I need to manually set xEnable_write to True for the system to work as intended. I'm looking for a way to automate this process so that xEnable_write becomes True automatically upon establishing a connection . Initially, I tried setting xEnable_write to True from the start, but this approach didn't work well since it left the flag permanently True, preventing further toggling. I also experimented with using a TON timer, but I faced similar issues. I am seeking a solution that automatically toggles xEnable_write between True and False after a connection is established, ensuring continuous write operations without manual intervention. Any advice or guidance on how to achieve this would be greatly appreciated."
Last updated: 2024-03-05
Post by wmoon on Licensing info not available.
CODESYS Forge
talk
(Post)
That command can't excute on my device. I installed CODESYS into Hilscher's product using container Here is the Docker file what I used. I'm not sure if this docker file have a problem. If it have a problem, please let me know how to download the files into my device using ftp server. FROM arm64v8/debian:11.6 RUN apt-get update RUN apt-get install -y wget sudo unzip libusb-1.0-0-dev procps ENV CDS_VERSION "4.10.0.0" ENV EDGE_VERSION "4.10.0.0" ENV URL "https://store-archive.codesys.com/ftp_download/3S/LinuxARM64/2302000039/$CDS_VERSION/CODESYS%20Control%20for%20Linux%20ARM64%20SL%20$CDS_VERSION.package" ENV EDGE_URL "https://store-archive.codesys.com/ftp_download/3S/EdgeGatewayLinux/000120/$EDGE_VERSION/CODESYS%20Edge%20Gateway%20for%20Linux%20$EDGE_VERSION.package" RUN wget --output-document=/tmp/codesys.package $URL && \ unzip -p /tmp/codesys.package 'codemeter.deb' > /tmp/codemeter.deb && dpkg -i /tmp/codemeter.deb && \ unzip -p /tmp/codesys.package 'codesyscontrol.deb' > /tmp/codesys.deb && dpkg -i /tmp/codesys.deb RUN wget --output-document=/tmp/edge.package $EDGE_URL && \ unzip -p /tmp/edge.package '*arm64.deb' > /tmp/edge.deb && dpkg -i /tmp/edge.deb EXPOSE 11740 1217 11743 ENTRYPOINT ["/bin/sh", "-c" , "/etc/init.d/codesyscontrol start && /etc/init.d/codesysedge start && tail -f /dev/null"]
Last updated: 2024-03-20
Post by patrik on Wish: CODESYSControl.cfg - again
CODESYS Forge
talk
(Post)
Really good post. I hope that it gets seen by CoDeSys staff. I often find the documentation lacking when it comes to using CoDeSys in more complex ways. If using standard "basic PLC functionality", then it's fine and functions are documented in a sufficient way. Once you go outside of that bubble then I find the documentation not enough. CODESYSControl.cfg is a good example of this. And why isn't more of this integrated in the IDE. like changing port of the webserver. Why is it hidden in this file and not accessible through the IDE. It feels like a layer of complexity purposely left in so you don't change it if you don't know what you are doing. Like the argument is if you have the know-how to find the file you have the know-how to edit it. I find the documentation lacking when it comes to more complex libraries too. Like the element collections library. there is parameters I still don't quite know what they do. I can't find any documentation about them. There is an example project to download from CoDeSys so you can see how you are supposed to set your factories up. I leave some parameters like it is in the example. Should I? I don't know. Does it work. Yes. But I could perhaps create memory leaks if I get something wrong and I don't see that until way later. In the create method of your element factory you have a function called __vfinit and you just have to accept that it works. Why can't I get insight in what it does through documentation? Don't CoDeSys want us to know how these work so we can't use them to accidentally break something? I find the error logging lacking too. I've had the CoDeSys service crash but it doesn't say why. I've seen windows noticing the crash but no error code was sent or error message. Also in my current issue where the application fails to start after power outage. I can see in the log that it fails to load retain in the application as one log entry and application failing to start as another. But why? Why does loading the retain fail? give me more information! Is it just a skill issue with me? I don't know. If it is then I'd still want CoDeSys to step up their game when it comes to documentation. I'm sorry if a lot of frustration comes though in this post. I really like the product and what I can do with it compared to other PLC brands.
Last updated: 2024-11-21
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.