Jump to content

ComDrive and Sockets


Recommended Posts


I want to add compatibility with PLC (Vision 350) in our SCADA.

SCADA will be the Master for a maximum of ten V350.

Ideally I wished use Modbus TCP to interact with PLC but, I think it's impossible to read SD card .udt files directly in modbus TCP.

So I decided to use the ComDriveDll. But Could I know, when the socket used in this dll is actualy opened and closed : Is the Ethernet class corresponds to a socket? (and so The fact declaring a new ethernet channel will create a new socket ?) and the fact getting a PLC objet will connect the socket ?

Because in my code, I don't know If I must declare several Ethernet objects for each of my V350 or only one is sufficient, idem for the PLC object

In normal condition my software will read the current values off each V350 (wich each of them will be a master of a ModbusRTU net) every 5 seconds.

For all other modules of other brands, I use Modbus TCP and connect and disconnect the socket every 5 seconds for each modules (So as to give the module the capacity to respond to another master)


Link to comment
Share on other sites

If PC is Ethernet Master (The PLC is in Listen Mode) then:

1) Each Ethernet class corresponds to a socket. The socket is being created only after you are trying to establish a connection.

2) When you get a PLC Object then the socket should be opened.

3) If socket is being closed for some reason, when trying to communicate with the PLC again, the PLC object will try to reopen the socket and communicate with the PLC.

4) if socket could not be opened or communication failed, you will get ab exception.

5) Since each of the PLCs has a different IP address, you will need to declare an ethernet channel for each of them.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...