Intermec 5055 Reference Guide

Page of 216
im_command
5-7
5
im_command
Purpose:
This function sends reader and configuration commands to the 5055. For example, you
can use this function to set the contrast or change the baud rate on the 5055. For a list of
reader and configuration commands, see Chapter 6, “Reader Command Reference,” and
Chapter 7, “Configuration Command Reference.”
Syntax:
#include "im5055.h"
IM_STATUS im_command
    (IM_UCHAR far 
*command
,
    IM_USHORT
 length
)
;
IN Parameters:
command    Computer command string. The command string may include more than
one command.
length    Length of the computer command string.
OUT Parameters:
None.
Return Value:
This function returns one of these codes:
IM_SUCCESS    Successfully parsed and implemented command.
IM_PARSER_ERROR    Unable to parse command.
Notes:
If you are using ASCII escape sequences in your command string, the hex value for the
escape sequence only counts as one character when designating the command length.
For example, the following command string uses the ASCII escape sequence ETX (hex
value 0x03) and has a character length of 5:
im_command (“$+PF\x03”,5);
Example
To transmit DATA.TXT on the 5055’s drive C, the function would be:
im_command (“%%X1,C:DATA.TXT”,15);
To receive a file through the serial port, use a command string of the form,
.%X1,drive:filename. For example, to receive 
ITEMS.TXT
 on the 5055 and put the file
on drive C, the function would be:
im_command (“.%X1,C:ITEMS.TXT”,16);
To change the configuration, use a string of the form 
$+CCP
, where 
CC
 represents the
command, and P represents some string of parameters to the configuration command.
For example:
im_command(“$+IA8”,5); //Set Baud Rate to 38400
im_command(“$+PE\x02”,5); //Set SOM to ASCII STX character
im_command(“$+PF\x0d\x0a”,6); //Set EOM to Carriage Return, Line Feed