1 Communication

Version 53.1 by Ben on 2022/08/24 11:35

WECON PLC

LX3V 串行通信

Supported series: WECON LX2V/ LX2E/ LX3V/LX3VP/LX3VE/LX3VM

HMI Settings

ItemSettingsNote
ProtocolWECON LX2V/ LX2E/ LX3V/LX3VP/LX3VE/LX3VM 
ConnectionRS422/RS485 
Baud rate9600 
Data bit7 
ParityEVEN 
Stop bit1 
PLC station No.1 

Address List

TypeDevice registersHMI registersFormatRangeNote
BitXXXo0~303237 
YYY o0~303237 
MMM d0~99999 
TTT d0~99999 
CCC d0~99999 
SSS d0~99999 
WordXXXo0~303237 
YYY o0~303237 
MMM d0~99999 
TTT d0~99999 
CCC d0~199 
DDD d0~7999 
SSS d0~99999 
SDSDSD d8000~9999 

Cable Wiring

  • RS485

                                                                                 image-20220822172124-1.png

  • RS422

                                                                                 image-20220822172228-2.png

✎Note:

  • HMI COM3 is available in PI8000 series and COM3 is in COM2(hardware PIN 7 and PIN 8) .
  • If PLC <= 20 points,such as LX3V-1208/LX3V-0806 PLC,PLC RS485A and RS485B mean PLC COM2 RS485+ and RS485- .PLC COM2 can support modbus. Please refer to PLC COM2 setting manual.

https://drive.google.com/drive/folders/13rgso7oUlatZQN_SNEcJCcN4toEdDPoP?usp=sharing

LX5V serial communication

This example introduces the establishment of serial port communication between Wecon V-BOX and LX5V. It is introduced through three parts: PLC software configuration, HMI software configuration, and hardware wiring.

Software configuration of PLC

1)PLC programming software

image-20220822172553-1.png

2)New PLC project

Click New Project and select the PLC model.

image-20220822172623-2.png

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

image-20220822172657-3.png

4)Registers list

image-20220822172730-4.png

V-BOX software configuration

1)V-BOX programming software

 image-20220824104124-1.png

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.

image-20220824104909-2.png

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

image-20220811104012-1.png

hardware connection

1)Hardware wiring diagram

This example introduces WeconHMI with LX5V PLC to establish communication through serial port. The connection diagram is as follows:

image-20220811103005-4.png

image-20220811103227-7.png

The above are all the steps for establishing serial port communication between Wecon HMI with LX5V PLC.

LX5V-N Ethernet communication

 This example introduces the establishment of Ethernet communication between Wecon HMI and LX5V. It is introduced through three parts: PLC software configuration, HMI software configuration, and hardware wiring.

Software configuration of PLC

1)PLC programming software

image-20220810164710-1.png

2)New PLC project

Click New Project and select the PLC model.

image-20220811115454-1.png

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

image-20220811140530-2.png

4)Registers list

image-20220811102219-3.png

HMI software configuration

1)HMI programming software

 image-20220810171237-4.png

2)New HMI project

Click New Project and select the HMI model.

image-20220810172010-5.png

3)Set communication port parameters

Click the project setting button on the left to configure the IP address of the HMI machine to ensure that the HMI and PLC IP remain in a local area network.

HMI IP address:192.168.39.201

default gateway:192.168.39.1

subnet mask:255.255.255.0

image-20220811170753-2.png

Next, click Communication Settings to configure the IP of the HMI communication object.

image-20220811163047-1.png

hardware connection

1)Hardware wiring diagram

This example introduces WeconHMI with LX5V-N PLC to establish communication through ethernet. The connection diagram is as follows:

image-20220811170248-1.png

The above are all the steps for establishing ethernet communication between Wecon HMI with LX5V PLC.

1624348978863-771.png

Rockwell PLC

MicroLogix

MicroLogix 1000/1100/1200/1400/1500; SLC 5/03 5/04 5/05 PLC-5

HMI Settings

ItemSettingsNote
ProtocolAllen-Bradlley MicroLogix 
ConnectionRS232 
Baud rate19200 
Data bit8 
ParityNone 
Stop bit1 
PLC station No.1 

Address List

TypeDevice registersFormatRangeNote
BitII d.d0.0~255.15 
OO d.d0.0~255.15 
BB nnhh.dd0.0~ffff.15nn: block number (hex)
SS d.d0.0~255.15 
NN nnhh.dd0.0~ffff.15nn: block number (hex)
WordSS d0~255 
TSTS nnhh0~ffffnn: block number (hex)
TPTP nnhh0~ffff
CSCS nnhh0~ffff
CPCP nnhh0~ffff
NN nnhh0~ffff
CC nnhh0~ffff
TT nnhh0~ffff
RR nnhh0~ffff

Cable Wiring

image-20220824110724-1.png

CompactLogix

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

image-20220714162600-1.png

2)New PLC project

Click New Project and select the PLC model.

image-20220714162617-2.png

 

image-20220714162652-4.png

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

image-20220714162713-5.png

 

V-box software configuration

1)V-box programming software

 image-20220714162725-6.png

2)Configure device network

Click the Configuration Download buttonimage-20220714115308-8.png, 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 

image-20220714162737-7.png

 

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.   image-20220714162752-8.png

 

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. 

image-20220714162805-9.png

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.

image-20220714162814-10.png

After adding the protocol Allen-BradleyMicro850_FreeTag, clickimage-20220714143838-2.pngicon add label.image-20220714162827-11.png

5)Engineering production

According to your own needs, use the V-NET client software to edit the required data monitoring points.

image-20220714162841-12.png

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:

image-20220714162856-13.png

The above are all the steps for establishing Ethernet communication between Wecon V-box with CompactLogix L1769 PLC.

Allen-Bradley Ethernet DF1

download link

Siemens PLC

Siemens S7-1200

download link

Communication with S7-200 Smart

download link

Delta PLC

Delta DVP Ethernet

download link

Delta DVP Serial Protocol

download link

Mitsubishi PLC

Communicate with Mitsubishi FX Series

download link

Omron PLC

Omron CP1 Series

download link

Omron CJ2M

download link

Modbus RTU

V-BOX as master

Select the protocol “Modbus RTU Slave(All Fuction)”,

then set BaudRate,Port,Stop Bit,Data Bit,Parity

1624342015914-382.png

V-BOX as slave

Select the protocol “Modbus RTU Master”,

then set BaudRate,Port,Stop Bit,Data Bit,Parity

1624348709622-711.png

Address List

TypeRegisterFunction 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)

Communicate with VB inverter

download link

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

--------------------------------------------------------------------------------------------------------------------------------------------------------------------