User Manual DEV 1953
Copyright DEV Systemtechnik GmbH 2015-2017
109
5.8.3
QEC Commands
The different commands for the communication with the device are described next.
5.8.3.1
Check Change Flag / Unit Status (C)
The command for reading the change flag is issued in the form
hexadecimal:
02 XX XX 43 03 XX
content:
<STX> <address> C <ETX> <checksum>
e.g. for a device with the device address 11 connected to the serial port
hexadecimal:
02 31 31 43 03 42
content:
<STX> <address=11> C <ETX> <checksum>
The change flag byte (
<Cflg>
) after "
C
" in the positive response informs whether
there are any changes in the change queue (please refer to chapter 5.8.3.2). The
C
command is supposed to be sent periodically to check if any changes have been
made or if any events have occurred. The change flag byte is defined as follows:
Hex:
0x80 (MSB) 0x40
0x20
0x10
0x08
0x04
0x02
0x01 (LSB)
Bit:
7
6
5
4
3
2
1
0
Content:
1
0
0
0
Overflow
0
Alarm
Change
The "Change" bit is set if there have occurred changes on the switching status of
the device, i.e. if the change queue is not empty. The "Alarm" bit is set if any (not
acknowledged) event is pending, and the "Overflow" bit is set if the change queue
is full and if an additional change has occurred before reading the change queue via
the
Q
command (chapter 5.8.3.2).
Note:
If the "Overflow" bit is set, all output ports of the device should be queried
regarding their switching state to maintain valid switching status data.
The change flag byte is cleared (i.e. set to 0x80) only if the queue is empty and
if there are no (not acknowledged) events.
The positive response to this command is
hexadecimal:
06 XX XX 43 8X 03 XX
content:
<ACK> <address> C <Cflg> <ETX> <checksum>
e.g. for a device with the device address 11 connected to the serial port with no
changes and no "Alarm" bit set
hexadecimal:
06 31 31 43 80 03 C6
content:
<ACK> <address=11> C 0x80 <ETX> <checksum>
and e.g. for the same device with changes and with the "Alarm" bit set returns
hexadecimal:
06 31 31 43 83 03 C5
content:
<ACK> <address=11> C 0x83 <ETX> <checksum>