Communications master - slave

A

Thread Starter

Anonymous

Hi,

I am developing an application for Wago I/O system with Modbus devices. I am using Wago (750-841) ethernet controller. The Wago PLC must work as a master to the slave devices, which are connected to the Wago I/O Modbus through RS485 serial interface module 750-653/003-000.

I have tried to use the library "Modb_l05.lib" (http://www.wago.com/wagoweb/documentation/app_note/libraries/Modb_l05.lib , http://www.wago.com/wagoweb/documentation/app_note/libdoku/ml01101e.pdf) to send and receive data, but I didn't get any data back. I am not interested to write anything to the slaves. I only want to receive data from them. My slave device is a digital multimeter (Lovato). Here is the program in CoDeSys with the parameters I am using:

PROGRAM DataExchange
VAR
Master: MODBUSMASTER_RTU;
SlaveAddress:BYTE;
FunctionCode:BYTE;
StartAddress:WORD;
NumberOfPoints:WORD;
start: BOOL:=TRUE;
state: INT;
send:typRing_buffer;
rec: typRing_buffer;
slavedata:ARRAY[0..100] OF BYTE;
i: INT;
END_VAR

SlaveAddress:=1;
FunctionCode:=16#4;
StartAddress:=1;
NumberOfPoints:=2;
start:=TRUE;

Master(SlaveAddress:=SlaveAddress ,
FunctionCode:=FunctionCode ,
StartAddress:=StartAddress ,
NumberOfPoints:= NumberOfPoints,
bCOM_PORT:=2 ,
cbCOM_BAUDRATE:=1920,
cpCOM_PARITY:=0 ,
csCOM_STOPBITS:=1 ,
cbsCOM_BYTESIZE:=8 ,
cfCOM_FLOW_CONTROL:=4,
TimeOut:=t#100ms ,
StartFunction:=start ,
ReceiveBuffer:=rec ,
SendData:=send);


Is there something mising? Must I use some other libraries? Is there a ready application in CoDeSys, which configures the PLC as a master for the communication with the slave devices through RS485 serial interface module 750-653/003-000?

I hope for some replies and solutions.

Thanks!
 
Top