User's Manual

QTI Page 13 of 15 Revision: D
Form #: 30Z0250 Effective Date: 1 August 2010
VER… Get the unit version.
MCDT is the model, <space>, VVVV is the firmware version (Major.Minor.Build.Rev),
<space>, M is the message types supported (0 = standard [MIDS/EMIDS], 1 = custom), B is
the frequency band (0 = low, 1 = mid, 2 = high), H is the hardware capabilities (1 = receive
only, 2 = transmit only, 3 = both), R is the hardware board revision.
Get version: VER<CR>
Returns: MCDT VVVV MBHR<CR>
Checksum
To use checksum begin the command with “#” plus the unit serial ID and end the command with the
calculated checksum (cs) value followed by the carriage return <CR>. A command with an invalid
checksum or invalid serial ID is ignored and no reply is sent. The checksum is a 2 digit hexadecimal
calculated as the 2’s compliment of the sum of the command string including the “#” and serial ID.
Using the checksum also allows and requires using the serial ID. The universal serial ID is X, so all
units will acknowledge these commands. The unit will respond with its specific serial ID.
Sample syntax:
Action With Checksum Without Checksum
Get receive channel: #XCHRA8<CR> CHR<CR>
Returns: #ACHR 196FF<CR> CHR 196<CR>
Set transmit channel to 2: #XCHT 254<CR> CHT 2<CR>
Returns: #ACHT 2 OKB1<CR> CHT 2<CR>
Note: “A” is just a sample serial ID, and may be different.
Example checksum calculator
char CRC2sComp( char *buffr, int end) { //creates 2's complement
int c;
int calcSum = 0;
for( c = 0; c <= end; c ++ )
{ calcSum += buffr[c]; }
calcSum ^= 0xFF; //1's complement
calcSum += 1; //now 2's complement
return (char)(calcSum);
}
Example:
Line to send is “#ACHR 597<CR>”
Convert characters to ASCII values:
# (35) + A (65) + C (67) + H (72) + R (82) + <sp> (32) + 5 (53) + 9 (57) + 7 (55)
NOTE: <CR> is not included in calculation.
Sum: 35+65+67+72+82+32+53+57+55 = 518T (206h)
1’s Complement is bit inversion: = [10 0000 0110] [01 1111 1001] = 1F9h
2’s complement is adding 1 to the 1’s complement: 1F9 + 1 = 1FAh
Drop anything higher than the lowest 8 bits: [1 1111 1010] [1111 1010] = FAh
The result is FAh, so send line as “#ACHR 597FA<CR>”
Note: Adding the checksum will result in zero for the low byte. (206h + FAh = 300h)