Modbus
Modbus
MODBUS RTU Slave (All function)
Select the protocol "Modbus RTU Slave (All Fuction)",
Then set baud rate, port, stop bits, data bits, parity.
Modbus Meter
The following example is using the Linfee meter LNF96EY to demonstrate how to set up the Modbus communication.
1. Wiring the RS485 cable first. Because the pin 58 is A, the pin 59 is B for meter. Here we use the COM1 to connect. So the diagram like follows:
2. Check the specific Modbus parameter in the communication menu from LED display.
So from the following pictures, we can know the Meter Address is 85, Baud rate is 9600, CRC None.
✎Note: Meter address usually corresponding to the Modbus Slave Station No. on the Modbus communication.
3. Set up the communication in the Configuration tab.
Select the protocol as ModBus RTU Slave (All Function). And set the communication parameters like below.
4. Create new real-time monitoring tag accroding to Modbus manual
Enter the address we want to read from the meter. The following table is intercept part of the manual for Linfee Modbus manual.
0x03/0x04 command data register address:
Address | Description | Data Format | Data Length(Word) | Remark | ||
---|---|---|---|---|---|---|
HEX | DEC | |||||
0x00 | 0 | Reserved | ||||
0x02 | 2 | Reserved | ||||
0x04 | 4 | Reserved | ||||
0x06 | 6 | Ua | float | 2 | Phase Voltage data, Unit V | |
0x08 | 8 | Ub | float | 2 | Phase Voltage data, Unit V | |
0x0A | 10 | Uc | float | 2 | Phase Voltage data, Unit V | |
0x0C | 12 | Uab | float | 2 | Line Voltage data, Unit V | |
0x0E | 14 | Ubc | float | 2 | Line Voltage data, Unit V | |
0x10 | 16 | Uca | float | 2 | Line Voltage data, Unit V | |
0x12 | 18 | Ia | float | 2 | Phase Current data, Unit A | |
0x14 | 20 | Ib | float | 2 | Phase Current data, Unit A | |
0x16 | 22 | Ic | float | 2 | Phase Current data, Unit A |
✎Note: We usually use the Data Type 4 for read the Modbus registers(Function Code 03)
For example, here we want to read the Phase Voltage Ua (Modbus offset 0006), the Modbus register main No. requires input decimal number, and check whether the actual address has one address offset, so the tag configured like the following screenshot:
✎Note: If the read value is incorrect, please check whether need to change the Byte order.
Set the Modbus Slave Station No.
If the communication is setup successfully, the tag will show green light.
MODBUS RTU Master
Select the protocol "Modbus RTU Master",
Then set baud rate, port, stop bits, data bits, parity
address list
Type | Data Type | Function code and description |
---|---|---|
Word | 3 | 04 (Read Input Registers: Read the current binary value in one or more input registers) |
06 (write single register: write a binary value to a holding register) | ||
10 (write values to multiple addresses ) | ||
4 | 03 (read holding register: read current binary value in one or more holding registers) | |
06 (write single register: write a binary value to a holding register) | ||
10 (write values to multiple addresses ) | ||
W6 | 03 (read holding register: read current binary value in one or more holding registers) | |
06 (write single register: write a binary value to a holding register) | ||
10 (write values to multiple addresses ) | ||
W16 | 03 (read holding register: read current binary value in one or more holding registers) | |
10 (write values to multiple addresses ) | ||
Bit | 0 | 01 (Read coil state) |
05 (Force a single coil to force the on/off state of a logic coil) | ||
0F (Write multiple bits, ie write continuously) | ||
1 | 02 (Read the input state) | |
05 (Force a single coil to force the on/off state of a logic coil) | ||
0F (Write multiple bits) | ||
W5 | 01 (Read coil state to obtain the current state of a set of logic coils) | |
05 (Force a single coil to force the on/off state of a logic coil) | ||
0F (Write multiple bits) | ||
W15 | 01 (Read coil state to obtain the current state of a set of logic coils) | |
0F (Write multiple bits) |
MODBUS TCP Slave (All function)
Supported series: MODBUS TCP controller
V-B0X works as MODBUS TCP MASTER connecting with TCP SLAVE
1)V-BOX Setting
Items | Settings | Note |
Protocol | MODBUS TCP Slave (All function) | |
Connection | Ethernet | |
Port No. | 502 | |
PLC station No. | 1 |
2)Address List
Type | Data Type | Function code & Description |
---|---|---|
Word | 3 | 04 (read input register: read current binary value in one or more input registers) |
06 (write single register: write a binary value to a holding register) | ||
10 (write values to multiple addresses ) | ||
4 | 03 (read holding register: read current binary value in one or more holding registers) | |
06 (write single register: write a binary value to a holding register) | ||
10 (write values to multiple addresses ) | ||
W6 | 03 (read holding register: read current binary value in one or more holding registers) | |
06 (write single register: write a binary value to a holding register) | ||
10 (write values to multiple addresses ) | ||
W16 | 03 (read holding register: read current binary value in one or more holding registers) | |
10 (write values to multiple addresses ) | ||
Bit | 0 | 01 (Read coil state) |
05 (Force a single coil to force the on/off state of a logic coil) | ||
0F (Write multiple bits, ie write continuously) | ||
1 | 02 (Read the input state) | |
05 (Force a single coil to force the on/off state of a logic coil) | ||
0F (Write multiple bits) | ||
W5 | 01 (Read coil state to obtain the current state of a set of logic coils) | |
05 (Force a single coil to force the on/off state of a logic coil) | ||
0F (Write multiple bits) | ||
W15 | 01 (Read coil state to obtain the current state of a set of logic coils) | |
0F (Write multiple bits) |
3)Communication Settings
Configure V-BOX Ethernet IP in Networking Settings
Configure PLC Ethernet IP in Communication;
4)Cable Wiring