Availability | All terminals | ||||||||||||||||||
Description | This function controls the power of the scan engine in the handheld terminal. The scan engine can be switched on continuously, switched on only when the user presses the trigger key, or switched off. The selected power mode remains active, even when a barcode is read and the scanner is switched off. The next trigger press will re-enable the scan engine. Call this function with OFF, to completely disable the scan engine. | ||||||||||||||||||
Syntax | void ScannerPower( int mode, int time ); | ||||||||||||||||||
Arguments |
int modemode can have one of the following values:
The following combinations are also supported
int timeThe time parameter specifies the time that the scan engine is on in steps of 20 milliseconds.Example: time = 100 specifies that the scan engine is on for 20*100 ms = 2 seconds. time = 0 is interpreted as zero time. The scan engine is not switched on in this case. |
||||||||||||||||||
Returns | None | ||||||||||||||||||
Remarks | The scan engine is the part of the terminal that emits the laser beam or LED light and that processes variations in reflected light. When the laser beam is visible or the LED is emitting, the scan engine is on; otherwise it is off. | ||||||||||||||||||
Example |
// This program reads and displays a barcode. After each successful barcode reading, // it gives a good read signal on the LED and a buzzer signal. #include <stdio.h> #include "lib.h" void main( void ) { char bcr_buf[42] = {0}; struct barcode code = {0}; code.min = 3; code.max = 41; code.text = bcr_buf; ScannerPower(SCAN_SINGLE, 100); // Single read, 2 seconds for(;;) { if(ReadBarcode(&code) == OK) { GoodReadLed(GREEN, 10); Sound( TSTANDARD, VHIGH, SMEDIUM, SHIGH, 0); printf("%*s\r", code.length, code.text); } Idle(); } } |