User`s guide
XBee Digital I/O Adapter
37
Data retrieval
To retrieve measurement data from the XBee Digital I/O Adapter, use these
Python modules, provided in the XBee Adapter Libraries:
• xbeedin.py: Issues the AT IS command to retrieve the data.
• sensor_io.py: Decodes the output of the AT IS command.
To enable a terminal line for measurement, the following digital I/O lines
have to be set to value 3:
•D8
•D1
•D2
•D3
D8, D1, D2, and D3 represent terminal lines 1, 2, 3, and 4 respectively. To
disable a terminal line, set the respective digital I/O line to value 0.
Following is a description of the data returned by the IS command.
Byte structure returned by IS command
The AT IS (Force Sample) command is used to force a read of all enabled
digital I/O lines. The command returns a byte structure that identifies which
lines are enabled for digital or analog sampling, and the current
measurement.
Number of samples
This represents the number of samples that make up the measurement.
This number is most commonly set to 1.
Byte size Purpose
1 The number of samples in this message.
2 Bit mask of which digital I/O lines are enabled for this sample.
1 Bit mask of which analog I/O lines are enabled for this sample.
2 Digital sample, present only if any digital I/O lines are enabled.
2 * N Analog sample; N is the number of analog I/O lines enabled.