FW-N410-P-M_v0203_01_EN
Page 34
APPENDIX C: COMMUNICATION MODBUS VARIABLES
General
The N410-P is fitted with the Modbus communication protocol and can be equipped with various
physical interfaces like RS485 and RS232 (please see device datasheet for available options). The
tables below show the various variables that can be accessed through the communication.
Currently, the function codes supported are:
•
function code 3 “Read Holding Registers” (4x references);
•
function code 16 “Preset Multiple Registers” (4x references).
The table below shows Modbus PDU addresses in the decimal representation, followed by its
hexadecimal representation (0x0000). When the PLC address range is required (4x references
typically used by PLCs), please add a value of 40001 to the Modbus PDU address. E.g. reading the
serial number with PLC-based addressing means reading 165 + 40001 = register 40166.
Variables spanning multiple registers use ‘big-endian’ data representation. This means that the
lowest register holds the least significant word of the variable. Although most Modbus Masters will
support variables that span 2 registers, variables spanning more registers sometimes require you to
manually calculate the resulting value.
Variables spanning multiple registers have always to be read / written in 1 single action!
Following example shows how data is represented and how this calculation can be accomplished:
For a total-value of 158928, the following register data has been received by the Modbus master:
PDU Address 566 = 0x0000 = 0
PDU Address 567 = 0x0002 = 2
PDU Address 568 = 0x6CD0 = 27856
If we interpret this as a 48 bit unsigned integer value, it's value would be:
0x0000.0002.6CD0 = 158928.
If this value needs to be calculated: 0*65536*65536 + 2*65536 + 27856 = 158928.
For additional information regarding using your Fluidwell Modbus device, please re
ad the ‘Fluidwell
General Modbus Communication Protocol’ and ‘Modbus troubleshooting guide’ that are available
through our website or your distributor.
Runtime variables of the N410-P
PDU ADDRESS REGISTER VARIABLE
REGISTERS R/W TYPE
VALUE / REMARKS
d: 572
h: 0x23C
40573
flow rate
2
R Uint32
0…9999999, Representation: unit, time, decimals
depending on variables d: 109, d: 49, d: 50
d: 566
h: 0x236
40567
total
3
R uint48
0…9999999999, Representation: unit, decimals
depending on variables d: 108, d: 33
d: 560
h: 0x230
40561
accumulated
total
3
R uint48
0…99999999999999, Representation: unit,
decimals depending on variables d: 108, d: 33
d: 208
h: 0x0D0
40026
error status
1
R uint16 Bit field:
0x0001=Display error
0x0002=EEPROM error
0x0004=EEPROM initialization error
Reading flowrate, total or accumulated total:
The returned values are given including the
decimals and represent the actual value. The given value may differ from the value that is displayed
on the display
– this is due to the fact that the display is limited in the number of digits and may have
a slower update rate set.
For example when two decimals are selected for total and total has a value of 123456,78 the display
will show 23456,78 while communication will read a “total” of 12345678 (note that the decimals
should be adapted according the settin
g in “total decimals” which is in this case 2).
For example
read var. 566 for total:
Read var. 33 (total decimals) and calculate real value of total by multiplying total with 10
-(total decimals)
Clearing total:
It is possible to clear the total counter by means of writing a value of 0 to all the
3 registers (total, accumulated total, total decimals) in a single write action. Writing any other value
will result in the reply of an error message. It is not possible to write (clear) the accumulated total.
Type
uint16
= 16 bits unsigned integer
uint24
= 24 bits unsigned integer (stored in unit32 with MSB always 0)
uint32
= 32 bits unsigned integer
uint48
= 48 bits unsigned integer
char
= 8 bits ASCII character
PDU address
d: nnn = decimal numbering
h: 0xnnn = hexa-decimal numbering