LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus TCP server/slave implementation

Does anybody have experience to implement a modbus server or slave application? My computer needs to communicate with a PLC. The configuration is: computer is TCP server or slave, PLC is TCP client or master. Computer to write input registers for PLC to read. Computer read holding registers from PLC. Cannot find any labwindows examples.

 

Thanks a lot.

0 Kudos
Message 1 of 5
(6,057 Views)
Hi,
 
We don't have any examples of Modbus for LabWindows/CVI, as this is just a protocol, but there are a few other resources you can pull from.
 
Modbus: modbus.org/specs.php
Jason H
Automated Test Software R&D
0 Kudos
Message 2 of 5
(6,026 Views)

Did you search the forum? There are several useful contributions, see. eg. here

0 Kudos
Message 3 of 5
(6,020 Views)

Thank you all for the replies. Most the links are for modbus tcp client (master) instead of modbus server (slave).

 

Now I am trying to use a modbus slave activeX control (trial version) from Automated Solutions Inc: http://www.automatedsolutions.com/products/modbusslave.asp.

 

I created an instrument driver using Create ActiveX Controller wizard. I can get a correct object (modbusHandle) with the first line below (status = 0). But the second function (set a property) gives negative status return (status = -2147418113).

 

status = ASMBSLVLib_New_DASMBSLV (NULL, 1, LOCALE_NEUTRAL, 0, &modbusHandle);
status = ASMBSLVLib__DASMBSLVSetDataMode (modbusHandle, NULL, ASMBSLVLibConst_DATA_MODE_MB_TCP);

 

Did I create the activeX control correctly? Automated Solutions told me that the ActiveX control is a windowless control. It's a runtime control. Is it a problem?

 

Thanks in advance.

jzhu0000.

0 Kudos
Message 4 of 5
(6,000 Views)

Never mind, I have solved the problem. Thanks.

0 Kudos
Message 5 of 5
(5,992 Views)