Modbus rtu network configuration – ws10 as master – NOVUS Web Server – WS10 User Manual
Page 12

Web Server – WS10
NOVUS AUTOMATION
12/33
MODBUS RTU NETWORK CONFIGURATION – WS10 AS MASTER
The WS10 can be configured as a Modbus master, and can read or write on memory locations of other Modbus devices on the same network.
If the MODBUS.CFG file exists on the WS10, this function is enabled and the WS10 starts scanning the network according to the configuration of
devices and registers. Values read from the external devices are stored on the WS10 memory and are identified by a device/tag name.
Follows an example of content of the MODBUS.CFG file:
[Config]
Scanrate=50
Serial=1
Flowctrl=2
De485=1
Baudrate=19200
Parity=0
Wordlen=8
Stopbits=1
Responsedelay=100
Bytetimeout=80
FrameDelay=10
Retries=2
[Devices]
PV=5
OUT=24,1
TVALS=0,3,8
INVALS=32,4,16
On section [Config] the communication parameters and data acquisition interval are defined.
On section [Devices] the external Modbus devices are identified. A new sub-section is defined and named
for each Modbus device. The Address parameter defines the slave address and a list of tags and register
addresses define the registers of interest on the device.
In this example there are two Modbus devices: TT101 (slave address 1) and TT201 (slave address 2).
On the TT101 device, two registers are defined. The register identified as PV is a Modbus holding register
located at address 6 of the device. The register identified as OUT is a Modbus coil status register located at
address 24 of the device, and is read using Modbus command 1 (Read Coil Status).
On the TT201 device, two block registers are defined. Register TVALS are read from the Modbus slave
using command 3 (Read Holding Register), and 8 registers starting at address 0 are read. Registers
INVALS are read using command 4 (Read Input Register), and 16 registers are read starting at address 32.
If the Modbus command is not specified, it defaults to the Read Holding Register (3) for read operation and
Preset Single Register for write operation. If the number of registers is not specified, a single Modbus
register is read.
Valid Modbus commands on a tag definition are: 1, 2, 3 or 4. If a write operation is issued on a tag defined
with commands 1 or 3, the WS10 executes the write operation using command 5 or 6. The WS10 can’t
issue block write commands to the Modbus network.
Section
Sub-Section
Parameter
Values
Description
Scanrate
1 to 30000
Data acquisition interval, in 100ms units. The same interval will be used
for acquisition from local inputs.
Serial
1 or 2
Number of the serial port assigned to the Modbus RTU function.
Factory setting is 1.
Flowctrl
0 or 2
Serial port flow control configuration:
0: Now flow control
2: RTS/CTS flow control (typical whenRS485 or RS232 with external
RS232/485 converter. Factory setting)
De485
0, 1 or 2
RS485 mode configuration.
0: RS232 with external RS232/485 converter.
1: RS485(factory setting)
2: RS232
Baudrate
300, 600, 1200,
2400, 4800, 9600,
19200, 38400
Serial port baud rate. Factory setting is 9600.
Parity
0, 1 or 2
Serial port parity.
0: No parity (factory setting); 1: Even; 2: Odd.
Wordlen
7 or 8
Number of bits per byte. Factory setting is 8.
Stopbits
1 or 2
Number of stop bits. Factory setting is 1.
Responsedelay
1 to 30000
Maximum response wait time, in ms. Factory setting is 100.
Bytetimeout
1 to 30000
Maximum interval between bytes of the received frame, in ms. Factory
setting is 80.
FrameDelay
0 a 30000
Time in ms between the reception of an answer frame and transmission
of a new request frame. Typical value is 10.
Config
Retries
0 to 100
Number of communication retries in case of error. Factory setting is 2.
Address
1 to 247
Address of the slave device named on this section.
Devices
Device name
with up to 10
characters
(1 sub-section for
each device)
Tag name with
up to 6
characters or
digits
Addr,Cmd,Num
Addr: 0 to 9999
Cmd: 1 to 4
Num: 1 to 125
Tag name, first Modbus address (Addr), Modbus read command (Cmd)
and number of registers for each variable of interest on the device of this
sub-section.
Specifying the Modbus command (Cmd) is optional, and defaults to
command 3 (Read Holding Register). Valid commands are 1 to 4.
Specifying the number of registers (Num) is optional, and defaults to a
single register. When the number of registers is specified, the Modbus
command (Cmd) must be specified. Registers with Num greater than 1
are called Block Registers.
Multiples Modbus devices can be defined, one in each sub-section.
Multiple registers can be defined for each Modbus device.