- 20 -
5.4. Command chart
ZS-6222 recognizes the first byte of the data as a control command and control it.
It is necessary to add a delimiter (CRMLF) at the end of the data string and transmit.
If there is a character string other than the command at the beginning of the data, HG will be
sent as returned value.
Command
Function
R
Data is read from all ports set 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 settings.
P
Set the pulse width of the control signal.
L
Set the presence/absence of latch circuit.
5.4.1. R command
Function
Data is read from all ports set as input.
e.g) If input port is set four ports, 8 bytes of data will be sent from ZS-6222 when
“R” command is used.
Format
R
CR LF
Return value
xxxx
・・・・
CR LF
:
Amount of data as same as the number set for the input port will
be received.
X is an ASCII code from 0 to F.
HG
CR LF
:
There is no input port.
5.4.2. W command
Function
Write data to the port set as output and it is sent to ZS-6222.
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 empty space. If more
than 8 bytes of data are transmitted, it will be discarded.
Format
Wxxxx
・・・・
CR LF
:
Write output data to the output port after “W”.
x is an ASCII code from 0 to F.
Return value
OK
CR LF
:
Data output complete to output port.
HG
CR LF
:
Ho output port, data character error.