
Configuring converters / MasterCAN RS2CAN configuration for data conversion from Modbus RTU registers into SPN
MasterCAN RS2CAN / CAN2RS data converters. Operation manual. Version 1.0
©
Technoton, 2020
36
•
The dropdown list
Function Code
) serves to select the required function
of reading Modbus RTU registers (if the value is not specified, the
Error
is displayed)
(see the admissible values of the function code in table 6).
Table 6
—
Feature codes of reading Modbus RTU registers
Feature code
Command name
Type of value Access type
“Reading coil registers
(01)
”
(0x01)
Read Coil Status
Discrete
Reading
“Reading discrete inputs
(02)
”
(0x02)
Read Input Status
Discrete
Resding
“Reading storage registers
(03)
”
(0x03) Read Holding Registers
16 bit
Resding
“Reading input registers
(04)
”
(0x04)
Read Input Registers
16 bit
Resding
•
The field
Bit Position
) serves to specify the specific bit position number
in the register of 1 byte size for codes of the function “Reading coil registers (01)” or
“Reading discrete inputs (02)”. T
his field is inaccessible for other function codes. The bit
position may be specified from
0…7
range (by default
—
0
).
•
If needed, you can save the data read from the register without any conversion in the
output
(for example, when reading registers from
sensors) by ticking the
Register Initial Value
) field.
By default, it is not ticked; so the data read from the register are converted, in
accordance with the specified values of attributes of factor and offset for the respective
Modbus RTU register and are transferred into the output CAN interface in SAE J1939
format.
•
The fields
Factor
) and
Offset
) are designed to enter
attributes that are necessary for calculation of values of the register read by the
converter.
Below there is the formula (1) to recalculate the read out values of Modbus RTU
register into SPN, with respect to attributes of the registers conversion and to the SPN
format, in accordance with SAE J1939 standard.
SPN=REG_VALUE * (factor
rg
/ factor
SPN
) - ((offset
SPN
–
offset
rg
) / factor
SPN
)
(1)
where
REG_VALUE
- the Modbus RTU register value read by the converter;
factor
rg
and
offset
rg
- values of attributes specified by the user in the fields
Factor
and
Offset
respectively (see the operation documentation (list of
Modbus RTU registers) of the corresponding data source device).
In case the parameter is not converted during saving in the
register, the attributes by default will assume the following values:
factor
rg
= 1 and
offset
rg
= 0;
factor
SPN
and
offset
SPN
- values of SPN attributes automatically selected by the converter
from
(BD S6).
Note
—
You should take note that given different physical values, the additional conversion for
the attributes
factor
rg
and
offset
rg
should be performed in Modbus RTU register and in the
selected output SPN.