2–8
745 TRANSFORMER PROTECTION SYSTEM – COMMUNICATIONS GUIDE
MODBUS PROTOCOL
CHAPTER 2: MODBUS PROTOCOL
For example, request to slave device 11 to perform unsupported function code 39h.
Reading the event
recorder
All event recorder data can be read from Modbus registers found in the address range
0800h to 0FFFh. The “Total number of events since last clear” register at address 0804h is
incremented by one every time a new event occurs. The register is cleared to zero when
the event recorder is cleared. When a new event occurs, the event is assigned an 'event
number' which is equal to the incremented value of this register. The newest event will
have an event number equal to the total number of events. This register can be used to
determine if any new events have occurred by periodically reading the register to see if
the value has changed. If the total number of events has increased, then new events have
occurred.
Only the data for a single event can be read from the Modbus memory map in a single
data packet. The “Event record selector index” register at address 0805h selects the event
number whose data can be read from the memory map. For example, to read the data for
event number 123, the value 123 must first be written to this register. All the data for event
number 123 can now be read from the event recorder data registers at addresses 0830h to
086Ah. Only the last 256 events are actually stored in the relay's memory. Attempting to
retrieve data for older events that are not stored will result in a Modbus exception response
when writing to the “Event record selector index”.
The following example illustrates how information can be retrieved from the event
recorder. A SCADA system polls the total number of events register once every minute. It
now reads a value of 27 from the register when previously the value was 24, which means
that three new events have occurred during the last minute. The SCADA system writes a
value of 25 to the event record selector index register. It then reads the data for event
number 25 from the event recorder data registers and stores the data to permanent
memory for retrieval by an operator. The SCADA system now writes the value 26 to the
selector and then reads the data for event number 26. Finally, the SCADA system writes
the value 27 to the selector and then reads the data for this event. All the data for the new
events has now been retrieved by the SCADA system, so it resumes polling the total
number of events register.
Reading trace
memory
All trace memory data can be read from Modbus registers found in the address range
4000h to 4816h. The “Total number of trace triggers since last clear” register at address
4004h is incremented by one every time a new trace memory waveform capture is
triggered. The register is cleared to zero when the trace memory is cleared. When a new
trigger occurs, the captured trace memory buffer is assigned a trigger number which is
equal to the incremented value of this register. The newest captured buffer will have a
trigger number equal to the total number of trace triggers. This register can be used to
determine if any new triggers have occurred by periodically reading the register to see if
the value has changed. If the total number of trace triggers has increased, then new trace
memory waveform captures have occurred.
Master query message
Example
Description
Slave address
11
query message for slave 11
Function code
39
unsupported function code – error
CRC (low, high)
CD F2
CRC computed by master
Slave response
Example
Description
Slave address
11
response message from slave 11
Function code
B9
return unsupported function code with
high-order bit set
Error code
01
illegal function
CRC (low, high)
93
CRC computed by slave