1 Communication
WECON PLC
LX3V Serial Protocol
Supported series: WECON LX2V/ LX2E/ LX3V/LX3VP/LX3VE/LX3VM
1)PLC Settings
Item | Settings | Note |
Protocol | WECON LX2V/ LX2E/ LX3V/LX3VP/LX3VE/LX3VM | |
Connection | RS422/RS485 | |
Baud rate | 9600 | |
Data bit | 7 | |
Parity | EVEN | |
Stop bit | 1 | |
PLC station No. | 1 |
2)PLC Address List
Type | Device registers | HMI registers | Format | Range | Note |
Bit | X | X | Xo | 0~303237 | |
Y | Y | Y o | 0~303237 | ||
M | M | M d | 0~99999 | ||
T | T | T d | 0~99999 | ||
C | C | C d | 0~99999 | ||
S | S | S d | 0~99999 | ||
Word | X | X | Xo | 0~303237 | |
Y | Y | Y o | 0~303237 | ||
M | M | M d | 0~99999 | ||
T | T | T d | 0~99999 | ||
C | C | C d | 0~199 | ||
D | D | D d | 0~7999 | ||
S | S | S d | 0~99999 | ||
SD | SD | SD d | 8000~9999 |
3)Configure the communication protocol
4)hardware connection
- RS422
- RS485
LX5V Serial Protocol
This example introduces the establishment of serial port communication between V-BOX and LX5V. It is introduced through three parts: PLC software configuration, V-BOX software configuration, and hardware wiring.
Software configuration of PLC
1)PLC programming software
2)New PLC project
Click New Project and select the PLC model.
3)Set Serial port parameters
Follow the steps below to configure Serial port parameters
Baud rate:115200
Data bit:8
Stop bit:1
Parity:No verification
4)Registers list
V-BOX software configuration
1)V-BOX programming software
2)V-NET add device
Open V-NET client software → add device. As shown in the figure below, click "+" in the order of steps, and the Add Device window will pop up, enter the access key, password and remark, to add the device.
3)Set communication port parameters
Click the communication configuration button on the left to find the communication protocol with LX5V. After selecting the protocol, configure the communication parameters of the COM port.
Baud rate:115200
Data bit:8
Stop bit:1
Parity:No verification
hardware connection
1)Hardware wiring diagram
The above are all the steps for establishing serial port communication between V-BOX with LX5V PLC.
LX5V-N Ethernet protocol
This example introduces the establishment of Ethernet communication between V-BOX and LX5V-N. It is introduced through three parts: PLC software configuration, V-BOX software configuration, and hardware wiring.
Software configuration of PLC
1)PLC programming software
2)New PLC project
Click New Project and select the PLC model.
3)Set Ethernet port parameters
Follow the steps below to configure Ethernet parameters
PLC IP address:192.168.39.200
default gateway:192.168.39.1
subnet mask:255.255.255.0
4)Registers list
V-BOX software configuration
1)V-BOX programming software
2)V-NET add device
Open V-NET client software → add device. As shown in the figure below, click "+" in the order of steps, and the Add Device window will pop up, enter the access key, password and remark, to add the device.
3)Set communication Protocol
Click Communication to configure the LX5V plc protocol and IP address.
hardware connection
1)Hardware wiring diagram
The above are all the steps for establishing ethernet communication between V-BOX with LX5V PLC.
Rockwell PLC
MicroLogix Protocol
MicroLogix 1000/1100/1200/1400/1500; SLC 5/03 5/04 5/05 PLC-5
HMI Settings
Item | Settings | Note |
Protocol | Allen-Bradlley DF1 Advanced | |
Connection | RS232 | |
Baud rate | 19200 | |
Data bit | 8 | |
Parity | None | |
Stop bit | 1 | |
PLC station No. | 1 |
Address List
Type | Device registers | Format | Range | Note |
Bit | I | I d.d | 0.0~255.15 | |
O | O d.d | 0.0~255.15 | ||
B | B nnhh.dd | 0.0~ffff.15 | nn: block number (hex) | |
S | S d.d | 0.0~255.15 | ||
N | N nnhh.dd | 0.0~ffff.15 | nn: block number (hex) | |
Word | S | S d | 0~255 | |
TS | TS nnhh | 0~ffff | nn: block number (hex) | |
TP | TP nnhh | 0~ffff | ||
CS | CS nnhh | 0~ffff | ||
CP | CP nnhh | 0~ffff | ||
N | N nnhh | 0~ffff | ||
C | C nnhh | 0~ffff | ||
T | T nnhh | 0~ffff | ||
R | R nnhh | 0~ffff |
Cable Wiring
CompactLogix Protocol
This example introduces the establishment of Ethernet communication between Wecon V-box and CompactLogix L1769. It is introduced through three parts: PLC software configuration, V-box software configuration, and hardware wiring.
Software configuration of PLC
1)PLC programming software
2)New PLC project
Click New Project and select the PLC model.
3)Set Ethernet parameters
Follow the steps below to configure Ethernet parameters
PLC IP address:192.168.40.101
default gateway:192.168.40.1
subnet mask:255.255.255.0
V-box software configuration
1)V-box programming software
2)Configure device network
Click the Configuration Download button, It is used to configure the device network, update the device time, obtain the device machine code, check the device network, etc.
In the example below, the IP address of V-Box is configured as 192.168.40.66, and the networking method is 4G connection
3)V-net add device
Open VNET client software → add device. As shown in the figure below, click "+" in the order of steps, and the Add Device window will pop up, enter the device machine code/product code, device password, and device alias to add the device.
4)Set communication port parameters
In the device list on the left, find the Vbox that communicates with the L1769, click it and select configuration,communication port configuration in the main interface to add a communication protocol.
The communication port is selected as Ethernet, the device type is selected as Allen-Bradley, the protocol is Allen-BradleyMicro850_FreeTag EthemetIP, and the IP is the internal IP address of the L1769 PLC. The port number is 44818.
After adding the protocol Allen-BradleyMicro850_FreeTag, clickicon add label.
5)Engineering production
According to your own needs, use the V-NET client software to edit the required data monitoring points.
hardware connection
1)Hardware wiring diagram
This example introduces Wecon V-box with Allen-Bradley L1769 PLC to establish communication through Ethernet. The connection diagram is as follows:
The above are all the steps for establishing Ethernet communication between Wecon V-box with CompactLogix L1769 PLC.
Allen-Bradley Ethernet DF1
Siemens PLC
S7-200 Smart Ethernet Protocol
S7-1200 Ethernet Protocol
Mitsubishi PLC
Mitsubishi FX Series Protocol
Delta PLC
DVP Ethernet Protocol
DVP Serial Protocol
Omron PLC
CP1 Series Protocol
CJ2M Series Protocol
Modbus RTU
V-BOX as master
Select the protocol “Modbus RTU Slave(All Fuction)”,
then set BaudRate,Port,Stop Bit,Data Bit,Parity
V-BOX as slave
Select the protocol “Modbus RTU Master”,
then set BaudRate,Port,Stop Bit,Data Bit,Parity
Address List
Type | Register | 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) |
communicate with VB inverter
User define protocol
More serial port script instruction,please refer manual:Lua script function--->3.Serial port operation
Read the temperature sensor.
the commond format is as beliow:
Send commond:01 03 02 00 00 03 04 73
Feedback commond:01 03 06 07 F7 0E 7E B7 35
Temperature data:07 F7,desimal = 2039,it means temperature is 20.39℃.
Humidity data:0E 7E,desimal = 3710, it mean humidity is 37.10%RH.
Script Demo:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
function com.main()
--dosomething
openPlc()
end
function openPlc()
if obj then
-- If the serial port opened,then read/write data by timing
local wri = string.pack(">HHHH",0X0103,0X0200,0X0003,0X0473)
local arr = reading(wri)
-- if arr ~=nil then
-- if arr[1] ==33 and arr[2] ==v[2][2] and arr[3] ==v[2][3] then
-- local A = arr[4]*256
-- local B = A+arr[5]
-- addr_setword(v[1],B)
-- end
-- end
else
--judge if there is a serial object, then initialize and open the serial port
local configs = {
name = 'COM1', --Select serial port COM1
mode = 485, --Communication mode RS485
baud_rate = 9600, --Baud rate 9600
stop_bit = 1, --stop bit 1
data_len = 8, --data length 8
check_bit = 'NONE', --no parity
}
obj,err = serial.open(configs) --Open serial port
if not obj then
print("serial open :failed", err) -- Open serial port failed
end
end
end
function reading(wri)
obj:flush() -- Clear serial port
obj:write(wri) -- Write serial port
print(string.byte(wri,1,#wri))
obj:flush() -- Clear serial port
local readed =obj:read(9,1000) -- Read 9 bytes, timeout 1 second
if readed and readed ~= "" then
-- judge that a non-empty string is read
print(string.byte(readed,1,#readed))
a={string.byte(readed, 1, #readed)}
if nil ~= a[4] and nil ~= a[5] and nil ~= a[6] and nil ~= a[7] then
a1=a[4]*256+a[5]
a2=a[6]*256+a[7]
addr_setword("@HDW0",a1)
addr_setword("@HDW1",a2)
end
return {string.byte(readed, 1, #readed)}
elseif readed == nil then
print("serial read err:", err or "")
return nil
end
return nil
end
--------------------------------------------------------------------------------------------------------------------------------------------------------------------