beautypg.com

1 function field and modbus i/o addressing, 5 modbus counters, Function field and modbus i/o addressing – B&B Electronics ZZ24D-NA(NB,NC,ND)-SR - Manual User Manual

Page 33: Modbus counters, N 3.3.5“modbus counters

background image

Hardware Information

Manual Documentation Number: pn7515_ZlinxIO-0712m

27

3.3.4.1 Function Field and Modbus I/O Addressing

Modbus Function Code

The function code in the Master device query tells the addressed slave device what kind of action to perform. The data bytes
contain any additional information that the slave will need to perform the function. For example, function code 03 will query the
slave to read holding registers and respond with their contents. The data field must contain the information telling the slave
which register to start at and how many registers to read.

Modbus I/O addressing

The Modbus protocol allows for two types of I/O addressing: implied and extended. Implied addressing uses the function code
to determine the I/O address and only requires the minimum address; i.e. 40012 = 0x0C, the 4nnnn is implied.

The extended address contains the entire I/O address; i.e. 40012 = 0x9C4C.

Another example:

Using holding register 40108 to address a DAC or analog output. The function code field already specifies a “holding register”
operation. Therefore the “4nnnn” reference is implicit. Holding register 40108 is addressed as register 0x006B (107 decimal).

The B&B Zlinx series of remote I/O devices uses the implied I/O addressing method. If your device is sending the full extended
I/O address, an error will occur.

3.3.5 Modbus Counters

Base Modules

In Modbus mode a Base Module supports two Digital Inputs as counters:

 Frequency.

 Accumulators.

There are four accumulator registers on only the Base Module which hold accumulators information – two for each Digital
Input.

Accumulator most significant count register 400nn displays the respective count from 0 to 9999.

Accumulator least significant count register 400nn displays the respective count from 0 to 9999. This will increment the most
significant count when it rolls over from 9999 to 0.

Time to save totals register counts down the number of seconds (from 300-0 seconds) until the Accumulators are saved
internally.

Expansion Modules

In Modbus mode Expansion Module supports two Digital Inputs as frequency.

There are two frequency registers on each module which hold frequency information – one for each Digital Input. Register
addresses for frequency will be found at 40nnn, (where “n” is a single digit between 0 and 9).

NOTE: For more information see “Appendix D: Modbus I/O Assignments”.

Accumulators

A typical electric water meter will generate a pulse per 1/10 gallon of water flowing through it. This type of application is best
used with the Modbus accumulators. The accumulators are broken down into two registers, most significant count and least
significant count. Both accumulators have a full count of 9999. When the least significant count exceeds 9999, it will
increment the most significant count giving a total system count of 99,999,999.