03-25-2014 06:59 PM
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.
03-26-2014 11:10 AM
03-26-2014 11:28 AM
Did you search the forum? There are several useful contributions, see. eg. here
03-27-2014 03:01 PM
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.
03-27-2014 08:09 PM
Never mind, I have solved the problem. Thanks.