User manual

Copyright © 2011, Unitech America Inc. All rights reserved.
Page 12 of 61
MS246 User Manual
7. Command Process
Command requests and responses are sent to and received from the device. For USB
interface devices, the commands are sent to the device using HID class specific request
Set_Report (21 09 …). The response to a command is retrieved from the device using
HID class specific request Get_Report (A1 01 …). These requests are sent over the
default control pipe. For RS232 interface devices, please see the commands listed below.
Function ID Table:
The complete table of Function ID used in command/response are listed in Appendix A.
Setting Command:
The setting data command is a collection of many function setting blocks and its
format is as follows.
Command:
<STX><S><FuncSETBLOCK1>…<FuncBLOCKn><ETX><LRC>
Response: <ACK> or <NAK> for wrong command (invalid funcID, length and
value)
Each function-setting block <FuncSETBLOCK> has following format:
<FuncID><Len><FuncData>
Where:
<FuncID> is one byte identifying the setting(s) for the function.
<Len> is the length count for the following function-setting block <FuncData>.
<FuncData> is the current setting for this function. It has the same format as in
the sending command for this function.
Get Setting Command:
This command will send current setting to application.
Command: <STX> <R> <FuncID> <ETX> <LRC 1>
Response: <ACK> <STX> <FuncID> <Len> <FuncData> <ETX> <LRC 2>
<FuncID>, <Len> and <FuncData> definition are the same as described above.
Where:
Characters
Description
<STX>
Start of Text
<ETX>
End of Text
<ACK>
Acknowledge
<NAK>
Negative Acknowledge