Modbus

Version 2.2 by Leo Wei on 2023/08/24 14:11

Modbus 

MODBUS RTU Slave (All function)

Select the protocol "Modbus RTU Slave (All Fuction)",

Then set baud rate, port, stop bits, data bits, parity.

1624342015914-382.png

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:

LinfeeTerminalDiagram.png

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.

MeterModbusAllView.png

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.

VNETCommunicationtabmeter.png

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 DescriptionData FormatData Length(Word)Remark
  HEXDEC       
0x000Reserved   
0x022Reserved   
0x044Reserved   
0x066Uafloat2Phase Voltage data, Unit V
0x088Ubfloat2Phase Voltage data, Unit V
0x0A10Ucfloat2Phase Voltage data, Unit V
0x0C12Uabfloat2Line Voltage data, Unit V
0x0E14Ubcfloat2Line Voltage data, Unit V
0x1016Ucafloat2Line Voltage data, Unit V
0x1218Iafloat2Phase Current data, Unit A
0x1420Ibfloat2Phase Current data, Unit A
0x1622Icfloat2Phase 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:

VNETModbusTagSettings.png

VNETModbusTagByteSettings.png

✎Note: If the read value is incorrect, please check whether need to change the Byte order.

Set the Modbus Slave Station No.

ModbusStationSettings.png

If the communication is setup successfully, the tag will show green light.

Monitoringtaggreenlight.png

MODBUS RTU Master

Select the protocol "Modbus RTU Master",

Then set baud rate, port, stop bits, data bits, parity

1624348709622-711.png

address list

TypeData TypeFunction code and description
Word304 (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 )
403 (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 )
W603 (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 )
W1603 (read holding register: read current binary value in one or more holding registers)
10 (write values to multiple addresses )
Bit001 (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)
102 (Read the input state)
05 (Force a single coil to force the on/off state of a logic coil)
0F (Write multiple bits)
W501 (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)
W1501 (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

ItemsSettingsNote
ProtocolMODBUS TCP Slave (All function) 
ConnectionEthernet 
Port No.502 
PLC station No.1

2)Address List

TypeData TypeFunction code & Description
Word304 (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 )
403 (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 )
W603 (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 )
W1603 (read holding register: read current binary value in one or more holding registers)
10 (write values to multiple addresses )
Bit001 (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)
102 (Read the input state)
05 (Force a single coil to force the on/off state of a logic coil)
0F (Write multiple bits)
W501 (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)
W1501 (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

image-20220902111833-3.png

Configure PLC Ethernet IP in Communication;

image-20220902111121-1.png

4)Cable Wiring

12.PLC Protocol_html_2297240b57346b2a.png

communicate with VB inverter

download link