Applies To:
  • CitectSCADA 3.00

Question 1: Will the TCP/IP network driver use the conventional citect method of all graphic display nodes request data from the I/O server ( which is running on a seperate node) and the I/O server will communicate with the PLC's, or will the graphic display nodes talk directly to the PLC's?

Question 2: We are currently planning on writing a citect driver to work with Unix host processors running in a VME rack, Vax's, and ModComps. The driver will use TCP/IP over ethernet, in the driver kit documentation I received is a definition of a data structure that citect passes to the driver and one of the elements is "LogicalUnit", will this be the place where citect places the ethernet or IP adderss? Is there any other changes in the driver kit documentation when writing TCP/IP drivers?

Yes the TCP/IP driver will channel all client requests via the I/O Server. This allows the I/O Server to optimize all the client requests into the least number of messages to the PLCs. This will give the best possible performance. You can make each client talk directly to the PLCs by making each client an I/O Server, however this will greatly slow down the performance of the system.

No the address of the I/O device in not placed in the LogicalUnit field. This is a logical address or handle to a unit. This works in the same way as a file handle when accessing files, for example:

handle = open("address of plc"); // get handle from physical address
read(handle, buffer); // read from handle
write(handle, data); // write to handle
close(handle); // close the device

This way you create the connection to the I/O Device on startup with the full address. You also save this address in a local data structure. Then when a read or write request is passed from Citect you will get the LogicalUnit which you can lookup the physical address of the I/O Device. This makes the design more flexible and much faster.

Have a look at the InitUnit() function (in the MODBUS driver). This function is called to open the connection to a I/O Device. This function is passed the Address field (from the I/O Device form) which it will save away and then you can see this code setting the LogicalUnit which is returned to the I/O Server. This is how the I/O Servers gets the handle. Now the I/O server will pass this handle back in all read and write requests. This handle is an offset into the UNIT_DB structure defined in the header. The physical address of the PLC is stored in this structure along with any other local information you need for each PLC.

So you may put the IP address in the I/O Devices form, Address field. This will give you an unique address for each I/O Device. With some TCP/IP drivers you may want a single IP address to a gateway and then you can communicate to many PLCs via the one IP address. If this is the case you then should put the IP address in the Ports form, Special options field. This data is used in the InitCard() function (TIWAY driver). You can then open a channel to the IP address and then use the Address field of the I/O Device as part of the message to address the required PLC.