|
The following video link is an example of macro programming to control the output of the IO board via the MODBUS communication protocol:
https://www.youtube.com/watch?v=N1j3Mvmh4fo
This video demonstrates the IO board output status of the standard modbus RTU protocol controlled by macro programming.
The English version of this handheld controller is DM500, which is based on the DDCSV2.1 software architecture and supports the MODBUS RTU communication protocol.
It can communicate with modbus devices through macro programming. The currently supported read/write function codes are:
Read function code:01H 02H 03H 04H
Write function code: 0FH 10H
The modbus protocol configuration parameters, read and write data, and response status can all be set or read by macro variables.
Note: If the IO board is an RS232 interface, it can be directly connected to the handset box, without conversion.
Upload the full MODBUS full macro address instructions later.
Attachment: DAM0404.nc
O000
(Modbus RTU control output macro program)
G04 P0
#1200 = 1230 (Send data macroaddress)
#1201 = 0 (Communication serial port 0)
#1202 = 1 (Slave ID)
#1204 = 1 (Number of coils)
#1205 = 1 (MODE: RTU)
(OUT1-OUT4 Turn on in turn)
#2=0
WHILE [#2 NE 4] DO3
#1203 = #2 (Starting address)
#1230 = 1 (Output state data)
#1209 = 1 (Trigger sending)
WHILE [#1209 NE 0] DO4 (Waiting for response success)
G04P0
END4
#2 = #2+1
G04P0
END3
(OUT1-OUT4 Turn off in turn)
#2=0
WHILE [#2 NE 4] DO5
#1203 = #2
#1230 = 0
#1209 = 1
WHILE [#1209 NE 0] DO6
G04P0
END6
#2 = #2+1
G04P0
END5
M30
|
|