Chapter 6 Communication Mode
6 - 37
[EHV-CPU]
(2) Sample program description
The s parameter and the sending data area parameter are set upon the first scan.
M0 will be turned on at the 2nd scan, and initial setting for port 2 of slot 2, unit 3 will be performed.
When R100 is turned on, then the state of the coil for 16 bits are read from an address H0010 of the slave No.05.
Response data will be stored in WR200. Bit X3229 is a status flag of EH-SIO. When initial setting is completed,
this flag will be ON.
The contents of initial setting
TRNS 9 ( WY325 , WR0 , M0 )
WR7 = H0000 … Initial setting command
WR8 = 200 … Command timeout time
DR9 =ADR(WR100) … I/O address of sending data area
( WR100 )
DRB = ADR(WR200) … I/O address of receiving data area
( WR200 )
WRD = H0400 … Size of receiving data area
WR100 = H0006 … No. of send data (byte)
WR101 = H0010 … Communication mode
WR102 = H0000 … Modbus transmission mode
WR103 = 50 … Receiving timeout time
Sending data area
(Parameter for initial
setting)
R100 = 0
WR100 = H0006 … No. of send data (byte)
WR101 = H0501 … Device No,Function code
WR102 = H0010 … Starting address of coil
WR103 = 16 … The number of coils
WR7 = H0080 … Query send command
M0 = 1
Set query data.
Start TRNS 9 command.