NOTE: From RDE v3.54.0, a built-in editor is available to create the modbus.cfg file (Rde configuration--> Settings--> Modbus).
It must be located in the MODBUS_DIR alias folder.
The following table contains the list of commands to be used in the configuration file.
NOTE 1: Commands included in [] are optional parameters.
NOTE 2: Alternative parameters are split with the '|' character.
NOTE 3: At least one block type MUST be declared.
NOTE 4: In bit blocks, in association declarations, the index is normalized to be a multiple of 16.
NOTE 5: An association of bit type 5 to R(1) is interpreted as bit 1 --> R(1).0 2--> R(1).1 ... 5 --> R(1).4.
Command |
Description |
Parameters |
Parameter Description |
Example |
---|---|---|---|---|
; |
Used to insert a comment line |
|
|
|
MODBUS_TCP_PORT [-Pppp] [-Cconn] [-Ibaseindex] [-TKs] [-RKr] [-RTKt] |
Definition of communication data. NOTE: This command must necessarily be entered in the file. |
ppp |
port number to be used [default 502] |
MODBUS_TCP_PORT -P503 -C18 |
conn |
number of possible connections [default 16] |
|||
baseindex |
From RTE 34.24.23 can take the following values: •-1 (default if omitted) SYS_CFG.5 is used to determinate if initial index of units is 0 or 1 •0 initial index of units is 0 (non-standard value) regardless of the status of SYS_CFG.5 •1 initial index of units is 1 (standard value) regardless of the state of SYS_CFG.5 |
|||
s |
Time in seconds of inactivity before sending the first Keep Alive |
|||
r |
Number of Keep Alive retransmissions to consider dropped connection |
|||
t |
Time between two Keep Alive retransmissions to determine connection status |
|||
DATA_MODE mode |
Definition of the manipulation type of received/sent data. The imposed value applies to all definitions present. The default value (MODBUS standard) is MIDDLE_BIG_ENDIAN. This command must be entered in the file before the block definitions |
mode |
BIG_ENDIAN es. HH HL LH LL LITTLE_ENDIAN es. LL LH HL HH MIDDLE_BIG_ENDIAN es. LH LL HH HL MIDDLE_LITTLE_ENDIAN es. HL HH LL LH |
DATA_MODE BIG_ENDIAN |
ZEROS_STRING_STUFFING |
This command allows you to change the handling of the transmission of strings shorter than the expected area by entering 0 as the terminator. Instead, the default value is SPACE_FILLED meaning that any missing characters are filled with the space character |
|
|
|
ERROR_ON_REPORT |
Enables the generation of messages in the REPORT in case of communication and/or comprehension errors. We recommend the use of this command in case of the first connection |
|
|
|
WP_INFO_ON_HR |
Enable association of write protected variables associated with holding registers (see below) |
|
|
|
RUN-TIME_INFO |
Enables the generation of messages in REPORT with the description of exchanged messages. It is recommended to use this command in case of first connection |
|
|
|
DISCRETE_INPUTS n |
Start variable read area definition as individual bits. Associations to robox entities group at least 16 bits (1 word) Then, index 10 and index 14 are relative to the same word. The robox units that can be associated in this block are as follows: •R() •NVR() •AM() •INP_W() •OUT_W() |
n |
number of bits defined |
I reserve 10 words: DISCRETE_INPUTS 160 |
COILS n |
Start variable read/write area definition as individual bits. Associations to Robox entities group at least 16 bits (1 word) Then, index 10 and index 14 are relative to the same word. The Robox units that can be associated in this block are as follows: •R() •NVR() |
n |
number of bits defined |
I reserve 5 words: COILS 80 |
INPUT_REGISTERS n |
Start variable read area definition. Robox units that can be associated in this block are as follows: •R() •NVR() •AM() •ALN() •INP_W() •OUT_W() •SR() •NVSR() •ALS() •RR() •NVRR() |
n |
maximum number of words used |
I reserve 40 words: INPUT_REGISTER 40 |
HOLDING_REGISTERS n |
Start variable read/write area definition. Robox units that can be associated in this block are as follows: •R() •NVR() •SR() •NVSR() •RR() •NVRR() From RTE 34.16.3 via the keyword WP_INFO_ON_HR inserted in the same configuration file, the following variables can also be accessed: •AM() •INP_W() •OUT_W() •ALN •ALS NOTE: In case of writing read-only units, the operation will not be performed and diagnostics will be issued in the report. |
n |
maximum number of words used |
holding_register 80 words: HOLDING_REGISTER 80 |
INDEX(bwIdx) R(rIdx) [-I16|-U16] [-Rrep] [-BE|-LE|-MBE|-MLE] [-SPLIT] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) NVR(rIdx) [-I16|-U16] [-Rrep] [-BE|-LE|-MBE|-MLE] [-SPLIT] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) AM(rIdx) [-I16|-U16] [-Rrep] [-BE|-LE|-MBE|-MLE] [-SPLIT] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) ALN(rIdx) [-I16|-U16] [-Rrep] [-BE|-LE|-MBE|-MLE] [-SPLIT] [-TWD to -WDR idx [-WDM mode]]
|
Associates the index of the current block with one or more R or NVR or AM or ALN. If not modified with the specific commands, it is assumed that: •the unit occupies 2 words (32 bits) •the high word cannot be accessed directly •the DATA MODE is the generic one |
bwidx |
Modbus element index (bit or word in current block function). Value between 1 and specified max size. See NOTE 4 |
; I connect R(270) R(271) and R(272) from modbus element 250: INDEX(250) R(270) -R3
; I connect the low word of NVR(370) from modbus element 256. The low word will be taken as the signed value. Big Endian: INDEX(256) NVR(370) -I16 -BE
; I connect AM(1) from modbus element 32, with direct access to the top of AM(1): INDEX(32) AM(1) -SPLIT
; coils 1 to 16 will be used for watch dog management, the check will be done every 2 seconds, the result will be put into the R(201) register, the watch dog is enabled on write operations only: COILS 255 INDEX(1) R(1) -R2 -TWD 2000 -WDR 201 -WDM 2 |
rIdx |
Robox element index |
|||
I16|U16 |
Selection of using only the low word of the Robox entity as a 16-bit signed or unsigned data (1 word) |
|||
rep |
repetition number of Robox entities |
|||
-BE|-LE|-MBE|-MLE |
modification of DATA MODE |
|||
-SPLIT |
allows access to only the high word of the Robox entity |
|||
-TWD |
to = maximum time allowed (in milliseconds) between two consecutive accesses to the specified variable |
|||
-WDR |
idx = index of the R register where to save the result of the operations: •1 communication never started •0 the communication is ok •-1 communication timeout |
|||
-WDM |
mode = (optional, default 3)watch dog mode: •1 watch dog enabled on read operations •2 watch dog enabled on write operations •3 watch dog enabled on access operations |
|||
INDEX(bwIdx) INP_W(rIdx) [-Rrep] [-BE|-LE] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) OUT_W(rIdx) [-Rrep] [-BE|-LE] [-TWD to -WDR idx [-WDM mode]] |
Associates the index of the current block with one or more INP_W or OUT_W. If not modified with the specific commands, it is assumed that: •the DATA MODE is the generic one |
bwidx |
Modbus element index (bit or word in current block function). Value between 1 and specified max size. See NOTE 4 |
; I connect INP_W(1) and INP_W(2) from modbus element 64: INDEX(64) INP_W (1) -R2 |
rIdx |
Robox element index |
|||
rep |
repetition number of Robox entities |
|||
-BE|-LE|-MBE|-MLE |
modification of DATA MODE |
|||
-TWD |
to = maximum time allowed (in milliseconds) between two consecutive accesses to the specified variable |
|||
-WDR |
idx = index of the R register where to save the result of operations: •1 the communication never started •0 the communication is ok •-1 communication timeout |
|||
-WDM |
mode = (optional, default 3)watch dog mode: •1 watch dog enabled on read operations •2 watch dog enabled on write operations •3 watch dog enabled on access operations |
|||
INDEX(bwIdx) SR(rIdx) -CnChar [-Rrep] [-BE|-LE|-MBE|-MLE] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) NVSR(rIdx) -CnChar [-Rrep] [-BE|-LE|-MBE|-MLE] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) ALS(rIdx) -CnChar [-Rrep] [-BE|-LE|-MBE|-MLE] [-TWD to -WDR idx [-WDM mode]] |
Associates the index of the current block with one or more SRs or NVSRs or ALSs. If not modified with the specific commands, it is assumed that: •the DATA MODE is the generic one |
bwidx |
Modbus element index (bit or word in current block function). Value between 1 and specified max size. See NOTE 4 |
|
rIdx |
Robox element index |
|||
nChar |
number of characters associated with each string (2 characters = 1 word) |
|||
rep |
number of repetition of Robox entities |
|||
-BE|-LE|-MBE|-MLE |
modification of DATA MODE |
|||
-TWD |
to = maximum time allowed (in milliseconds) between two consecutive accesses to the specified variable |
|||
-WDR |
idx = index of the R register where to save the result of the operations: •1 the communication never started •0 the communication is ok •-1 communication timeout |
|||
-WDM |
mode = (optional, default 3)watch dog mode: •1 watch dog enabled on read operations •2 watch dog enabled on write operations •3 watch dog enabled on access operations |
|||
INDEX(bwIdx) RR(rIdx) [-FLOAT] [-Rrep] [-BE|-LE|-MBE|-MLE] [-TWD to -WDR idx [-WDM mode]]
INDEX(bwIdx) NVRR(rIdx) [-FLOAT] [-Rrep] [-BE|-LE|-MBE|-MLE] [-TWD to -WDR idx [-WDM mode]] |
Associates the index of the current block with one or more RRs or NVRRs. If not modified with the specific commands, it is assumed that: •the unit is of type DOUBLE i.e., it occupies 4 words (64 bits). •the DATA MODE is the generic one |
bwidx |
Modbus element index (bit or word in current block function). Value between 1 and specified max size. See NOTE 4 |
; I connect ALS(1) to word(100) and ALS(2) to word(132): INDEX(100) ALS 1 -C64 -R2 |
rIdx |
Robox element index |
|||
float |
Selection of use of FLOAT 2 word (32 bits) format |
|||
rep |
repetition number of Robox entities |
|||
-BE|-LE|-MBE|-MLE |
modification of DATA MODE |
|||
-TWD |
to = maximum time allowed (in milliseconds) between two consecutive accesses to the specified variable |
|||
-WDR |
idx = index of the R register where to save the result of the operations: •1 the communication never started •0 the communication is ok •-1 communication timeout |
|||
-WDM |
mode = (optional, default 3)watch dog mode: •1 watch dog enabled on read operations •2 watch dog enabled on write operations •3 watch dog enabled on access operations |