App 2-3
IM CW120-E
Communication Commands
App
Appendix 2. Communication Commands
<Response header>
It is possible to program the CW120 so a
response header precedes the response data.
Response data is separated from the header by
a space.
<Response data>
Response data contains the contents of the
response. If there are multiple data, they are
separated by a comma (,).
If a program message contains multiple
queries, the responses are made in the same
order as the queries. For most queries, the
CW120 returns only one response message
unit. The CW120 returns more than one
response message unit to some queries,
however. The first query is always answered
with the first response message unit. However,
the nth query does not always agree with the
nth response message unit. To be certain that
the given response message unit corresponds
to the correct query, place one query in each
program message.
Precautions when Exchanging Messages
• You can send the next message at any time,
if the previously sent message did not contain
any queries.
• If the previous program message contained a
query, you cannot send the next message
until the entire response message is
received. If you send the next program
message before any response message is
received or after only part of a message is
received, an error will occur. The response
message that was not received at all or
completely will be discarded.
• If the personal computer tries to receive a
response message when there is none, an
error will occur. An error also occurs if the
personal computer tries to receive a
response message before it finishes sending
the program message.
• If a program message contains multiple units
and some of the units are incomplete, the
CW120 will pick up the incomplete units and
attempt to execute them. These attempts
may not always be successful, however. In
addition, even if the program message
contained queries, they may not always be
responded to.
Deadlock
The CW120 has receive and send buffers for
storing program and response messages.
Each buffer has a capacity of at least 1024
bytes. (The number of bytes available will vary
depending on the operating condition of the
CW120.) If both buffers become full at the
same time, the CW120 becomes inoperative.
This condition is called a deadlock. To resume
normal operation, discard response messages.
A deadlock will not occur, however, if the size of
the program message including the PMT is kept
below 1024 bytes. A deadlock never occurs if
the program message does not contain any
query.