cmdA2D_RDIndex

Command Code:

The Packet:

Description:

This command retrieves data from an A2D input.  An A2D input ID that is out of range will generate an error message.

If the HOST bit is set, the BrainStem will send a reply packet to the host. host .  The cmdDEV_VAL reply packet contains the A2D device ID in the first data byte and contains the analog conversion result in the remaining 2 bytes.  The A2D converter in the BrainStem has 10-bit resolution.  It converts the voltage at the input to a two-byte value.  The first byte of the result contains the 8 most significant bits of the reading.  The 2 most significant bits of the second byte of the result contain the 2 least significant bits of the reading.  Only the first byte is used by reflexes.  If the RFLX bit is set, the value will go directly to a reflex routine within the BrainStem.  The HOST bit and the RFLX bit may be set at the same time.

The following table shows Console commands and sample replies when requesting A2D input from a BrainStem with an address of 2. (The Console program automatically inserts a size byte into the command packet and extracts the size byte from the reply packet.)

A2D Channel Device ID Console Input Sample Reply
0 0 (0x00) 2 25 128 02:04,00,9F,B0
1 1 (0x01) 2 25 129 02:04,01,9F,B0
2 2 (0x02) 2 25 130 02:04,02,9F,B0
3 3 (0x03) 2 25 131 02:04,03,9F,B0
4 4 (0x04) 2 25 132 02:04,04,9F,B0

version: 1.0, build 80903
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado.  All rights reserved.