
- 21 -
6.4.Command
ZS-6822 recognizes and controls the first byte of data as a control command. Be sure to add a
delimiter(CR+LF) to the end of the data string and transmit. If there is a character string
other than the command at the end of the data, NG will be sent as return value.
Command
Function
R
Data is read from all ports as input.
W
Data is written to the port set as output.
T
Pulse is output from the TRG signal.
C
Pulse is output from the CLR signal.
D
Configure port I/O setting.
P
Set the pulse width of the control signal.
L
Set the presence/absence of latch circuit.
U
Set the output signal.
B
Execute positive/negative logic.
6.4.1. R command
Function
Data is read from all ports set as input. For example, if the number of input ports is
set to 4, 8bytes of data will be sent from ZS-6822 when “R” command is executed.
Format
R
CR LF
Return value
xxxx
・・・・
CR LF
:
Data as same as the number set for the input port will be sent.
“x” is an ASCII code from 0 to F.
NG
CR LF
:
There is no input port.
6.4.2. W command
Function
Data is written to the port set as output. For example, if the number of output ports
are set to 4, 8byte data is added after “W” command and it is sent to ZS-6822. If data
is transmitted less than 8 bytes, the data will be newly changed for the transmitted
data and the previous data will be remained in the space. If more than 8 bytes are
transmitted, it will be discarded.
Format
Wxxxx
・・・・
CR LF
:
Write output data to the output port after “W”.
“x” is ASCII code from 0 to F.
Return value
OK
CR LF
:
Data output is completed to the output port.
NG
CR LF
:
No output port, data character error.