Communication Channel's Health Status on TCP/IP

M

Thread Starter

Muzammil Nasim

i have three devices with an IP address 192.168.0.125, port 502 and device IDs 1, 2 and 3 on modbus protocol over ethernet using tcp/ip. I need to write a software routine in VC++ that after a fixed interval polls to check the health status of the connection with three devices over a tcp socket. which function code should i use? all the devices have the same ip and port number but different device ids... I can't use the diagnostic functions as they are only supported on serial line... Please reply in terms of protocol's function codes. I have tried function code 04 (read input register) to read register at 40001 with modsimm32 for a non-existent device id but i get an exception of data address invalid which i cannot use to determine the health status of the channel (because device may be alive as the returned exception does not say that the device is dead). Any directions??

regards
Muzammil
 
Top