Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01 3.00

Question: I am using the MODBUS protocol to communicate to a non standard modbus device. On start up the modbus device does not come online. I have tried using the InitType INI (as detailed in KB Q1146) command however this does not solve the problem. The developer of the device says that Citect is trying to read input coils which don't exist and his device does not respond. What is the correct response to allow this device to come online. 

On startup Citect will try to read the first 16 input status coils. The modbus message for this is:

ADD 02 00 00 00 16 CRC

Where ADD is the address byte of the modbus PLC and CRC is the 16 bit Cyclic Redundancy Check The 02 is the type of data to be read from the PLC and may be changed with the InitType parameter in the INI file. This could be 01, 02, 03 or 04. The modbus device should respond with the message as follows:

ADD 02 02 dd dd CRC

Where the dd is the data from the registers. In some modbus devices these coils don't exist. In this case the device should respond with an error frame with error code 02 illegal data address as follows:

ADD 82 02 CRC

If Citect sees this response it will assume that the PLC is there and it will be correctly initialized. If any other error is returned or no response is received Citect will assume the PLC is faulty or does not exist and it will not be brought online. The error response should match the request by setting the high bit on the command, so if the command is 02 the error is 82 and if the command is 04 the error is 84 etc.