Support Forums
Status of module connection/disconnection based on TCPIP network

How can I know the status of modules which are over TCPIP network? For instance there is a printer which will be connected with SCADA over TCPIP network and I want to know the status whether it is connected or not.

How can I know the status of modules which are over TCPIP network? For instance there is a printer which will be connected with SCADA over TCPIP network and I want to know the status whether it is connected or not.

You could write a custom service to do this without too much trouble but there are some easier ways so long as you are ok to use the error code values of some ports or drivers. Here are a couple of options though I'm not sure if they are the best ones. Both methods shows require the device to respond to a get request but we don't need to worry about the format of that response. Ie: a printer web server for config will work well.

  1. JSON/XML Driver
    1.1 - Create a JSON/XML Driver tag and point it at your device (ie:192.168.1.100 for example). Ensure Hold Data is not selected.
    1.2 - Add an I/O tag as a child of the driver and give it any address. To test this, I called mine noTag with the address noAddress.
    Result - If the server responds with anything body, you should see a value of 1 for the JSON/XML tag and -1 or Invalid if the server is not available.

  2. TCP/IP Port Tag
    2.1 - Create a TCP/IP port tag and point it at your device.
    2.2 - Add a Modbus driver and I/O tag as children ([TCP/IP Port] --> [Modbus Driver] --> [I/O Tag]). Configure the I/O tag with a possible address such as 40001.
    Result - Note the value of the port tag will be 260 if a message is received but is not formatted for Modbus decoding. If the server is unavailable, you will have Invalid or something like -10000

From there you can attach an alarm to the tag and set the condition != to a good connection. It's a pretty rough hack but should get you something simple. An alternate method would be to just install another server and have it run the device connection tests and put those results in an API response for use with the VTScada JSON driver.

You could write a custom service to do this without too much trouble but there are some easier ways so long as you are ok to use the error code values of some ports or drivers. Here are a couple of options though I'm not sure if they are the best ones. Both methods shows require the device to respond to a get request but we don't need to worry about the format of that response. Ie: a printer web server for config will work well. 1. JSON/XML Driver 1.1 - Create a JSON/XML Driver tag and point it at your device (ie:192.168.1.100 for example). Ensure Hold Data is not selected. 1.2 - Add an I/O tag as a child of the driver and give it any address. To test this, I called mine noTag with the address noAddress. Result - If the server responds with anything body, you should see a value of 1 for the JSON/XML tag and -1 or Invalid if the server is not available. 2. TCP/IP Port Tag 2.1 - Create a TCP/IP port tag and point it at your device. 2.2 - Add a Modbus driver and I/O tag as children ([TCP/IP Port] --> [Modbus Driver] --> [I/O Tag]). Configure the I/O tag with a possible address such as 40001. Result - Note the value of the port tag will be 260 if a message is received but is not formatted for Modbus decoding. If the server is unavailable, you will have Invalid or something like -10000 From there you can attach an alarm to the tag and set the condition != to a good connection. It's a pretty rough hack but should get you something simple. An alternate method would be to just install another server and have it run the device connection tests and put those results in an API response for use with the VTScada JSON driver.

Trihedral Engineering Ltd.

Hi Dave,

Thank you very much for the response.

I have tried using Json/XML Driver tag for the printer connection/disconnection and it runs successfully excepting the status value of the connection/disconnection is not changes with the connection/disconnection of cable.

I have also unchecked the hold option but the thing happened is like if printer is connected, the value shows 1 but after remove the cable, value will goes to -1 only after I go to the property of the tag and enter any random address value to Read address box or just click on the IO tab.

So, value will change only after going into the property and clicking on the any option tabs.

Can you please suggest what can be the reason for the above issues!?

Hi Dave, Thank you very much for the response. I have tried using Json/XML Driver tag for the printer connection/disconnection and it runs successfully excepting the status value of the connection/disconnection is not changes with the connection/disconnection of cable. I have also unchecked the hold option but the thing happened is like if printer is connected, the value shows 1 but after remove the cable, value will goes to -1 only after I go to the property of the tag and enter any random address value to Read address box or just click on the IO tab. So, value will change only after going into the property and clicking on the any option tabs. Can you please suggest what can be the reason for the above issues!?
103
4
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft