Unitech PA500 manual Special Command for control, Control command for decoder chip

Page 16

3. Control command for decoder chip

Important: This chapter describes low level command for scanner control function. If you already USI to do scanner programming, you don’t need to care about this chapter. In general, it is not suggested to use level command to control scanner, because there are timing issue on serial communication programming , and it is always need communication expert to do that and it is hard to explain it on document.

When Host prepare to send a command to hamster, it must first check CTS, if CTS is high, then Host must set the RTS to high then clear RTS to low to wake up the Hamster.

Special Command for control

command

Format

Comment

Control

Esc,80H+SOH(01H)

Let Hamster enter slaving status. At this status Hamster just

 

 

receives commands and executes it until it receives Release

 

 

command or timeout (about 10s). Otherwise, the timeout is

 

 

about 1s as the interval of commands.

Release

Esc,80H+EOT(04H)

Let Hamster exit from slaving status.

Execute/

Esc,80H+ENQ(05H)

Let Hamster execute the previous saved command and check

Enquiry

 

hamster if there is a result of previous executed command to

 

 

send to Host. If previous saved command have already

 

 

executed and no result to send, hamster do not reply until

 

 

there is a result. If Host receive a result but the BCC is wrong,

 

 

it can re-send ENQ to re-send result again.

ACK

Esc,80H+ACK(06H)

It is from Hamster to Host. If Hamster receive a command and

 

 

this command do not need send message back, Hamster reply

 

 

the ACK.

NAK

Esc,80H+NAK(15H)

It is from Hamster to Host. Hamster require the Host to re-send

 

 

command again, normally when received a wrong BCC, it can

 

 

send the NAK. The Hamster sends back NAK whenever it

 

 

receives a no sense command.

COMMAND FROM HOST TO HMASTER

Command format:Esc,Lh,Ll,n,m,S1,...,Si,BCC Here: Esc is Escape code(H'1B)

Lh/Ll is command's length when the Lh.b7 is 0, Lh is high byte, Ll is low byte, count from n to BCC. When Lh.b7=1 it is a two bytes special command.

n is command ID

m is operation: Normally for setting commands the 0 means setting, 1 default, 2 read current setting, 3 special operation. When m=1 or 2, the S1 should be 0 for bits or one character setting. If the setting is a string, like pre_amble, the read or default command should not contain any Si byte. The special meaning in a command please refers the command definition.

Si is setting/read data.

BCC: it equals to XOR of all the bytes before the BCC.

Conventions: S1.bj means the number j bit of byte S1.

The expression 1~64:2 means that the number is between 1 and 64, the default is 2.

Notice: Any interval in a command transmit can not exceed 1 second.

Command

Format

Comment

Initial/ Warm

Esc,0,2,0,BCC

Hamster initializes the ports and flags according to the setting

start

 

in RAM.

Default

Esc,0,2,1,BCC

Reset setting in RAM and initialize

Mpu_idle

Esc,0,4,2,m,S1,BCC

S1 is 0~3:0 is sleep mode,1 is watch mode,

-

Image 16
Contents PA500 Programming Manual Automatically enable scanner beam with pressing trigger key USI.DLL Unitech Scanner Interface DLLSCANKEY3.DLL Backward Compatible API for PT930/PT930S’S GET Device ID Update Notes Introduction How to download data from scanner COM definition for PA500 Function call Parameter inputEnable / Disable Scanner Reset ScannerGet error code Returns the system error codeFunction Description Get scan dataParameter output Get Symbology name Get length of scanned dataGood read indicator Wait for acknowledgement of the last sent commandSave setting to profiles Clear scan data system bufferSave scanner setting into specified file Change scanner setting from specified setting profileAutomatically enable scanner beam with pressing trigger key Parameter output Return Check if auto scanning is enable Test if Scan2Key is enabled Stop auto scanning function Check if Scan2Key.exe program is running or notEnable/Disable Scan2Key Send scanner command to decoding chipOnly send single command decoding chip Esc, 0x80+cmd Function callSend command to decoding chip Esc, parameter1, parameter2, …, BCCSpecial Command for control Control command for decoder chipEnable in Communication TRACK1,5 TRACK2,6 TRACK3 Code32setCodabarset LabelcodeUpcaset UpcesetUPC a Disable Decoder PTEnableBarcode Function callCheck barcode input Return codeRead barcode data Reset all symbologies to defaultGet DLL version no Disable laser trigger key Enable laser trigger keyPTEnableBarToKey Function call for VC INT PTVersionvoid Return IntegerSysIOAPI.DLL Keypad Related FunctionsReturn code Bool True Caps lock False Caps unlock Return code True Shift lock False Shift unlockScanner Related Functions ParameterInputLED related function ExampleLCD/Backlight related function ParametersInputDynamic Load DLL Get Device ID Update notes
Related manuals
Manual 84 pages 14.34 Kb