Post by mariapaola on Port instantiation of serial interface in WAGO PLC using Modb_L05.lib in CoDeSys v2.3
CODESYS Forge
talk
(Post)
Hi, Would really appreciate your insights in this issue I have. I am currently using a WAGO 750-881 with multiple IO devices. For one of them I already occupied the MODBUS Master configuration tool so I cannot overwrite it for my other devices. I have a total of two serial interfaces WAGO 750-652. The first one is instantiated in COM2 and doesn't need any protocol since the information comes in an specific formatting that need little code to differentiate between needed info. This one is working just fine. The second one is where I have an issue. I have tried to instantiate the port using MODBUS library modb_L05.lib to properly receive the data from an ARDUINO and I am absolutely unable to open the port: Signal DEVICE2.fbModbus.MODBUS_EXT_MASTER.Interface.Com_Port_Ist_Offen is never TRUE, among with all other signals from that interface, while signal DEVICE1.COM2.Com_Port_Ist_Offen is TRUE, and the other signals also read as TRUE or FALSE. I have tried instantiating the second one as the first one, changing COM3 to COM4, I've tried a lot of things but it wont ever open the channel. I don't know if you have any recommendations for me. For both physical modules, both witness LEDs A and E are on. First one is instantiated like this: PROGRAM DEVICE1 VAR wBaudRate : WORD := BAUD_9600; bDataBits : BYTE := 8; bParity : BYTE := 0; bFlowControl : BYTE := 3; (RS422 FullDuplex with continous send) i : INT; COM2 : SERIAL_INTERFACE; xOpenPort2 : BOOL := TRUE; ( Flag to open the Port ) xInitPort2 : BOOL; ( Flag to initiallize the Port ) ReceiveBuffer2 : typRing_Buffer; END_VAR COM2( bCOM_PORT_NR := 2, cbBAUDRATE := wBaudRate, cbsBYTESIZE := bDataBits, cpPARITY := bParity, csSTOPBITS := STOPBITS_1, cfFLOW_CONTROL := bFlowControl, utRECEIVE_BUFFER := ReceiveBuffer2, ptSEND_BUFFER := ADR(SendString2), xINIT := xInitPort2, xOPEN_COM_PORT := xOpenPort2, iBYTES_TO_SEND := LEN(SendString2)+1, xSTART_SEND := xSendActive2 ); Second one like this: PROGRAM DEVICE2 VAR COM4 : SERIAL_INTERFACE; xInitPort4 : BOOL := TRUE; xOpenPort4 : BOOL := TRUE; ReceiveBuffer4 : typRing_Buffer; fbModbus : MODBUS_EXTENDED_MASTER_RTU; fbError : enumMB_ERROR; stQuery : typModbusExtendedQuery; stResponse : typModbusResponse; au16Data : ARRAY[0..14] OF WORD; i : INT; tPoll : TON; END_VAR COM4( bCOM_PORT_NR := 4, cbBAUDRATE := BAUD_9600, cbsBYTESIZE := 8, cpPARITY := 0, csSTOPBITS := STOPBITS_1, cfFLOW_CONTROL := 2, ( RS-485 half-duplex ) utRECEIVE_BUFFER := ReceiveBuffer4, xINIT := xInitPort4, xOPEN_COM_PORT := xOpenPort4, xSTART_SEND := xSendActive4, ); stQuery.SlaveAddress := 1; stQuery.FunctionCode := 3; stQuery.Read_StartAddress := 0; stQuery.Read_Quantity := 15; (Poll code) fbModbus( ENABLE := TRUE, bCOM_PORT := 4, ( COM4=> 750-652 port ) cbCOM_BAUDRATE := BAUD_9600, cpCOM_PARITY := 0, csCOM_STOPBITS := 1, cbsCOM_BYTESIZE := 8, cfCOM_FLOW_CONTROL := 2, TimeOut := T#500ms, StartFunction := xStart, ExtQuery := stQuery, Response := stResponse, MB_Error => fbError ); FOR i := 0 TO 14 DO au16Data[i] := stResponse.Data[i]; END_FOR;
Last updated: 2025-11-28
SMC_ERROR.SMC_AXIS_NOT_READY_FOR_MOTION when using Drive Virtual
CODESYS Forge
talk
(Thread)
SMC_ERROR.SMC_AXIS_NOT_READY_FOR_MOTION when using Drive Virtual
Last updated: 2025-11-29
Home
mariapaola
wiki
(WikiPage)
Project Members: mariapaola (admin)
Last updated: 2025-11-28
wiki Discussion
gladyshevmv
wiki
(Discussion)
Forum for wiki comments
Last updated: 2025-12-01
blog Discussion
gladyshevmv
blog
(Discussion)
Forum for blog comments
Last updated: 2025-12-01
(no subject)
gladyshevmv
wiki
(Thread)
Last updated: 2025-12-01
Home
gladyshevmv
wiki
(WikiPage)
Project Members: gladyshevmv (admin)
Last updated: 2025-12-01
Post by salvatorethomas on Port instantiation of serial interface in WAGO PLC using Modb_L05.lib in CoDeSys v2.3
CODESYS Forge
talk
(Post)
Hi — good description of the problem. A few suggestions / questions that might help narrow this down: Since your first serial port (COM2) works fine but the second (COM4 + MODBUS_EXT_MASTER) never opens, check whether the two ports are truly independent — some WAGO modules share internal resources, so COM4 might conflict with other functions or modules. Make sure that the physical wiring and module configuration for the second port (baud rate, flow control, RS-485 vs RS-422, etc.) exactly match what the library expects — a mismatch in flow control or wiring could prevent port opening even if the LED signals seem OK. Try using a plain SERIAL_INTERFACE on COM4 first (like you did for COM2) without Modbus logic — if that opens, you know the hardware + port config is fine, so the issue is more likely with modb_L05.lib. If the port opens but Modbus still fails, enable debug/logging (if available) to inspect whether the port opening fails or the subsequent Modbus negotiation fails. If you like — I can share a minimal example project I used with WAGO + COM4 + Modbus that worked; you could adapt that to test your setup. Wacky Flip
Last updated: 2025-12-01
Port instantiation of serial interface in WAGO PLC using Modb_L05.lib in CoDeSys v2.3
CODESYS Forge
talk
(Thread)
Port instantiation of serial interface in WAGO PLC using Modb_L05.lib in CoDeSys v2.3
Last updated: 2025-12-01
wiki Discussion
salvatorethomas
wiki
(Discussion)
Forum for wiki comments
Last updated: 2025-12-01
blog Discussion
salvatorethomas
blog
(Discussion)
Forum for blog comments
Last updated: 2025-12-01
Home
salvatorethomas
wiki
(WikiPage)
Project Members: salvatorethomas (admin)
Last updated: 2025-12-01
(no subject)
salvatorethomas
wiki
(Thread)
Last updated: 2025-12-01
Post by tommytyler on TCP Server
CODESYS Forge
talk
(Post)
I'm not sure what the issue with the socket implementation is, but based on what I've read in the forums, it appears that the Nett Base Services package is the best option. https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/ speed stars
Last updated: 2025-12-01
Post by junbon on TCP Server
CODESYS Forge
talk
(Post)
I'm not sure what the issue with the socket implementation is, but based on what I've read in the forums, it appears that the Nett Base Services package is the best option. https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/ Snow Rider 3D
Last updated: 2025-12-01
TCP Server
CODESYS Forge
talk
(Thread)
TCP Server
Last updated: 2025-12-01
Home (version 1) discussion
ioan
wiki
(Thread)
Home (version 1) discussion
Last updated: 2025-12-01
wiki Discussion
cilmanshrivel
wiki
(Discussion)
Forum for wiki comments
Last updated: 2025-12-02
blog Discussion
cilmanshrivel
blog
(Discussion)
Forum for blog comments
Last updated: 2025-12-02
(no subject)
cilmanshrivel
wiki
(Thread)
Last updated: 2025-12-02
Post by cilmanshrivel on ERROR: Calling the program "AlarmStorage_Prg" is not allowed from multiple tasks
CODESYS Forge
talk
(Post)
The world of Slice Master moves continuously, creating a sense of motion that guides how players react.
Last updated: 2025-12-02
Home (version 1) discussion
salvatorethomas
wiki
(Thread)
Home (version 1) discussion
Last updated: 2025-12-02
Home (version 1) discussion
jbcregen
wiki
(Thread)
Home (version 1) discussion
Last updated: 2025-12-02
Home
cilmanshrivel
wiki
(WikiPage)
Project Members: cilmanshrivel (admin)
Last updated: 2025-12-02
Post by jbcregen on Accessing parameters from a structure or function block with the web interface
CODESYS Forge
talk
(Post)
Confirmed. The Data Analyzer tool can indeed access all OPC-UA symbols. Thanks !
Last updated: 2025-12-02