C Language Development Kit/Functions/ScannerPower
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/Scannerpower)
| Description | This function controls the power of the scan-engine of 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 laser 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 | mode can have one of the following values:
int mode
time specifies the time that the scan-engine is on in steps of 20 milliseconds.
int timeExample: time = 100 specifies that the scan-engine is on for 20*100 ms = 2 seconds. The DWT7133 interprets time = 0 as infinite time. The other devices interpret time = 0 as zero time. The scan engine is not switched on. | ||||||||||||
| 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, else it is off. | ||||||||||||
| Example | // The following example shows how to implement 'continuous read' mode. #include "lib.h" #include <stdio.h> void main( void ) { char bcr_buf[42]; struct barcode code; code.min = 1; code.max = 41; code.text = bcr_buf; gotoxy( 0, 0); cursor( BLINKING ); for(;;) { if( !scanneroff()) { resetkey(); if( readbarcode( ) == OK ) { goodreadled( GREEN, 10); sound( TSTANDARD, VHIGH, SMEDIUM, SHIGH, 0); scannerpower( ON, 250); gotoxy( 0, 0); printf("%s", code.text); } } else scannerpower( ON, 250); } } |
