Procentec VPGate User Manual

Page 1
VPGate Manual
MODBUS/TCP to Serial
Page 2
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 2/135
Content
1. Characteristics ............................................................................................... 6
2. Hardware installation .................................................................................... 9
3. Working principle ........................................................................................ 14
4. Software configuration ................................................................................ 27
5. Implementation of the Default Configuration ............................................. 33
Page 3
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 3/135
6. Implementation of the advanced configuration ......................................... 42
7. DIGITAL INPUT/OUTPUT .............................................................................. 67
8. DIAGNOSTICS ............................................................................................... 68
9. Web server .................................................................................................. 74
Page 4
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 4/135
10. FTP server .................................................................................................... 87
11. SNMP agent ................................................................................................. 88
12. APPENDICES ................................................................................................. 90
13. Other PROCENTEC products ...................................................................... 124
14. Sales offices and distributors ..................................................................... 126
15. About PROCENTEC ..................................................................................... 131
16. Notes ......................................................................................................... 132
Page 5
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 5/135
Document reference
Reference
Document
Version
Date
(1)
MODBUS application protocol specification
V1.1b3
26-04-2012
(2)
MODBUS over serial line specification and implementation guide
V1.02
20-12-2006
(3)
MODBUS messaging on TCP/IP implementation guide
V1.0b
31-10-2006
Page 6
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 6/135
1. Characteristics
1.1 General characteristics
Ethernet connection
Bandwidth
10/100 Mbps, auto negotiation, auto polarity, auto MDI/MDIX
Lights
Connection active (green) and activity (orange)
Distances
Maximum 100m
Cable
Shielded industrial Ethernet cable (5th category at least)
Connectors
2 RJ-45 connectors with transformer insulation and shield connection
Supported protocols
MODBUS/TCP, SNMP V1, HTTP, FTP, DCP
Switch
Integrated 2 ports switch
MODBUS / TCP
Operating modes
Client, server or gateway
Gateway mode
Direct access by ‘tunnelling’ in the series equipment data
Max number of simultaneous TCP connections
5
Port
502
Page 7
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 7/135
Transparant mode
End of frame delimiter
End of frame character / known length / on timeout
MODBUS mode
Bus access
Master or slave
Protocol
MODBUS RTU or ASCII
Accepted functions
1, 2, 3, 4, 5, 6, 15, 16, 23
Number of addressable slaves in master mode
100 MODBUS slaves
Range of addresses
1 - 247
Number of MODBUS registers accessible for a request
1 - 125 registers in read mode 1 - 2000 bits in read mode 1 - 123 registers in write mode 1 - 1968 bits in write mode
Periodicity of sending frames
Cyclical or following change for writing outputs
Local I/O
TOR input
1 isolated digital input
TOR output
1 isolated digital output
File system
Space available
8 MB
Access
FTP, HTTP
Page 8
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 8/135
1.2 Electrical characteristics
1.3 Mechanical/Environmental characteristics
Power supply
Supply voltage
12 - 30V DC
Consumption
1.7 W
Connector
Female 3 contact disconnectable terminal (VCC, 0V, GND)
Reverse polarity protection
Yes
Short-circuit protection
Yes
Mechanical/environmental characteristics
Type of body
Plastic with hatch on the front side IP20 - DIN fixation rail
Dimensions
120 x 100 x 23 mm (L x W x H)
Weight
130 g
Storage temperature
-25°C .. +70 °C
Operating temperature
0°C .. +55 °C
Relative ambient humidity
Max. 80%
Page 9
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 9/135
2. Hardware installation
2.1 Connector
Figure 1: Connectors on top of the body
2.1.1 Power connector
Pin
Name
Description
1
24 VDC
Power supply 12 - 30 V
2
0 VDC
0 V 3 GND
Ground connection
2.1.2 SERIAL Connector
Pin
Name
Description
1
Rx
Rx RS-232 (VPGate < equipment)
2
Tx
Tx RS-232 (VPgate > equipment)
3
GND
RS-232 ground connection
4
Shield
Ground
5
Data -
Signal Data - RS-485
6
Data +
Signal Data + RS-485
Important: The shielding of the SERIAL cable must imperatively have ground connections at both ends in order to ensure correct resistance to electromagnetic disturbances. The pin 4 of the connector may be used. The ideal situation is to use a shield jumper screw, which is fixed at each end of the serial wire on a ground bus or a cabinet bottom plate.
Page 10
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 10/135
2.1.3 Digital input
Figure 2: Connectors on the bottom of the body
IEC61131-2 compliant, type 1:
2.1.4 Digital output
IEC61131-2 compliant:
Interrupting capacity 0.5 A Maximum accepted current: 1.2 A
2.2 Front panel indicators
Pin
Name
Description
1
IN +
Insulated digital input (15-24 V)
2
IN -
Insulated digital input, ground return
Pin
Name
Description
1
OUT
Relay contact
2
OUT
Relay contact
1
ON  2
Net1
3
Net2
4
RUN
5
Tx (serial link)
6
Rx (serial link)
OUT
2
1
IN 2
1
+
-
Page 11
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 11/135
1 ON: is lit on when the gateway has been powered on. 2 Net1 : is lit and steady if the MODBUS/TCP server has not started owing to an error in configuration. Net
1 blinks if the MODBUS/TCP client detects a timeout on a server.
3 Net2 : is lit and steady if selected protocol for the serial link has not started owing to an error in
configuration. Net 2 blinks in case of a communication error in the serial link (Timeout of a MODBUS slave, for example).
4 RUN: blinking at 1Hz, indicates that the program is functioning correctly. Blinking at 4Hz indicates that the
"DCP blink" command has been initiated (allows physically locating the equipment).
5 Tx: indicates that a frame is being sent on the serial link. 6 Rx: indicates that a frame is being received on the serial link.
2.2.1 Indicator light of the 2 ports switch
2.3 DIP switches
DIP switches enable:
activating a default IP configuration (192.168.10.20)
selecting the physical support of the serial link: RS-232 or RS-485
activating a termination resistance and line polarisation
Figure 3: DIP switches
2.3.1 Default configuration of the IP address
A switch allows resetting a default configuration (@IP 192.168.10.20, mask 255.255.255.0) during the start-up of VPGate Ethernet. The configuration is carried out in the following manner:
Set the DIP switch 1 to ON and power VPGate one and off to ensure that it takes the default IP parameters into account.
Switch
Name
Description
1 ON
Default IP configuration
OFF
User-defined IP configuration
Link status indicator:
Not switched on: no link
Switched on: Ethernet link OK
Link activity indicator:
Switched off: no exchanges
Switched on: exchanges in progress
Page 12
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 12/135
Important: A user may modify the IP address of VPGate via the Web server or via the DCP protocol, when the switch is set to ON. In this case, the new IP address is used immediately, despite the switch being activated. Consider setting the switch to OFF, otherwise the default IP address shall be once again used when the device is restarted.
2.3.2 Choosing the RS-232/RS-485 mode
There is a switch which allows specifying the operating mode of the serial link from between RS-232 or RS-485 (VPGate is pre-set to RS-485 out of the box):
RS-232 mode:
Figure 4 : Serial network in RS-232 mode
This mode can be used in case of communication between 2 pieces of equipment only (point to point connection). The maximum distance in RS-232 is 15 m at 19200 baud.
RS-485 mode:
Figure 5: Serial network in RS-485 mode
This mode is used more often because it allows connecting several slaves on the bus. It also has other advantages like immunity to EMC disturbances and its maximum inter-equipment distance is higher than in RS­232 mode. The maximum distance in RS-485 is 1200 m.
2.3.3 Terminating resistance
Switch
Name
Description
2 ON
RS-232
OFF
RS-485
150 Ω
150 Ω
Page 13
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 13/135
If the communication mode used is RS-485, there must be a terminating resistance of 150Ω at both ends of the network (refer to the example above). The connection of a terminating resistance is established using DIP switches 3 and 4 (VPGate is pre-adjusted without terminating resistance):
To ensure the proper functioning of the termination, switches 3 and 4 must mandatorily be in the same position
Internal resistance and polarisation diagram of the bus RS-485:
Figure 6 : Terminating resistance and polarisation of the bus RS-485
Switch
Position
Description
3 – 4 (activation of the terminating resistance + polarisation of the line)
ON
Termination & polarisation
OFF
No termination and no polarisation
Page 14
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 14/135
3. Working principle
3.1 Appliance of the product
VPGate MODBUS/TCP to serial is a communication gateway which allows interfacing a MODBUS/TCP network with:
1 MODBUS serial link slaves (1) 2 MODBUS serial link master (2) 3 equipment using a proprietary serial link protocol (3)
Figure 7: Presentation of the VPGate MODBUS/TCP to serial operating modes
3.2 Default configuration
VPGate MODBUS/TCP to serial is delivered with a default configuration that allows interfacing MODBUS/TCP clients with MODBUS serial link slaves:
Page 15
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 15/135
Figure 8: Operating mode of the default configuration
VPGate is configured in the following mode:
Ethernet of MODBUS/TCP server
MODBUS serial link master
The “Direct messaging” mode is activated by default and ensures the transformation of the MODBUS/TCP
messages into MODBUS serial frames. Refer to section 3.6.1 MODBUS master with the “Direct messaging” function for more information about this mode.
In this mode, VPGate MODBUS/TCP to serial is operational after:
The IP address parameters are configured
The serial link to be used (RS-232 or RS-485) and its associated parameters are chosen
Refer to section 5 Implementation of the Default Configuration on page 33 to use VPGate MODBUS/TCP in its default configuration.
For more information about the MODBUS/TCP protocol, refer to the document MODBUS messaging on TCP/IP implementation guide.
3.3 Configuration in “Advanced Gateway” mode
The advanced configuration mode allows using the internal memory of VPGate to exchange information between the MODBUS/TCP and serial link protocols. VPGate MODBUS/TCP has a shared memory zone called “exchange table” used to store data exchanged between MODBUS/TCP and the serial link protocols.
When VPGate functions as a MODBUS/TCP server, the exchange table can be accessed by MODBUS/TCP clients who send read/write requests to VPGate.
When VPGate functions as a MODBUS/TCP, it arranges the data read in the servers in its exchange table, and from there reads the data to be written on the servers.
The exchange table consists of 16 bit registers in the BIG-ENDIAN format.
Each register is identified by an address (offset) which is coded using 16 bits. The accessible memory range starts at the address “0x0000” and extends to the address “0xFFFF”. It is defined as indicated below:
Page 16
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 16/135
Address
Exchange Table (shared memory)
Dec.
Hex.
0
2047
0x0000
0x07FF
Inputs
Data received from the serial link:
In MODBUS master mode: data read in the slaves
In MODBUS Slave mode: data written by a master
In Transparent mode: frame received on the serial link
2048
4095
0x0800
0x0FFF
Outputs
Data sent to the serial link:
In MODBUS master mode: data written in the slaves
In MODBUS Slave mode: data read by a master
In Transparent mode: frame sent on the serial link
4096
32767
0x1000
0x7FFF
Free zone
Accessible only for the following MODBUS functions:
3 - Read Holding Registers
4 - Read Input Registers
6 - Write Single Register
16 - Write Multiple Registers
23 - Read/Write Multiple Registers
32768
65535
0x8000
0xFFFF
Configuration zone
Identification of the product
Parameters of the serial link:
Listings of the active protocols
Configuration of each protocol
Figure 3: Exchange Table (shared memory) of VPGate MODBUS/TCP to serial
The access rules for the exchange table are as follows:
If the “Direct messaging” mode has not been activated, the exchange table can be accessed by a MODBUS/TCP client irrespective of the slave address specified in the MODBUS/TCP message.
If the “Direct messaging” mode has been activated, the exchange table can be accessed if the slave provided in the MODBUS/TCP is between 247 and 254.
Important: The configuration field contains the current VPGate parameters. Accessing this field in write mode can have a direct impact on the proper functioning of the product.
Page 17
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 17/135
3.4 MODBUS/TCP server
VPGate can be configured to function as a MODBUS/TCP server. It provides the exchange table to the MODBUS/TCP clients present on the network:
Figure 9: VPGate in MODBUS/TCP server mode
In this mode, it is necessary to configure the IP address of the MODBUS/TCP server used by VPGate, and the list of MODBUS functions that it supports.
The list of functions supported by VPGate in MODBUS/TCP server mode is as follows:
Code
Function
Maximum length
1
Read coils
2000 bits
2
Read discrete inputs
2000 bits
3
Read holding registers
125 registers
4
Read input registers
125 registers
5
Write single coil
1 bit
6
Write single register
1 register
7
Read exception status
1 byte
15
Write multiple coils
1968 bits
16
Write multiple registers
123 registers
23
Read/Write Multiple registers
125 registers in read mode, 118 in write mode
Page 18
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 18/135
All requests that include a function code which is not supported shall receive in response the exception "0x01 Illegal Function".
3.5 MODBUS/TCP client
VPGate can be configured to function as a MODBUS/TCP client.
Figure 10: VPGate in MODBUS/TCP client mode
The user can define MODBUS “scenarios" in order to define the behaviour of the MODBUS/TCP client. Each MODBUS scenario is defined by:
The IP address of the MODBUS/TCP server to be accessed
MODBUS function used
Address of the bit/register to be accessed in the slave
Quantity of bits/registers to be accessed in the slave
Address in VPGate, where the read/written data are stored in the slave
Release mode of the scenario:
Cyclical sending: definition of a sending period
Sending after change: the request is sent only if a change is detected in the exchange table (only for
MODBUS write requests)
The cyclical scenarios are executed one after the other. If a scenario has been configured to be executed after a change and if the data associated with it do indeed change, it is executed immediately after the completion of the ongoing cyclical scenario.
If several scenarios have been configured to be executed after a change and if the associated data does indeed change, these scenarios are included in the transmission pending queue.
If no cyclical scenario needs to be sent, the change scenarios are executed one after the other.
Page 19
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 19/135
If several cyclical scenarios are already pending transmission, VPGate inserts a change scenario between each ready cyclical scenario, and thus optimises the exchanges by minimising the delay induced during cyclical scenarios.
3.6 MODBUS serial link master (1)
VPGate can be configured to function as a MODBUS serial link master.
There are two operating modes which allow sending requests to MODBUS slaves:
The “Direct Messaging” mode (MODBUS/TCP server activated mode)
Using the scenarios (configuration of the cyclical/acyclical requests)
3.6.1 MODBUS master with the “Direct messaging” function
To access a MODBUS serial slave through VPGate, a MODBUS/TCP client must specify the address of the MODBUS serial slave which it wishes to connect to:
Figure 11: VPGate serial link master with “Direct messaging”
It enters this information in the field “Unit ID” of the “MBAP” header of the MODBUS/TCP message (refer to
Figure : Figure 12: Conversion of a MODBUS/TCP message into a MODBUS serial frame).
By sending the MODBUS/TCP message to the IP address of the VPGate MODBUS/TCP server, VPGate shall then convert the TCP message into a serial link frame as indicated below:
Figure 12: Conversion of a MODBUS/TCP message into a MODBUS serial frame
Slave
address
Function
code
Data
CRC
Unit ID
Function
code
Data
Length
Request
Protocol ID
ID
Transaction
MODBUS serial frame
MODBUS request (PDU)
MBAP: MODBUS/TCP header
MODBUS/TCP message (ADU)
Page 20
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 20/135
For more information about the MODBUS: MODBUS application protocol specification [1].
The field “Unit ID” is used as a slave address in order to create the MODBUS serial frame.
VPGate can thus create and send a serial frame from the TCP message, and return the response from the slave to the requesting client, via its IP address.
VPGate is distributed through a default configuration when this operating mode is used, refer to section 3.2 Default configuration .
There may be a latency in the time taken by the MODBUS serial slave to process the request. A MODBUS/TCP client must thus always wait for the MODBUS serial link request to be executed in order to receive a response from the VPGate MODBUS/TCP server.
It is possible that a MODBUS/TCP request may be considered as unanswered (timeout) by a client, even though it is only because of the lead-through time that the time required for transmitting the message is extended.
In this case, the value of the “timeout” parameter of the requests on the client must be increased.
This mode is functional, but not at the same level of performance as the “Advanced Gateway” mode which is
presented in section 3.3 Configuration in “Advanced Gateway” mode
3.6.2 Fault management in direct messaging
If a corrupted frame is received by the MODBUS slave, the request is ignored and no response is sent to the MODBUS master. If a corrupted response is received by the master, the frame is ignored. This is considered as a timeout. If the frame received from the slave is correct, but if the response is an exception, a MODBUS exception is sent to the MODBUS/TCP client.
MODBUS exception code
Description
0x01
"Illegal function": the MODBUS function code is not supported.
0x02
"Illegal data address": the requested data address is not valid.
0x03
"Illegal data value": the data contained in the request are erroneous (for example: number of registers to be read higher than the maximum value defined by the function code).
0x04
“Slave device failure”: A fatal error has occurred, which has prevented the slave from processing the request.
0x06
“Slave Device Busy”: the slave is already processing a request, the master
must re-transmit this request later.
Page 21
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 21/135
Table 1: Exceptions returned by the MODBUS/TCP server
3.6.3 MODBUS master scenarios
The user can define MODBUS “scenarios" in order to define the behaviour of the MODBUS master. Each MODBUS scenario is defined by:
Address of the slave to be accessed
MODBUS function used
Address of the bit/register to be accessed in the slave
Quantity of bits/registers to be accessed in the slave
Address in VPGate, where the read/written data are stored in the slave
Release mode of the scenario:
Cyclical sending: definition of a sending period
Sending after change: the request is sent only if a change is detected in the exchange table (only for
MODBUS write requests)
The cyclical scenarios are executed one after the other. If a scenario has been configured to be executed after a change and if the data associated with it do indeed change, it is executed immediately after the completion of the ongoing cyclical scenario.
If several scenarios have been configured to be executed after a change and if the associated data does indeed change, these scenarios are included in the transmission pending queue.
If no cyclical scenario needs to be sent (unfinished cycle), then the change scenarios are executed one after the other.
If several cyclical scenarios are already pending transmission, VPGate inserts a change scenario between each ready cyclical scenario, and thus optimises the exchanges by minimising the delay induced during cyclical scenarios.
0x0A
“Gateway path unavailable”: this message indicates that the gateway is not able to connect to the required recipient (configuration problem or gateway overload).
0x0B
“Gateway target device failed to respond”: this message indicates that the
recipient has not responded to the request.
Generally, this message indicates that the equipment to which the request is sent is not present on the networks joined by the gateway.
Page 22
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 22/135
Figure 13: Exchange of data via the MODBUS scenarios in MODBUS master modeResponseRequest
3.7 MODBUS serial link slave (2)
VPGate can be configured as a MODBUS serial link slave Master MODBUS directly accesses, in read or write mode, the VPGate exchange table. The exchange table is considered as a table of registers:
Figure 14: Data exchange in MODBUS slave mode
In this mode, it is necessary to configure the address of the MODBUS slave used by VPGate, and the list of MODBUS functions that it supports.
The list of functions supported by VPGate in MODBUS slave mode is as follows:
Code
Function
Maximum length
1
Read coils
2000 bits
Request
Response
Response
Page 23
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 23/135
All requests that include a function code which is not supported shall receive in response the exception "0x01 Illegal Function".
3.8 Transparent Mode (3)
Transparent mode allows exchanging raw data on the serial link without any notion of master/slave and without any protocols. It is used to implement all types of proprietary protocols.
Configuration of the Transparent mode defines the format of the frames sent/received on the serial link.
The frames received on the serial link which are detected as complete/valid are copied in the exchange table at the address indicated in the configuration.
When a change occurs in the exchange table of the data to be sent in transparent mode, a verification is carried out to validate that the frame is in the correct format. If these data form a complete frame, the said frame is immediately sent to the serial link.
It is possible to exchange frames up to 250 bytes in input (reception) and 250 bytes in output (transmission).
To do this, it is necessary to define how the frames are marked:
End of frame defined by a special character
Length of frame known
End of frame detected on timeout
3.8.1 Case where the end of the frame is detected thanks to a special character
In this example, the length of the frames being received and transmitted is 128 bytes, the end character of the frame is the ASCII character "CR" (0x0D):
Code
Function
Maximum length
2
Read discrete inputs
2000 bits
3
Read holding registers
125 registers
4
Read input registers
125 registers
5
Write single coil
1 bit
6
Write single register
1 register
7
Read exception status
1 byte
15
Write multiple coils
1968 bits
16
Write multiple registers
123 registers
23
Read/Write Multiple registers
125 registers in read mode, 118 in write mode
Page 24
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 24/135
Figure 15: Transparent with detection of the end of frame character
After receiving the first byte on the serial link:
If no bytes are received for the timeout period defined in the configuration of the serial link, an error is
indicated and the incomplete frame is not stored in the exchange table.
If the length of the frame received is more than the number of input bytes set in the configuration, and if
the frame received is valid, the frame is stored in a truncated form in the exchange table.
If a change is detected in the outputs after the writing process of MODBUS/TCP client:
If an end of frame character is present in the frame, the data is transmitted on the serial link from the 1st
byte up to and including the end of frame character. The remaining bytes are ignored.
3.8.2 Case where the Length of frame is known
In this mode, the 1st byte of the frame must contain the number of bytes:
Figure 16: Transparent mode with length defined at the beginning of the frame
After receiving the first byte on the serial link:
If the expected bytes are not received for the timeout period defined in the configuration of the serial link,
the incomplete frame is not stored in the exchange table.
If the length of the frame received is more than the configured number of input bytes, and if the frame
received is valid, the frame is transmitted in a truncated form to the exchange table.
If a change is detected in the data to be sent on the transparent link:
If the 1st byte indicates a length longer than the number of outputs configured, no data is sent.
Page 25
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 25/135
3.8.3 Case where the end of the frame is detected following timeout.
The 1st byte of the inputs configured in the exchange table indicates the number of bytes received. The 1st byte of the outputs configured in the exchange table must indicate the number of bytes to be transmitted.
Figure 17: Transparent mode with end of frame detection on timeout
After receiving the first byte on the serial link:
If no bytes are received for the timeout period defined in the configuration of the serial link, the number of
characters received is recorded in the 1st byte of the configured inputs then the received data are stored in the exchange table in accordance with this length byte.
If the length of the frame received plus one length byte is higher than the number of input bytes
configured, the frame is stored in truncated form in the exchange table.
If a change is detected in the data to be sent on the transparent link:
If the 1st byte indicates a length longer than the number of outputs configured, no data is sent.
3.8.4 Functioning of the frame trigger
The frame counter, when activated, is added at the beginning of the input and output frames in the exchange table:
Figure 18: Transparent mode with use of the frame trigger/counter
This counter is increased every time a new frame is available. It is used to indicate the presence of a new received frame, or to detect a new frame to be transmitted.
Page 26
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 26/135
3.9 Principle of configuration of the product
VPGate MODBUS/TCP to serial is configured using the integrated Web server. The Web server hosts pages dedicated for the configuration of the following components:
1 IP address parameters 2 serial link 3 protocol used on Ethernet 4 protocol used on the serial link 5 TOR input and output 6 password for “administrator” and “user” sessions
Figure 49: Configuration of the gateway via the Web server
The default configuration of VPGate may be modified through the Web server in order to create a customised configuration which meets more specific requirements.
The configuration of VPGate may be backed-up permanently using the Web server on its file system in the directory “Config/Config.ini.”.
This configuration file can be exported and backed-up, or it can be loaded in other units of VPGate MODBUS/TCP to serial.
It is possible to revert to the default configuration, and to once again set the factory settings.
Page 27
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 27/135
4. Software configuration
4.1 Procedure to access the VPGate Web server
The steps to be followed to find or configure the IP address of VPGate are as follows:
Figure 20 : Procedure for finding/configuring the IP address of VPGate MODBUS/TCP to serial
The IP configuration remains unchanged once it is applied via the Web server or DCP, VPGate shall use these IP parameters from the next reboot of the product.
Refer to section 5.1 Configuration of the IP address using the DIP switch and 5.2 Configuration of the IP address using the DCP protocol and follow the VPGate IP configuration steps.
Page 28
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 28/135
Important: The IP address is a critical element for accessing the product. Even though it is possible to discover VPGate using the DCP protocol, or to use the DIP switch to allocate a default IP address, it is always preferable to record your IP address on a label, or in a file.
4.2 Procedure for configuring the serial link
To ensure communication on the serial link, it is necessary to know the capabilities of each piece of equipment and to configure the serial link accordingly. It is imperative to ensure that the parameters are identical for all pieces of equipment interfacing on the serial link. Refer to the technical documentation for the equipment for instructions about the configuration. The steps to be followed to configure the serial link are as follows:
Figure 51 : Procedure for configuring the serial link of VPGate MODBUS/TCP to serial
Page 29
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 29/135
Refer to section 5.3 Configuration of the serial link to follow the configuration steps of the VPGate serial link.
4.3 Procedure for configuring the MODBUS/TCP server
VPGate functions in MODBUS/TCP server mode when using Ethernet in order to exchange data with the MODBUS/TCP clients (Supervision or controllers). By default, VPGate does not require special configuration to ensure the functioning of the MODBUS/TCP server, however, it is possible to modify certain parameters. The steps to be followed to configure the MODBUS/TCP server are as follows:
Figure 262: Procedure for configuring the VPGate MODBUS/TCP server
Page 30
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 30/135
4.4 Procedure for configuring the MODBUS serial link master
In MODBUS master mode, VPGate allows:
1 Accessing the slaves using the “Direct Messaging” mode by converting MODBUS/TCP messages into
MODBUS serial link requests (default mode)
2 Using the internal memory table as an exchange zone between MODBUS/TCP and MODBUS serial link
(“Advanced Gateway” mode)
Figure 23 : Procedure for configuring the VPGate MODBUS master
Page 31
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 31/135
In case no.1, VPGate functions as shown in section 3.2 Default configuration . In case no. 2, VPGate must be configured to define the MODBUS scenarios to be executed for:
filling the exchange zone with data read in the MODBUS slaves. The data can be obtained by MODBUS/TCP
clients by accessing the VPGate MODBUS/TCP server.
writing the data present in the exchange zone in the MODBUS slaves. The data to be written are provided
by MODBUS/TCP clients which fill the exchange table by accessing the VPGate MODBUS/TCP server.
It is possible to use both mode simultaneously. In this case, VPGate executes scenarios configured by the user,
and it is possible, between the execution of both scenarios, to execute a “Direct Messaging” acyclical request
to read/write a particular parameter in a MODBUS slave.
4.5 Procedure for configuring the MODBUS serial link slave
In MODBUS Slave mode, VPGate provides its internal exchange table. A MODBUS master can read or write in the internal table in order to exchange data with MODBUS/TCP clients. The configuration process is as follows:
Figure 24 : Configuration process of the VPGate MODBUS slave
Page 32
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 32/135
4.6 Procedure for configuring transparent mode
The configuration process of transparent mode is as follows:
Figure 25 : The configuration process of VPGate transparent mode
Page 33
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 33/135
5. Implementation of the Default Configuration
To access the configuration Web server, it is necessary to know the IP address. There are two possible methods:
Configuration of the default IP address using the DIP switch no. 1 on the front surface
Configuration of the IP address via the DCP protocol
5.1 Configuration of the IP address using the DIP switch
As indicated in paragraph 2.3.1 Default configuration of the IP address, it is possible to allocate a default IP address configuration to VPGate:
The procedure to be followed to access the VPGate Web server is as follows:
1 Configure the IP parameters of the equipment used (PC, tablet, Smartphone, etc.) to connect to the Web
server using:
Important: ensure that the chosen IP address has not already been used by another piece of equipment
Figure 26 : Example of configuration of IP parameters in Windows 7
IP address
Sub-net mask
192.168.10.20
255.255.255.0
IP address
Sub-net mask
Between 192.168.10.1 and 192.168.10.254
255.255.255.0
Page 34
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 34/135
2 Ensure that the IP address 192.168.10.20 has not been used on the Ethernet network on which VPGate is
going to be connected. In Windows, open the command prompt “cmd” and enter the command “ping
192.168.10.20”. Ensure that there is no response:
Figure 27 : Verification by “Ping” that the IP address 192.168.10.20 is free, using the Windows command prompt
3 Set the VPGate DIP switch no. 1 to ON (to the right):
Figure 28: Position of DIP switch no. 1 to configure the default IP address
Comment: the position of the other switches (no. 2, 3 and 4) is not of any relevance.
4 Connect VPGate to the Ethernet network and power it on. 5 Ensure that the green “ON” indicator light is steady and that the “RUN” indicator light is blinking 6 Open a Web browser (Google Chrome or Mozilla Firefox) and type “192.168.10.20” in the address bar:
Figure 29: Connecting to the Web server using Google Chrome
7 By default, the account configuration is as follows:
Page 35
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 35/135
8 Configuring a new IP address using the Web server:
Figure 30 : Configuring the IP address using the Web server
The information related to the VPGate network configuration can be found in the section “Network Settings”.
The “IP configuration mode” field indicates the source of the IP parameters configuration.
Here, it is indicated “DIP Switches” since we have followed the procedure for allocating the default IP address
using DIP switch no. 1 on the front surface.
A field is valid when it is highlighted in green, and invalid if it is highlighted in red.
The fields “IPv4 address” and “Defaults Gateway” are in red brackets if there is inconsistency between the address of the IP network:
Account
Username
Password
Administrator (R/W)
Admin
Admin
User (R)
User
User
IPV4 Address
Subnet Mask
Default Gateway
Validity
192,168,10,100
255.255.255.0
192.168.10.1
Valid
192.168.10.100
255.255.255.0
192.168.222.1
Invalid, IP network address not matching
128.20.1.100
255.255.0.0
128.1.1.1.
Valid
Page 36
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 36/135
The “Apply” button becomes active only when the IP parameters are valid.
“Default Gateway” field is optional and can be left empty if no particular default gateway address is required.
After clicking on “Apply”, the Web page automatically reconnects to the Web server using the new VPGate IP
address. It is necessary to log-in once more to access the web-site.
Return to the “Network Settings” section to ensure that the parameters have been properly recorded.
The page now indicates that the method of configuration of the IP parameters is static, i.e. configured based on the parameters entered in VPGate:
Figure 31 : Source of the IP parameters configuration
These parameters are recorded in the permanent memory.
Important: Do not forget to reset the DIP switch no. 1 to OFF after the configuration of the new IP address, otherwise VPGate shall revert to the default IP address once it is restarted.
Its parameters are independent of the configuration of the gateway operating modes, they are not saved in the configuration file.
Transferring the configuration file “config.ini” to another VPGate device shall not change the IP parameters of the latter. It will be necessary to manually modify this address via the Web or the DCP protocol.
128.20.1.100
255.255.0.0
128.40.1.1
Invalid, IP network address not matching
Page 37
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 37/135
5.2 Configuration of the IP address using the DCP protocol
The DCP protocol (Discovery and basic Configuration Protocol) allows discovering and configuring the IP address of the VPGate devices connected to an Ethernet network.
The freeware Primary Setup Tools (PST) provided by SIEMENS allows implementing the DCP protocol on a Windows workstation (V4.2 compatible with Windows 8.1). PST is available on the SIEMENS support site:
https://support.industry.siemens.com
The procedure to be followed is as follows:
1 Install the software on the computer and configure the network interface which it must use to discover
VPGate:
Figure 32 : Configuration of the network interface used by “Primary Setup Tool”
2 Connect VPGate to the Ethernet network and power it on (24 V DC power supply).
3 Click on the discover button which is depicted by a magnifying glass to the top left:
Figure 33: Discovering VPGate via DCP in PST
Page 38
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 38/135
4 The discovery tool shows the list of equipment that respond to the DCP identification frames. Click on the
icon ( ) to extend the list of information related to a piece of equipment and click on “Ind. Ethernet interface” to modify the IP parameters of the equipment and back them up by clicking on the icon ( ) ):
Figure 74 : Modification of the IP address using DCP and “Primary Setup Tool”
5 It is also possible to configure the name of the equipment in order to identify it more easily:
Figure 35: Modification of the DCP name of VPGate using “Primary Setup Tool”
Now, VPGate shall reboot with the IP address indicated above. These parameters are recorded in the permanent memory.
Important: Ensure that DIP switch no. 1 is set to OFF after the configuration of the new IP address, otherwise VPGate shall revert to the default IP address once it is restarted.
These parameters are independent of the configuration of the gateway operating modes, they are not saved in the configuration file.
Transferring the configuration file “config.ini” to another VPGate device shall not change the IP parameters of the latter. It will be necessary to manually modify this address using the Web or the DCP protocol.
Page 39
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 39/135
5.3 Configuration of the serial link
Select the type of serial link used, RS-232 or RS-485, as shown in section 2.3.2 Choosing the RS-232/RS-485 mode
To ensure MODBUS communication between a master (VPGate in this case) and slaves, it is necessary to use identical serial link parameters:
Name
Description
Possible values
Baud rate
Communication speed of the serial link (in bits/s)
1200
2400
9600
19200
38400
57600
115200
230400
Parity
Presence or not of a parity bit
None
Even
Odd
Stop bits
Number of stop bits 1
2
Data bits
Number of data bits 7 (ASCII mode)
8 (RTU mode)
Interchars timeout
Maximum time between 2 characters of a frame (detects the end of the frame).
1.5 characters + from 0 to 65535 ms
Interframe silence
Waiting time to be complied with after receiving a frame, before it is possible to retransmit
3.5 characters + from 20 to 65535 ms
Page 40
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 40/135
The data transmission mode on the serial link (RTU or ASCII) must also be identical between the MODBUS master and slaves.
Adjusting the detection of absence of slaves via the “Timeout” and “Retries” parameters is also important to ensure proper functioning of the installation.
These options can be found in subsection Modbus Master Serial settings:
All these parameters can be adjusted on the VPGate webpage, in the section Serials settings:
Figure 36: Configuring the serial link using the VPGate Web server
Click on the “Apply” button to apply the parameters temporarily (configuration lost after reboot).
Click on the “Save” button to save the configuration permanently (configuration retained after reboot).
Name
Description
Possible values
Protocol
The data transmission mode on the serial link RTU: 8 data bits containing hexadecimal values
ASCII: 7 data bits containing the conversion of hexadecimal values into ASCII characters (0x01 = ‘0‘ + ‘1’)
Timeout
Maximum waiting period for response from a slave following a request on the serial link
from 20 to 65535 ms,
default = 1000 ms
Retries
Number of retries following the detection of a timeout (no response from a slave)
from 0 to 65535
default = 2 (1st attempt + 2 retransmissions)
Page 41
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 41/135
5.4 Operating test of the default gateway
The gateway can now be used to interface a MODBUS/TCP client (Controller/Supervision/ or software) with MODBUS serial slaves:
Figure 37 : Overview diagram of the implementation of VPGate in its default configuration
Page 42
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 42/135
6. Implementation of the advanced configuration
6.1 MODBUS/TCP server
The MODBUS/TCP server mode is activated from the page “Gateway Mode”:
Figure 38: Activation of the MODBUS/TCP server mode
Tick the advanced configuration mode Advanced gateway mode and select MODBUS/TCP Server in the dropdown list which defines the Ethernet protocol.
Lastly, click on the “Save” button to back-up the modifications permanently.
The configuration of the MODBUS/TCP server can be accessed from the web server via the MODBUS/TCP SETTINGS menu.
Page 43
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 43/135
Figure 89: MODBUS/TCP server management web page
6.1.1 General information regarding the MODBUS/TCP server
The first part of the page indicates the IP address of the MODBUS/TCP server of VPGate.
Below, a table shows the list of MODBUS/TCP clients which are currently connected to the server. When a client is connected, a line appears with the IP address of the client and the time for which it has been connected:
Figure 40: Management table for MODBUS/TCP clients connected to VPGate
Page 44
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 44/135
A maximum of 5 MODBUS/TCP clients can connect to the TCP standard 502 port and communicate simultaneously. It is also possible to force close a MODBUS/TCP connection, by ticking the box associated with the client and by pressing on the “Close selected connections” button.
6.1.2 Configuration of the MODBUS/TCP server
The second part of the Web page is used to configure the MODBUS/TCP server:
Figure 41: Web page for modifying the parameters of the MODBUS/TCP server of VPGate
Here you can find the box to be ticked which allows activating the “Direct Messaging” mode as well as the
MODBUS function list which are supported by the server.
Click on the “Apply” button to apply the parameters temporarily (configuration lost after reboot).
Click on the “Save” button to save the configuration permanently (configuration retained after reboot).
Page 45
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 45/135
6.2 MODBUS/TCP client
6.2.1 Activation of the MODBUS/TCP client
The MODBUS/TCP client mode is activated from the page “Gateway Mode”:
Figure 42: Activation of the MODBUS/TCP client mode
Tick the advanced configuration mode Advanced gateway mode and select MODBUS/TCP Client in the dropdown list which defines the Ethernet protocol.
Lastly, click on the “Save” button to back-up the modifications permanently.
The configuration of the MODBUS/TCP server can be accessed from the web server via the MODBUS/TCP SETTINGS menu.
6.2.2 Creation of scenarios for the MODBUS/TCP client
The list of scenarios (100 maximum) displays the configuration elements of the scenarios:
Page 46
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 46/135
The IP address of the MODBUS/TCP server to be accessed
MODBUS function used
Address of the bit/register to be accessed in the server
Quantity of bits/registers to be accessed in the server
Address in VPGate, where the read/written data are stored in the server
Release mode of the scenario:
Cyclical sending: definition of a sending period
Sending after change: the request is sent only if a change is detected in the exchange table (only for
MODBUS write requests)
Figure 43: List of scenarios for the MODBUS/TCP client
A toolbox allows creating/modifying/deleting/testing MODBUS scenarios:
Figure 94: Configuration toolbox for the scenarios of the MODBUS/TCP client
Figure 105: Adding a new MODBUS/TCP client scenario
The standard MODBUS/TCP port is used by default, but it is possible to choose the TCP port number used to
connect to the MODBUS/TCP server. The user can choose the TCP port number by adding “:” in the Server IP address field followed by the port number:
Function of reading the register in
the MODBUS/TCP server at the
address 192.168.10.45
Reading the register from 1000 to
1010 (10 registers) Periodical
scenario of fixed 3 second cycle
times
The 10 registers which are read
are stored in the VPGate exchange
table from register address 0 to 9
Page 47
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 47/135
Figure 116: Configuration of a special TCP port for the connection to a MODBUS/TCP server
Configuration of the “Coils” and “Discrete inputs” data access modules in read mode:
Configuration of the “Registers” data access modules in read mode:
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Read coils (1)
Read discrete inputs (2)
First bit address in server
First bit address in the recipient MODBUS/TCP server
0.0 to 4095.15 Quantity
Number of bits to be read
0 to 2000
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First bit address in VPGate
Address where the first bit read is stored in VPGate
0.0 to 4095.15
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Read Holding registers (3)
Read Input Registers (4)
First register address in server
First register address in the recipient MODBUS/TCP server
0 to 65535 Quantity
Number of registers to be read
0 to 125
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First register address in VPGate
Address where the first register read is stored in VPGate
0 to 65535
Page 48
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 48/135
Configuration of the “Coils” data access modules in write mode:
Configuration of the “Registers” data access modules in write mode:
Configuration of the “Registers” data access modules in read/write mode:
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Write Single coil (5)
Write Multiple coils (15)
First bit address in server
First bit address in the recipient MODBUS/TCP server
0.0 to 4095.15 Quantity
Number of bits to be read
0 to 2000
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First bit address in VPGate
Address where the first bit written is stored in VPGate
Following a change in the exchange table outputs
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Write Single register (6)
Write Multiple Registers (16)
First register address in server
First register address in the recipient MODBUS/TCP server
0 to 65535 Quantity
Number of registers to be read
0 to 123
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First register address in VPGate
Address where the first register read is stored in VPGate
Following a change in the exchange table outputs
Name
Description
Possible values
MODBUS Function
MODBUS function to be executed
Read/Write Multiple Registers (16)
First register address in server
First register address in the recipient MODBUS/TCP server
Read
Write
0 to 65535
0 to 65535
Quantity
Number of registers to be read
0 to 125
0 to 123
Page 49
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 49/135
It is possible to test the scenario before adding it to the configuration. Clicking the “TEST” button shall initiate
the execution of the scenario and a dialogue box will be displayed to indicate the results of the tests:
Figure 127: Test of a MODBUS/TCP scenario before addition in the list
The scenario must be validated by clicking on “Apply” to ensure that it is taken into account and executed by
VPGate.
Clicking on “Save” shall allow backing-up the list of scenarios permanently.
6.2.3 Status of scenarios for the MODBUS/TCP client
The created scenario is added to the list of scenarios with a status indicating its state. Directly after it is created, the scenario is added in the list and its status is indicated in the “State” column:
Figure 48: Scenario added in the list of MODBUS/TCP clients pending initial execution
The scenario has a “STARTING” status and is highlighted in blue. This indicates that it has not yet been executed by the client. This happens when the configuration has recently been modified or when there are a lot of scenarios to be executed following the start-up of VPGate.
After having been executed once, the status of the scenario changes:
Figure 139: Scenario added in the list of MODBUS/TCP clients with operational status
The scenario has a “RUNNING” status and is highlighted in green, indicating that it is being executed properly.
In the following example, the data read by the scenario are stored in the exchange table from register address 0 to 9, and are updated every 3 seconds.
If the scenario is not executed correctly, its status changes to error:
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First register address in VPGate
Address where the first register read is stored in VPGate
0 to 65535
Page 50
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 50/135
Figure 50: Error in a MODBUS master scenario
In this case, the MODBUS/TCP server does not respond to the read request of the scenario. This latter is highlighted in red and indicates the type of error encountered “TCP connection lost”.
Moreover, the MODBUS error counters increase following every attempt made by the scenario to reach the server. Refer to section 8.3 Diagnostics with status of the MODBUS/TCP client scenarios for more information regarding the interpretation of the error codes.
6.2.4 Deactivation of a MODBUS/TCP client scenario
The deactivation of a scenario allows stopping its execution, without removing it from the list of scenarios.
This manipulation may be useful in case of maintenance of the MODBUS/TCP network, in order to stop the execution of requests being sent to a piece of equipment which is undergoing maintenance.
To avoid the prolongation of the attempts related to timed-out requests for reaching a server which is no
longer present, it is possible to stop the execution of a scenario by clicking on the “Enabled” checkbox in the
line of the scenario in question:
Figure 51: Deactivation of a MODBUS/TCP client scenario
By unticking the “Enabled” box, the scenario is deactivated but remains backed-up in the configuration. Its status changes to “DISABLED” as long as it is deactivated, and it is highlighted in grey.
6.2.5 Modification or deletion of a MODBUS/TCP client scenario
It is possible to modify the parameters of a MODBUS scenario. Select the corresponding line of the scenario to activate the scenario modification toolbox. The selected scenario is shown inside green brackets.
Page 51
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 51/135
Figure 52: Selection and modification of a MODBUS/TCP client scenario
The toolbox allows modifying the parameters of the MODBUS scenario and backing them up using the “MODIFY” button; the operation may be cancelled by clicking on the “CANCEL” button.
It is also possible to delete the selected scenario by clicking on “DELETE”. It is possible to delete multiple scenarios by selecting multiple scenarios in the list by pressing “Control/CTRL” or “MAJ/SHIFT” and executing a multiple selection:
Figure 53: Status of multiple scenarios of the MODBUS/TCP client
Clicking on “DELETE” allows deleting all selected scenarios.
6.2.6 Backing-up the list of MODBUS/TCP scenarios
After having completed the list of scenarios to be executed, click on the “SAVE” button to save the
configuration permanently.
Figure 5414: Permanently backing-up the list of MODBUS/TCP client scenarios
Page 52
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 52/135
6.3 MODBUS MASTER
6.3.1 Activation of the MODBUS serial link master
The MODBUS/TCP master mode is activated from the page “Gateway Mode”:
Figure 155: Activation of the MODBUS serial link master mode
Tick the advanced configuration mode Advanced gateway mode and select MODBUS Master serial in the dropdown list which defines the Ethernet protocol.
Lastly, click on the “Save” button to back-up the modifications permanently.
6.3.2 Configuration of the MODBUS serial link master
The configuration of the MODBUS master serial can be accessed from the web server via the SERIAL SETTINGS menu. The first section contains the serial link parameters, refer to section Procedure for configuring the serial link for more details.
Page 53
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 53/135
The "Interframe Silence" parameter in the MODBUS master mode:
Set the Interframe silence parameter to specify the minimum waiting time taken into account by VPGate to send a new MODBUS request to a slave after having received the last response (refer to the figure below):
Figure 166: Interframe Silence in MODBUS master mode
The second part of the page contains the elements that allow configuring the parameters of the master and the MODBUS scenarios that it has to execute:
Figure 177: Configuration web page of the VPGate MODBUS master serial
The data transmission mode on the serial link (RTU or ASCII) must be configured identically between the MODBUS master and slaves, just like the serial link parameters (baud rate, parity, stop bits, etc.).
Page 54
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 54/135
Refer to the document MODBUS over serial line specification and implementation guide [2] for more information regarding the RTU and ASCII modes.
It is possible to adjust the detection of the absence of a slave using the “Timeout” and “Retries” parameters.
These configuration options can be found in subsection Modbus Master Serial settings:
Click on the “Apply” button to apply the parameters temporarily (configuration lost after reboot).
Click on the “Save” button to save the configuration permanently (configuration retained after reboot).
6.3.3 Creation of the MODBUS serial link master scenarios
The list of scenarios (100 maximum) displays the configuration elements of the scenarios:
Address of the slave to be accessed
MODBUS function used
Address of the bit/register to be accessed in the slave
Quantity of bits/registers to be accessed in the slave
Address in VPGate, where the read/written data are stored in the slave
Release mode of the scenario:
Cyclical sending: definition of a sending period
Sending after change: the request is sent only if a change is detected in the exchange table (only for
MODBUS write requests)
Name
Description
Possible values
Protocol
The data transmission mode on the serial link RTU: 8 data bits containing hexadecimal values
ASCII: 7 databits containing the conversion of hexadecimal values into ASCII characters (0x01 = ‘0‘ + ‘1’)
Timeout
Maximum waiting period for response from a slave following a request on the serial link
from 20 to 65535 ms,
default = 1000 ms
Retries
Number of retries following the detection of a timeout (no response from a slave)
from 0 to 65535
default = 2
(1 attempt + 2 retransmissions)
Page 55
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 55/135
Figure 58: List of MODBUS master serial scenarios
A toolbox allows creating/modifying/deleting/testing MODBUS scenarios:
Figure 5918: Configuration toolbox for the MODBUS serial scenarios
Figure 60: Adding a new MODBUS/TCP serial link scenario
Function of reading the register in
the MODBUS 45 slave
Reading the register from 1000 to
1010 (10 registers) Periodical
scenario of fixed 3 second cycle
times
The 10 registers which are read
are stored in the VPGate exchange
table from register address 0 to 9
Page 56
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 56/135
Configuration of the “Coils” and “Discrete inputs” data access modules in read mode:
Configuration of the “Registers” data access modules in read mode:
Configuration of the “Coils” data access modules in write mode:
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Read coils (1)
Read discrete inputs (2)
First bit address in slave
First bit address in the recipient MODBUS slave
0.0 to 4095.15 Quantity
Number of bits to be read
0 to 2000
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First bit address in VPGate
Address where the first bit read is stored in VPGate
0.0 to 4095.15
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Read Holding registers (3)
Read Input Registers (4)
First register address in slave
First register address in the recipient MODBUS slave
0 to 65535 Quantity
Number of registers to be read
0 to 125
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
First register address in VPGate
Address where the first register read is stored in VPGate
0 to 65535
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Write Single coil (5)
Write Multiple coils (15)
First bit address in slave
First bit address in the recipient MODBUS slave
0.0 to 4095.15
Page 57
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 57/135
Configuration of the “Registers” data access modules in write mode:
Configuration of the “Registers” data access modules in read/write mode:
Quantity
Number of bits to be read
0 to 2000
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
Following a change in the exchange table outputs
First bit address in VPGate
Address where the first bit written is stored in VPGate
0.0 to 4095.15
Name
Description
Possible values
MODBUS function
MODBUS function to be executed Write Single register (6)
Write Multiple Registers (16)
First register address in slave
First register address in the recipient MODBUS slave
0 to 65535 Quantity
Number of registers to be read
0 to 123
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
Following a change in the exchange table outputs
First register address in VPGate
Address where the first register read is stored in VPGate
0 to 65535
Name
Description
Possible values
MODBUS Function
MODBUS function to be executed
Read/Write Multiple Registers (16)
First register address in slave
First register address in the recipient MODBUS slave
Read
Write
0 to 65535
0 to 65535
Quantity
Number of registers to be read
0 to 125
Cycle time (in ms)
Cycle time for request transmission
Cyclical: 100ms to 65535ms
Page 58
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 58/135
It is possible to test the scenario before adding it to the configuration. Clicking the “TEST” button shall initiate
the execution of the scenario and a dialogue box will be displayed to indicate the results of the tests:
Figure 61: Test of a MODBUS master scenario before addition in the list
The scenario must be validated by clicking on “Apply” to ensure that it is taken into account and executed by VPGate.
Clicking on “Save” shall allow backing-up the list of scenarios permanently.
6.3.4 Status of the MODBUS serial link master scenarios
The created scenario is added to the list of scenarios with a status indicating its state. Directly after it is created, the scenario is added in the list and its status is indicated in the “State” column:
Figure 62: Scenario added in the list of the master with operational status
The scenario has a “RUNNING” status and is highlighted in green, indicating that it is being executed properly. In the following example, the data read by the scenario are stored in the exchange table from register address 0 to 9, and are updated every 3 seconds.
If the scenario is not executed correctly, its status changes to error:
Figure 63: Error in a MODBUS master scenario
Here, the slave does not respond to the scenario read request. This latter is highlighted in red and indicates the type of error encountered “Timeout, no answer from slave after retrying”. Moreover, the MODBUS error counters increase following every attempt made by the scenario to reach the slave. Refer to section 8.2
First register address in VPGate
Address where the first register read is stored in VPGate
0 to 65535
First register address in slave
First register address in the recipient MODBUS slave
Read
Page 59
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 59/135
Diagnostics with status of MODBUS master scenarios for more information regarding the interpretation of the error codes.
6.3.5 Deactivation of a MODBUS serial link master scenario
The deactivation of a scenario allows stopping its execution, without removing it from the list of scenarios.
This manipulation may be useful in case of maintenance of the MODBUS network, in order to stop the execution of requests being sent to a piece of equipment which is undergoing maintenance.
To avoid the prolongation of the attempts related to timed-out requests for reaching a slave which is no longer
present, it is possible to stop the execution of a scenario by clicking on the “Enabled” checkbox in the line of
the scenario in question:
Figure 64: Deactivation of a MODBUS serial link scenario
By unticking the “Enabled” box, the scenario is deactivated but remains backed-up in the configuration. Its status changes to “DISABLED” as long as it is deactivated, and it is highlighted in grey.
6.3.6 Modification or deletion of a MODBUS serial link master scenario
It is possible to modify the parameters of a MODBUS scenario Select the corresponding line of the scenario to activate the scenario modification toolbox. The selected scenario is shown inside green brackets.
Figure 65: Selection and modification of a MODBUS master scenario
The toolbox allows modifying the parameters of the MODBUS scenario and backing them up using the “MODIFY” button; the operation may be cancelled by clicking on the “CANCEL” button.
Page 60
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 60/135
It is also possible to delete the selected scenario by clicking on “DELETE”. It is possible to delete multiple
scenarios by selecting multiple scenarios in the list by pressing “Control/CTRL” or “MAJ/SHIFT” and executing a
multiple selection:
Figure 66: Selection of multiple MODBUS master scenarios
Clicking on “DELETE” allows deleting all selected scenarios.
6.3.7 Backing-up the list of MODBUS master
After having completed the list of scenarios to be executed, click on the “SAVE” button to save the
configuration permanently.
Figure 67: Permanent backing-up the list of MODBUS master
Page 61
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 61/135
6.4 MODBUS SLAVE
6.4.1 Activation of the MODBUS serial link slave
The MODBUS/TCP slave mode is activated from the page “Gateway Mode”:
Figure 68: Activation of the MODBUS serial link slave mode
Tick the advanced configuration mode Advanced gateway mode and select MODBUS Slave serial in the dropdown list which defines the Ethernet protocol.
Lastly, click on the “Save” button to back-up the modifications permanently.
6.4.2 Configuration of the MODBUS serial link slave
The configuration of the MODBUS slave serial can be accessed from the web server via the SERIAL SETTINGS menu. The first section contains the serial link parameters, refer to section 4.2 Procedure for configuring the serial link for more details.
Page 62
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 62/135
The "Interframe Silence" parameter in the MODBUS slave mode:
Set the “Interframe silence” parameter to specify the waiting time taken into account by VPGate to respond to the latest MODBUS request (refer to the figure below):
Figure 69: Interframe Silence in MODBUS slave mode
The second part of the page contains the elements that allow configuring the parameters of the MODBUS serial link slave:
Figure 70: Configuration web page of the MODBUS serial link slave
Page 63
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 63/135
The data transmission mode on the serial link (RTU or ASCII) must be configured identically between the MODBUS master and slaves, just like the serial link parameters (baud rate, parity, stop bits, etc.).
Refer to the document MODBUS over serial line specification and implementation guide [2] for more information regarding the RTU and ASCII modes.
The address of the slave must be configured between 1 and 247 to ensure that a MODBUS master can access VPGate.
It is possible to choose the MODBUS functions supported by the Slave by ticking/unticking the related boxes.
Click on the “Apply” button to apply the parameters temporarily (configuration lost after reboot).
Click on the “Save” button to save the configuration permanently (configuration retained after reboot).
6.5 TRANSPARENT MODE
6.5.1 Activation of the MODBUS serial link slave
The transparent mode is activated from the page “Gateway Mode”:
Figure 71: Activation of transparent mode on the serial link
Tick the advanced configuration mode “Advanced gateway mode” and select “Transparent mode” in the dropdown list which defines the Ethernet protocol.
Lastly, click on the “Save” button to back-up the modifications permanently.
Page 64
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 64/135
6.5.2 Configuration of transparent mode on the serial link
The configuration of the serial link transparent mode can be accessed from the web server via the SERIAL SETTINGS menu. The first section contains the serial link parameters, refer to section 4.2 Procedure for configuring the serial link for more details.
The "Interframe Silence" parameter in the TRANSPARENT mode:
The “Interframe silence” parameter allows introducing a new waiting time between the reception and transmission of a frame:
Figure 72: Interframe Silence in TRANSPARENT mode
If no frame is detected, VPGate sends frames on the serial link regardless of the inter-frame waiting period. But, if a frame is detected on RX, VPGate waits for the inter-frame waiting period to elapse before sending the next frame.
Page 65
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 65/135
The second part of the page contains the elements that allow configuring the parameters of Transparent mode on the serial link:
Figure 73: Configuration web page for transparent mode on the serial link
In transparent mode, it is necessary to define the end of frame detection mode. Refer to section
3.8.Transparant Mode [3] for more information about the configuration modes. The starting address of the frames transmitted/received on the serial link must be configured. The maximum size of the frames transmitted/received on the serial link must also be configured. The following parameters can be configured:
Name
Description
Possible values
End of Frame (EOF) delimiter (1)
Defines how the end of a frame shall be detected
NULL (0x00)
SPACE (0x20)
LF (0x0A)
CR (0x0D)
CR LF
LF CR
User defined
Length in 1st byte(3)
On timeout (2) (3)
User defined EOF delimiter
ASCII code of the end of frame character (case where the "EOF delimiter" = User defined)
0 to 255
Page 66
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 66/135
(1): If this parameter is set to User defined, the end of frame character taken into account is the one specified by the parameter "User defined EOF". If it is set to "on timeout", the reception timeout taken into account is the one defined in the serial link configuration.
(2) : In case the parameter "EOF delimiter" is set to "on timeout", only the detection of the frames received on the serial link shall be carried out following a timeout. In the exchange table, the 1st byte received specifies the length of the frame (it is added by VPGate and does not originate from the serial link). During transmission, the first byte must define the length of the frame to be sent on the serial link (this byte must not be sent on the serial link). (refer to section 3.4.1).
(3): In case the parameter "EOF delimiter" is set to “length in 1st byte", or “on timeout”, the default value to be filled is 0x00.
(4): This counter is used as a trigger:
If this parameter is activated, the 1st byte of the outputs must be a counter which is increased every time
data are available and must be sent. The useable data begins from the 2nd byte. If there is no counter, the frame is copied from the 1st frame once a change is detected in the outputs.
If this parameter is activated, the 1st byte of the inputs must be increased every time a new frame is
received on the serial link. The useable data are copied following this counter. If there is no counter, the received frame is copied from the 1st byte.
Enable frame trigger (4)
Defines whether a frame counter is added at the beginning of the input and output frames
Enabled
Disabled
Store address of 1st byte to receive
Address in the exchange table where the frame received over the serial link is stored
0 to 2047
Received frame size in bytes
Size of the received frame
1 to 250
Address of 1st byte to send
Address in the exchange table where the frame to be sent over the serial link is stored
2048 to 4095
Sent frame size in bytes
Size of the sent frame
1 to 250
Enable frame checksum (CRC16)
Specifies whether a CRC16 must be checked in the data received over the serial link, and must be added at the end of the data sent to the equipment on the serial link.
Enabled
Disabled
End of frame timeout (ms) (5)
Time during which the end of frame is detected when the EOF Delimiter parameter is set to "On timeout".
0 to 65535 ms
Page 67
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 67/135
7. DIGITAL INPUT/OUTPUT
7.1 Configuration of the digital input/output
The configuration of the digital input/output can be accessed from the web server via the “IO SETTINGS” menu.
Figure 74: Configuration web page of the TOR inputs/outputs
The configuration of the digital input starts with the activation, then the definition of the register address in the exchange table which will contain the value of the digital input:
If the input is 1, the Least Significant Bit of the register is set to 1.
If the input is 0, the Least Significant Bit of the register is set to 0.
The configuration of the digital output starts with the activation, then the definition of the register address in the exchange table which will contain the value of the digital output:
If the Least Significant Bit of the register is set to 1, the output is forced to 1 (closed).
If the Least Significant Bit of the register is set to 0, the output is forced to 0 (open).
Page 68
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 68/135
8. DIAGNOSTICS
8.1 Explanation of the LEDs
The diagnostics of the VPGate functioning can be carried out based on the LEDs on the front surface of the product. It is possible to know whether the product has been configured properly if there is communication on the serial link, or even if the MODBUS master detects a communication error with a slave.
Refer to the section 2.2 Lights for more details regarding the functioning of the lights on the front surface.
The lights can also be accessed via the Web server, and it is thus possible to see whether there are any communication errors or whether or not there is any communication on the serial link:
Figure 75: VPGate front surface with communication error displayed on the Web server
On this front surface, it can be seen that the “Net2” LED is red (blinking); which indicates that there is an error
in a scenario on the MODBUS master.
Moreover, if the “Rx” indicator does not blink at all, it can be deduced that there is no response from the slave, and that a timeout error has occurred.
It is also possible to verify the status of the Ethernet link or whether there is any communication on the link based on the lights of the switch ports. Refer to section 2.2.1 Indicator light of the 2 ports switch.
Page 69
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 69/135
8.2 Diagnostics with status of MODBUS master scenarios
As indicated in section 6.3.4 Status of the MODBUS serial link master scenarios, the MODBUS master scenarios provide a status of their operational status.
Figure 76: Example of an error in a MODBUS master scenario
In case of an error, the status specifies what type of error has occurred:
Error message
Description
Scenario starting
Indicates that the scenario has not yet been executed by the master. This message is displayed often after reboot or when the list of scenarios is large and thus takes a long time to be executed.
Frame received without request
A frame has been received without a request being sent. Only the Master is capable of initiating a transmission on MODBUS. There may be another master on the bus. Or then perhaps there is a fault in a slave and it is transmitting frames without a request.
Received illegal function from slave (0x01)
The slave has responded with an exception indicating that it does not support the required function.
Received illegal data address from slave (0x02)
The slave has responded with an exception indicating that the requested address is not accessible for this function. It is possible that the address + length pair exceeds the acceptable limits of the slave A slave with 100 registers shall generate this exception if it is sent a read request with 5 registers from the address 96 onwards.
Received illegal data value from slave (0x03)
The slave has detected an inconsistency error between the data received and the number of data indicated in the frame. The slave responds with this exception if it receives a write frame with 5 registers, but if the field containing the values possesses only 3 register values, for example.
Slave failed to execute request (0x04)
The slave was not able to execute the request owing to a fatal error.
Slave is busy, cannot execute request (0x06)
The slave cannot process the request quickly and is requesting the master to resend the request later on when it will have finished processing it.
Slave not responding, retrying...
Indicates that the slave has not yet responded to the requests sent, but that the master is retrying
Page 70
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 70/135
8.3 Diagnostics with status of the MODBUS/TCP client scenarios
As indicated in section 6.2.3 Status of scenarios for the MODBUS/TCP client, the MODBUS/TCP client scenarios provide a status of their operational status.
Figure 77: Example of an error in a MODBUS/TCP client scenario
In case of an error, the status specifies what type of error has occurred:
Timeout, no answer from slave after retrying
The slave is experiencing a “timeout”, no response has been received by it
after retransmissions. This indicates that the requested slave is not present because:
It is not connected to the bus, or is connected incorrectly
It does not possess the same configuration parameters of the serial
link as that of the master
Its power supply has been interrupted
Received unexpected function in answer
This message indicates that the slave has not responded with the same function code as that indicated in the request.
Received unexpected data/quantity in answer
This message indicates that the slave has not responded with the same quantity of data as indicated in the request.
Error message
Description
Scenario starting
This indicates that it has not yet been executed by the client. This message is displayed often after reboot or when the list of scenarios is large and thus takes a long time to be executed.
Frame received without request
A MODBUS/TCP message has been received without a request being sent. Only the client is capable of initiating a transmission on MODBUS/TCP. Perhaps there is a fault in a slave and it is transmitting MODBUS/TCP messages without a request.
Received illegal function from server (0x01)
The server has responded with an exception indicating that it does not support the required function.
Received illegal data address from server (0x02)
The server has responded with an exception indicating that the requested address is not accessible for this function. It is possible that the address + length pair exceeds the acceptable limits of the server A server with 100 registers shall generate this exception if it is sent a read request with 5 registers from the address 96 onwards.
Page 71
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 71/135
Received illegal data value from server (0x03)
The server has detected an inconsistency error between the data received and the number of data indicated in the message. The server responds with this exception if it receives a write frame with 5 registers, but if the field containing the values possesses only 3 register values, for example.
Server failed to execute request (0x04)
The server was not able to execute the request owing to a fatal error.
Server is busy, cannot execute request (0x06)
The server cannot process the request quickly and is requesting the client to resend the request later on when it will have finished processing it.
Gateway path unavailable (0x0A)
If the server is a gateway, this message indicates that the gateway is not able to connect to the required recipient (configuration problem or gateway overload).
Gateway target failed to respond (0x0B)
If the server is a gateway, this message indicates that the recipient has not responded to the request. Generally, this message indicates that the equipment to which the request is sent is not present on the networks joined by the gateway.
Server not responding, retrying...
Indicates that the server has not yet responded to the requests sent, but that the client is retrying
Timeout, no answer from server after retrying
The server is experiencing a “timeout”, no response has been received by
it after retransmissions. This indicates that the requested server is not present because:
It is not connected to the network, or is connected incorrectly
It is on a different VLAN than the client,
It does not possess the same IP network address as the client,
The TCP port requested by the client does not correspond with the TCP
port of the server,
The TCP port requested by the client is protected by a firewall present
on the network
The server is not able to open a TCP connection (maximum number
supported by the server reached),
Its power supply has been interrupted.
Received unexpected function in answer
This message indicates that the server has not responded with the same function code as that indicated in the request from the client.
Received unexpected data/quantity in answer
This message indicates that the server has not responded with the same quantity of data as indicated in the request from the client.
Page 72
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 72/135
8.4 Statistics of the MODBUS master
VPGate records the statistics when the MODBUS MODE serial link master mode is activated. They are available on the page “MODBUS STATISTICS” on the Web server:
Figure 78: Web page of the MODBUS master statistics
This page displays the values of the error counters for the various errors which can be detected by the master, refer to section 8.2 Diagnostics with status of MODBUS master scenarios for more details about these error messages.
The statistics are reset to zero in the following cases:
Change in the MODBUS master configuration (addition/removal of MODBUS scenarios, for example)
Reboot the gateway
Click the “Reset” button at the bottom of the statistics page
Page 73
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 73/135
8.5 Web page of the MODBUS slave statistics
VPGate records the statistics when the MODBUS serial link slave mode is activated. They are available on the page “MODBUS STATISTICS” on the Web server:
Figure 79: Statistics web page of the MODBUS slave
This page displays the values of the error counters for the various errors which can be detected by the VPGate MODBUS slave:
The statistics are reset to zero in the following cases:
Change in the configuration of the slave (address of the slave, activation/deactivation of a MODBUS
function)
Reboot the gateway
Click the “Reset” button at the bottom of the statistics page
Error message
Description
Invalid CRC in frame received
Indicates that a frame received by the VPGate MODBUS slave has a CRC error.
Invalid length in frame received
The length of the frame does not correspond to the quantity of data that it contains.
Failed to send data
Data cannot be transmitted on the serial link.
Hardware general failure
Internal fatal error in VPGate.
Page 74
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 74/135
9. Web server
9.1 Presentation of the Web server
To access the Web server, a valid IP address must be configured on VPGate, in order to configure this address, refer to section 5.1 Configuration of the IP address using the DIP switch and 5.2 Configuration of the IP address using the DCP protocol and follow the VPGate IP configuration steps. The home page of the site is as follows:
Figure 80: Home page of the Web server
A generic Web server consists of a home page that provides access to the following menus (to the left):
System information: general information about VPGate
Network settings: provides MAC and IP addresses of VPGate and the configuration of the new IP
parameters
Gateway Mode: allows configuring the operating mode of the gateway
Modbus/TCP settings: allows configuring the MODBUS/TCP protocol
Serial settings: allows configuring the serial link and its associated protocol
IO settings: allows configuring the TOR input and output
SNMP Information: presents a summary of the SNMP data of the system
Ethernet statistics: provides an overview of the statistics from the integrated 2 ports Ethernet switch
Modbus statistics: provides statistics related to the activated MODBUS serial link protocol
File system: interface that allows accessing the VPGate file system
Firmware upload: allows downloading firmware on VPGate
Reboot: allows remotely rebooting VPGate
Passwords: allows modifying the passwords of the “user” and “admin” accounts
Logout: allows changing the login
Custom: link to VPGate customisable pages
On the right side of the Web server, there is function for real-time monitoring of the VPGate, which allows uploading the status of the:
NET1 and NET2 fault LEDs
Page 75
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 75/135
the LED Run
LEDs for reception and transmission on the serial link (Tx/Rx)
the DIP switch of the default configuration
the DIP switch for selecting the serial link mode RS-485 / RS-232
The monitoring is refreshed every 250ms. It is possible to deactivate/activate it (activated by default) by clicking on the refresh icon:
Figure 81: data refresh icon of the Web server
This icon also allows deactivating the periodical refreshing which is carried out every one second for this menu.
9.2 Management of access to the Web server
The Web server is protected by an authentication system which is based on a username and associated password. By default, the values are as follows:
Table 2: Default usernames and passwords for the Web server
It is possible to log-in and change the username via the “Logout” menu.
The usernames are fixed, but their associated passwords can be changed from the “Passwords” menu of the
Web server. The user account has the following restrictions:
Unable to load the files on the file system via the “File System” menu
Unable to load new firmware in VPGate via the “Upload firmware” menu
Unable to reboot VPGate remotely via the “Reboot” menu
Unable to change passwords via the “Passwords” menu
Username
Default password
Admin
Admin
User
User
Activate
Deactivated
Page 76
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 76/135
9.3 “System information” menu
This menu provides general information about the VPGate MODBUS/TCP – SERIAL product:
Table 2: Description of the fields on the “System information” page
There are two links in the information table which allow downloading:
The VPGate user manual (link named “User Manual”)
the configuration file “config.ini” containing the configuration backed-up in VPGate
These two documents are stored in the VPGate file system and can be accessed through the FTP server.
9.4 “Network settings” menu
This menu provides the MAC addresses used by VPGate as well as the current IP configuration:
Table 3: Description of the fields on the “Network settings” page
Name
Description
Device Name
Workstation name allocated to VPGate (character string empty in factory settings or after “Reset DCP”)
Manufacturer
Name of the manufacturer of VPGate: PROCENTEC
Order ID
Product reference of VPGate: 110-00013A
Serial Number
Serial number of VPGate
Firmware version
Identifier of the version of the software loaded on VPGate
Hardware version
Identifier of the hardware version of VPGate
Up Time
Time elapsed since last powering on of VPGate
Name
Description
MAC Address (internal)
VPGate MAC address
IP configuration mode
Current configuration mode of the IP parameters (Static/Manual/Fixed, DIP switch, DCP)
IP Address
VPGate IP Address
Subnetwork Mask
Mask of the IP sub network used by VPGate
Gateway Address
Default gateway address of VPGate
Page 77
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 77/135
The IP parameters of the VPGate MODBUS/TCP – SERIAL product may be configured in different manners:
Via the Web server, configured in static mode
Using the DCP protocol
Using the DIP switch no.2 on the front surface
Refer to section 5.1 Configuration of the IP address using the DIP switch and 5.2 Configuration of the IP address using the DCP protocol Configuration of the IP address using the DCP protocol.
9.5 “Gateway mode” menu
This menu offers the possibility of configuring VPGate by choosing Advanced Gateway mode and selecting the protocols to be used as regards the Ethernet and the serial link.
For the configuration of the MODBUS/TCP server mode, refer to section 6.1 MODBUS/TCP server.
For the configuration of the MODBUS/TCP client, refer to section 6.2 MODBUS/TCP client.
For the configuration of the MODBUS serial link master, refer to section 6.3 MODBUS MASTER.
For the configuration of the MODBUS serial link slave, refer to section 6.4 MODBUS SLAVE .
For the configuration of the transparent mode, refer to section 6.5 TRANSPARENT MODE .
9.6 “Modbus/TCP settings” menu
This menu is used to configure the MODBUS/TCP protocol, the contents of the page are specific to the Ethernet protocol selected.
Refer to section 6.1 MODBUS/TCP server for more details regarding the configuration of the MODBUS/TCP Server mode.
Refer to section 6.2 MODBUS/TCP client for more details regarding the configuration of the MODBUS/TCP Client mode.
9.7 “Serial settings” menu
This menu is used to configure the protocol used on the serial link, the contents of the page are specific to the protocol selected.
Refer to sections 6.3 MODBUS MASTER, 6.4 MODBUS SLAVE , 6.5 TRANSPARENT MODE for more details regarding the elements on this page.
9.8 “IO settings” menu
The all or nothing input and output can be configured from this page. Refer to section 7 DIGITAL INPUT/OUTPUT for more details regarding the configuration of the All of nothing input/output.
Page 78
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 78/135
9.9 “SNMP information” menu
This menu provides a summary of the “system” group information of the SNMP MIB-2:
Table 4: Description of the fields on the “SNMP information” page
9.10 “ETHERNET statistics” menu
This menu provides statistics of the integrated 2 ports switch of VPGate. It consists of multiple tables and a button which allows resetting the internal statistics of the switch.
Table 5: Description of the “Port configuration and status” statistics
Name
Description
SysName
Name of the system: VPGate Ethernet
SysDescription
Description of the system: VPGate MODBUS/TCP to Serial
SysContact
Permanent contact address of the system supplier: info@procentec.com
SysLocation
Indicates the location of the product in the installation (can be modified via SNMP)
SysUptime
Time elapsed since last powering on of the system
“Port configuration and status”
Name
Description
Port
Port number
Name
Username of the Ethernet port (used for the network neighbourhood via LLDP)
Speed
Bandwidth configured on the port (10/100Mbits)
Enabled
Status of the port (up = activated / down= deactivated)
State
Status of the Ethernet link (up= link present / down = no link)
Last change
Value of SysUptime during the most recent change on the part (link changed from up to down for example)
Page 79
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 79/135
Table 6: Description of the “Traffic types” statistics
Table 7: Description of the “Traffic” statistics
“Traffic types”
Name
Description
Rx Unicast
Number of frames received in unicast on one port or the total number (All)
Rx Multicast
Number of frames received in multicast on one port or the total number (All)
Rx Broadcast
Number of frames received in broadcast on one port or the total number (All)
Tx Unicast
Number of frames transmitted in unicast on one port or the total number (All)
Tx Multicast
Number of frames transmitted in multicast on one port or the total number (All)
Tx Broadcast
Number of frames transmitted in broadcast on one port or the total number (All)
“Traffic”
Name
Description
IN bytes
Bytes received
OUT bytes
Number of bytes transmitted
IN frames
Number of frames received
OUT frames
Number of frames transmitted
Bandwidth use
Percentage of the bandwidth used
Max use
Maximum percentage of bandwidth use recorded
“Frames errors”
Name
Description
CRC
Number of frames with a CRC/FCS error (Frame CheckSum)
Undersize
Number of frames smaller than 64 bytes
Page 80
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 80/135
Table 8: Description of the “Frame errors” statistics
9.11 “MODBUS Statistics” menu
This menu presents the statistics of the serial link depending on the mode being used. With the MODBUS serial link master mode, the following information is displayed:
Oversize
Number of frames larger than 1536 bytes
IN frames discarded
Number of input frames which could not be processed by the switch (buffer full)
OUT frames discarded
Number of output frames which could not be processed by the switch (buffer full) Collisions
Number of collisions detected
Page 81
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 81/135
With the MODBUS serial link slave mode, the following information is displayed:
The page does not contain any information if transparent mode has been selected. This information is updated in real-time by the Web server at intervals of one second. It is also possible to force reset the counters to zero by clicking on “Reset”. For more details regarding this page, refer to the section 8.4 Statistics of the MODBUS master” and section 8.5 “Statistics of the MODBUS slave”.
9.12 “File system” menu
This page allows accessing the file system present on VPGate. It is possible to browse through it by clicking on the directories. The current path always starts with "/FLASH0" which is the root folder of the file system. The total space and remaining space on the file system are displayed in kilobytes. The directories are indicated with the type "DIRECTORY" and the files with their size in the "Size” column. The user can access the directory by clicking on it. To download a file, right click on the file, then select “save as”:
Figure 82: downloading a file from the “File system” page
It is possible to add files using the “upload file” which is located in the explorer. The current directory in the explorer is used as the destination directory. The “Upload file” button is used to open a dialogue box which
allows choosing the file to be added. When the download begins, a line with the name of the file and a loading icon informs the user that the file is being written in the system folders.
Page 82
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 82/135
9.13 “Firmware upload” menu
The software pre-loaded on VPGate can be upgraded from this page.
Only the “admin” account has the rights to load new firmware in VPGate.
The file name must imperatively be “image.bin”. It is preferable to stop communication with MODBUS/TCP
clients and the serial link to optimise the upgrade period.
The “Upload firmware” button is used to open a dialogue box which allows choosing the file to be loaded.
The firmware is uploaded after the file is selected. An icon indicates that the operation is in progress and must not be interrupted. The first phase which consists of transferring the file can be monitored based on the percentage of the file being transferred:
Figure 83: loading the image on VPGate via the “Firmware Upload” page
Once the file is completely loaded (100%), the percentage indicator is no longer shown, but the firmware has to be validated by VPGate. This operation can take 1 to 2 minutes to complete and is represented by the loading icon.
Figure 84: validation of the image by VPGate on the “Firmware Upload” page
The operation ends with a remote reboot of VPGate. A dialogue box is displayed automatically on the Web server and indicates that it is necessary to reboot VPGate to apply the modifications:
Figure 85: rebooting VPGate following a firmware installation
VPGate will reboot and apply the new firmware. This operation generally takes about 1 minute during which VPGate must not be powered off. During this phase, the lights on the front surface of VPGate shall not be functional, till the system reboots. The update procedure ends when the “RUN” light blinks at a rate of 1Hz again.
Operation in
progress!
Percentage
downloaded
Operation in
progress!
Page 83
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 83/135
To verify whether the update has been effective, please check the firmware version displayed on the “System Information” page
Important: the update function of the firmware is not compatible with Internet Explorer. It has been tested and validated using Google Chrome (v36.0.1985.143) and Mozilla Firefox (v31.0).
9.14 “Reboot” Menu
This page allows remotely rebooting VPGate. Only the “admin” account has the rights to carry out this operation. A dialogue box is displayed and indicates that the reboot process of VPGate has stopped its switch functionality, which could result in a network interruption for the period required for the rebooting, it the wiring is done in “daisy-chain” mode:
Figure 86: remotely rebooting VPGate via the “Reboot” page
9.15 “Passwords” Menu
This page allows modifying the passwords of the “user” and “admin” accounts.
Figure 87: modification of the password via the “Passwords” page
The password of the “admin” account is required in order to carry out the modification (“current admin password”).
The account to be modified is chosen from the “Choose a login” dropdown list.
Page 84
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 84/135
It is necessary to enter the new password in the last two fields for validation.
Clicking the “Save” button will allow applying the modification if:
The password of the “admin” page is valid
The new password has been entered properly in the last two fields
9.16 “Logout” Menu
To change the user account, it is possible to click on the “Logout” menu, which will immediately trigger the
initiation of an authentication request:
Figure 88: changing the user via the “Logout” menu
Once it has been authenticated, the home page of the Web server shall be loaded once again.
9.17 “Custom” menu / Customised WEB pages
The Web server is designed to allow access to customised web pages. These Web pages can be:
Static HTML pages, containing links to images, etc.
Dynamic HTML pages, which allow accessing the equipment data, using JavaScript code and a specific API
(set of functions) to interact with the internal data exchange table of VPGate.
HTML pages hosting JAVA applets, which will be downloaded and executed on the PC connected to the
equipment, and will also allow accessing the equipment data, via MODBUS/TCP requests, for example.
The HTML pages, images, etc… can be stored anywhere and at any level in the file system.
9.18 Access to data via personalised Web pages
This paragraph only concerns the aspect of accessing the data via an VPGate Ethernet CGI server. It is possible, using any net browser, to access the equipment data in read and write mode. There are two operating methods:
Page 85
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 85/135
Direct access to the referenced data table
If the field "@" (address) is higher than 247, the request is interpreted as being intended for the VPGate internal data table:
Figure 19: Direct access to the internal data table via a customised web page
Figure 89: “Gateway” mode via a customised web page
If the field "@" (address) is lower than or equal to 247, the request is interpreted as being intended directly for MODBUS slave equipment on the serial link. A MODBUS request is thus sent on the serial link, awaiting a response.
For this mode to function, the MODBUS master serial link mode must be activated. The MODBUS requests thus generated shall be inserted between configured MODBUS requests. If a request arrives while a scenario is being executed, it is transmitted once the ongoing scenario ends.
9.19 Example of customised WEB pages
Here is an example of a customised Web page provided with VPGate. It allows:
browsing in sub-menus via tabs,
periodically read the temperature, in “Gateway” mode, which is measured by a MODBUS serial equipment
connected on VPGate.
presenting a dynamic overview diagram of the system with a trend line and system status,
sending requests to read or write MODBUS registers to equipment communicating on MODBUS serial.
Page 86
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 86/135
Figure 90: Example of a customised WEB page
This example uses JavaScript libraries and accesses the equipment data via specific AJAX requests. For more information pertaining to the design of the example, please refer to the APPENDIX DAPPENDIXE: "API AJAX Javascript".
Page 87
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 87/135
10. FTP server
An FTP server allows accessing the file system. The connection uses the following parameters:
IP address: Current VPGate IP Address
Port: 21
login: admin
Password: admin (by default)
FTP mode: passive
Option for displaying hidden files activated (-a).
The same “admin” account as on the Web server is used to log on to the FTP server.
It is possible to carry out all operations on the files and directories (read/ write files, creating/ deleting directories).
Example of connection using FileZilla (http://filezilla-project.org):
first, tick the option “Force display of hidden files”:
Figure 91: Tick the option “Force display of hidden files”
then enter the login information. Here is an example:
Figure 92: Entering the login information
Figure 93: Local and remote file
Local file system
Remote file system
Page 88
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 88/135
11. SNMP agent
VPGate Ethernet supports the SNMP V1 protocol as an SNMP agent with the standard MIB2 database.
With SNMP, a supervisor (Network Management Station) can read the information stored in the VPGate MIB2 and recover:
General information about the equipment (system)
Time elapsed since last powering on (system)
The statuses of the ports, status of the link and configured bandwidth (interface)
The statistics related to the Ethernet frames received/transmitted (interface)
The statistics related to the IP packets received/transmitted (IP)
Figure 94: structure of the MIB 2 (refer to APPENDIX E)
SNMP V1 uses a community key which is exchanged in the requests to authorise their processing. VPGate uses the following default values:
Public key for read only: “public”
Private key for read/write: "private"
Page 89
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 89/135
In addition to the information contained in MIB2, VPGate MODBUS/TCP has an integrated extension, MIB LLDP. This MIB contains the topology information transmitted by the equipment in the VPGate neighbourhood.
This information can be read by a SNMP client (in this example, the software “HiVision” developed by Hirschmann or “SINEMA SERVER” by SIEMENS) which can then draw the topology of the server.
Figure 95 : discovering the topology
The information from the MIB LLDP can also be read directly using a third party MIB explorer:
Figure 96 : SNMP browser
Page 90
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 90/135
12. APPENDICES
12.1 APPENDIX A: Format of the MODBUS frames
The MODBUS functions 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0F, 0x10, 0x17 are supported by VPGate in master, serial link slave and MODBUS/TCP server modes. The format of each function is explained in detail using examples for the RTU and ASCII Modes. The CRC bytes (MODBUS RTU) or LRC bytes (MODBUS ASCII) are mandatory. In MODBUS RTU, the data are encoded in 8 bits. In MODBUS ASCII, the data are encoded in 7 bits.
Reminder: It is important to differentiate the address of a MODBUS register from the MODBUS register number. The register 1 is at the address 0x0000. In a MODBUS frame, it is the register address which is transmitted. When the scenarios are being configured, the MODBUS register address must be transmitted.
Function 1 (0x01)
This function allows reading the state of several booleans (coils or Discrete outputs). The broadcast is not supported. The number of booleans to be read simultaneously with VPGate is limited to 2000 (16 bits x 125 registers).
Format of the request:
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x01
0x01
"01"
0x30, 0x31
Most significant 1st bit address
0x00
0x00
"00"
0x30, 0x30
Least significant 1st bit address
0x22
0x22
"22"
0x32, 0x32
Number of most significant bits
0x00
0x00
"00"
0x30, 0x30
Number of least significant bits
0x12
0x12
"12"
0x31, 0x32
Error check ( CRC / LRC )
-
0x18 0xB5
"92"
0x39, 0x32
End of frame
- - CR LF
0xD, 0xA
Page 91
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 91/135
Format of the response:
Function 2 (0x02)
This function allows reading the state of several booleans (coils or Discrete inputs). The broadcast is not supported. The number of booleans registers to be read simultaneously with VPGate is limited to 2000 (16 bits x 125 registers).
Format of the request:
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x01
0x01
"01"
0x30, 0x31
Number of data bytes
0x03
0x03
"03"
0x30, 0x33
Status of bits 0x29 to 0x22
0x59
0x59
"59"
0x35, 0x39
Status of bits 0x32 to 0x2A
0xC4
0xC4
"C4"
0x43, 0x34
Status of bits 0x34 to 0x33
0x01
0x01
"01"
0x30, 0x31
Error check ( CRC / LRC )
-
0x7B 0xE5
"A5"
0x41, 0x35
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x02
0x02
"02"
0x30, 0x32
Most significant 1st bit address
0x00
0x00
"00"
0x30, 0x30
Page 92
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 92/135
Format of the response:
Least significant 1st bit address
0x22
0x22
"22"
0x32, 0x32
Number of most significant bits
0x00
0x00
"00"
0x30, 0x30
Number of least significant bits
0x12
0x12
"12"
0x31, 0x32
Error check ( CRC / LRC )
-
0x5C 0xB5
"91"
0x39, 0x31
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x02
0x02
"02"
0x30, 0x32
Number of data bytes
0x03
0x03
"03"
0x30, 0x33
Status of bits 0x29 to 0x22
0x59
0x59
"59"
0x35, 0x39
Status of bits 0x32 to 0x2A
0xC4
0xC4
"C4"
0x43, 0x34
Status of bits 0x34 to 0x33
0x01
0x01
"01"
0x30, 0x31
Error check ( CRC / LRC )
-
0x3F 0xE5
"A4"
0x41, 0x34
End of frame
- - CR LF
0xD, 0xA
Page 93
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 93/135
Function 3 (0x03)
This function allows reading the MODBUS registers (Holding Registers). The broadcast is not supported. The number of registers to be read simultaneously is limited to 125.
Format of the request:
Format of the response:
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x03
0x03
"03"
0x30, 0x33
Most significant 1st register address
0x00
0x00
"00"
0x30, 0x30
Least significant 1st register address
0x22
0x22
"22"
0x32, 0x32
Number of most significant registers
0x00
0x00
"00"
0x30, 0x30
Number of least significant registers
0x02
0x02
"02"
0x30, 0x32
Error check ( CRC / LRC )
-
0x60 0xB9
"A0"
0x41, 0x30
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x03
0x03
"03"
0x30, 0x33
Number of data bytes
0x04
0x04
"04"
0x30, 0x34
Page 94
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 94/135
Function 4 (0x04)
This function allows reading the MODBUS registers (Input Registers). The broadcast is not supported. The number of registers to be read simultaneously is limited to 125.
Format of the request:
Most significant 1st register value
0x68
0x68
"68"
0x36, 0x38
Least significant 1st register value
0x31
0x31
"31"
0x36, 0x38
Most significant 2nd register value
0x47
0x47
"47"
0x36, 0x38
Most significant 2nd register value
0x59
0x59
"59"
0x36, 0x38
Error check ( CRC / LRC )
-
0xFD 0x95
"87"
0x38, 0x37
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x04
0x04
"04"
0x30, 0x34
Most significant 1st register address
0x00
0x00
"00"
0x30, 0x30
Least significant 1st register address
0x22
0x22
"22"
0x32, 0x32
Number of most significant registers
0x00
0x00
"00"
0x30, 0x30
Number of least significant registers
0x03
0x03
"03"
0x30, 0x33
Error check ( CRC / LRC )
-
0x14 0xB9
"9E"
0x39, 0x45
End of frame
- - CR LF
0xD, 0xA
Page 95
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 95/135
Format of the response:
Function 5 (0x05)
This function allows writing a boolean (coil) to ON or OFF. The broadcast is supported. The boolean can take the value 0x0000 (OFF) or 0xFF00 (ON).
Format of the request:
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x04
0x04
"04"
0x30, 0x34
Number of data bytes
0x06
0x06
"06"
0x30, 0x36
Most significant 1st register value
0x68
0x68
"68"
0x36, 0x38
Least significant 1st register value
0x31
0x31
"31"
0x33, 0x31
Most significant 2nd register value
0x47
0x47
"47"
0x34, 0x37
Most significant 2nd register value
0x59
0x59
"59"
0x35, 0x39
Most significant 32nd register value
0x00
0x00
"00"
0x30, 0x30
Error check ( CRC / LRC )
-
0xE2 0xD9
"84"
0x38, 0x34
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x01
0x01
"01"
0x30, 0x31
Page 96
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 96/135
Format of the response:
Function code
0x05
0x05
"05"
0x30, 0x35
Most significant register address
0x00
0x00
"00"
0x30, 0x30
Least significant register address
0x22
0x22
"22"
0x32, 0x32
Most significant register value
0xFF
0xFF
"FF"
0x46, 0x46
Least significant register value
0x00
0x00
"00"
0x30, 0x30
Error check ( CRC / LRC )
-
0x2C 0x30
"D9"
0x44,0x39
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x01
0x01
"01"
0x30, 0x31
Function code
0x05
0x05
"05"
0x30, 0x35
Most significant register address
0x00
0x00
"00"
0x30, 0x30
Least significant register address
0x22
0x22
"22"
0x32, 0x32
Most significant register value
0xFF
0xFF
"FF"
0x46, 0x46
Least significant register value
0x00
0x00
"00"
0x30, 0x30
Error check ( CRC / LRC )
-
0x2C 0x30
"D9"
0x44, 0x39
End of frame
- - CR LF
0xD, 0xA
Page 97
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 97/135
Function 6 (0x06)
This function allows writing a MODBUS register (Holding Registers). The broadcast is supported.
Format of the request:
Format of the response:
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x06
0x06
"06"
0x30, 0x36
Most significant register address
0x00
0x00
"00"
0x30, 0x30
Least significant register address
0x22
0x22
"22"
0x32, 0x32
Most significant register value
0x00
0x00
"00"
0x30, 0x30
Least significant register value
0x56
0x56
"56"
0x35, 0x36
Error check ( CRC / LRC )
-
0xAD 0x46
"49"
0x34, 0x39
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x03
"39"
0x33, 0x39
Function code
0x06
0x06
"06"
0x30, 0x36
Most significant register address 0x0
0x00
0x00
"00"
0x30, 0x30
Page 98
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 98/135
Function 15 (0x0F)
This function allows writing several booleans (coils or Discrete outputs) to ON or OFF. The broadcast is supported. The number of booleans registers to be written simultaneously with VPGate is limited to 1968 (16 bits x 123 registers).
Format of the request:
Least significant register address 0x0
0x22
0x22
"22"
0x32, 0x32
Most significant register value
0x00
0x00
"00"
0x30, 0x30
Least significant register value
0x56
0x56
"56"
0x35, 0x36
Error check ( CRC / LRC )
-
0xAD 0x46
"49"
0x34, 0x39
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x0F
0x0F
"0F "
0x30, 0x46
Most significant 1st bit address
0x00
0x00
"00"
0x30, 0x30
Least significant 1st bit address
0x22
0x22
"22"
0x32, 0x32
Number of least significant bits to be written
0x00
0x00
"00"
0x30, 0x30
Number of most significant bits to be written
0x12
0x12
"12"
0x31, 0x32
Number of data bytes
0x03
0x03
"03"
0x30, 0x33
Page 99
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 99/135
Format of the response:
Value of the bits 0x29 to 0x22
0x2B
0x2B
"2B"
0x32, 0x42
Value of bits 0x32 to 0x2A
0x06
0x06
"06"
0x30, 0x36
Value of bits 0x34 to 0x33
0x03
0x03
"03"
0x30, 0x33
Error check ( CRC / LRC )
-
0x68 0xCB
"4D"
0x34,0x44
End of frame
- - CR LF
0xD, 0xA
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x0F
0x0F
"0F "
0x30, 0x46
Most significant 1st bit address
0x00
0x00
"00"
0x30, 0x30
Least significant 1st bit address
0x22
0x22
"22"
0x32, 0x32
Number of least significant bits to be written
0x00
0x00
"00"
0x30, 0x30
Number of most significant bits to be written
0x12
0x12
"12"
0x31, 0x32
Error check ( CRC / LRC )
-
0x71 0x74
"84"
0x38, 0x34
End of frame
- - CR LF
0xD, 0xA
Page 100
VPGate manual - MODBUS/TCP to serial V1.0.0 | 30 juni 2017 | ©PROCENTEC 100/135
Function 16 (0x10)
This function allows writing MODBUS registers (Holding Registers). The broadcast is supported. The number of registers to be written simultaneously is limited to 123.
Format of the request:
Format of the response:
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x10
0x10
"10"
0x31, 0x30
Most significant 1st register address
0x00
0x00
"00"
0x30, 0x30
Least significant 1st register address
0x22
0x22
"22"
0x32, 0x32
Number of most significant registers
0x00
0x00
"00"
0x30, 0x30
Number of least significant registers
0x02
0x02
"02"
0x30, 0x32
Number of data bytes
0x04
0x04
"04"
0x30, 0x34
Most significant register value 0x52
0x00
0x00
"00"
0x30, 0x30
Name of the field
Value to be transmitted
Bytes sent in case of RTU
Bytes sent in case of ASCII
Character
ASCII character code
Frame header
- - ":"
0x3A
Slave address
0x39
0x39
"39"
0x33, 0x39
Function code
0x10
0x10
"10"
0x31, 0x30
Most significant 1st register address
0x00
0x00
"00"
0x30, 0x30
Loading...