Enable or Disable scanner using host triggered escape sequences or using script

Version 1

    You can enable or disable the barcode scanner using special escape sequences sent by the host application as part of your data stream. The host application can also trigger a script loaded in CETerm which can be used to enable or disable the scanner. The former technique works only for VT emulation and is provided for compatibility with legacy DOS TE devices. This allows users to easily upgrade from such devices to Windows CE devices running CETerm without making any changes to their VT host applications. The latter technique is recommended and is the only solution for IBM emulation sessions and Browser sessions.

     

    For VT emulation, the host application can send special escape sequences which are not part of the VT spec, but are proprietary to other legacy DOS based TE products. To process these escape sequences, you must configure the following in CETerm:

     

    • You *must* enable Symbol TNVT Extensions.
    • You *must* disable Symbol CE VT Extensions.

     

    The host application can then send the following escape sequences to enable / disable the scanner:

     

    \x1B%0Sto Disable or turn OFF the scanner
    \x1B%1Sto Enable or turn ON the scanner

     

    To trigger a CETerm script, the host application can send a special extended command as part of the data stream which will fire off an event. The event trigger requires two characters "#X" (without quotes) starting in the second column of the first row. When received for any of the IBM emulation sessions, CETerm fires the event OnIBMCommand. A script handler for this event can then disable or enable the scanner as required. The CETerm configuration option “Extended Commands” must be enabled for this event to fire.

    For VT emulations, the equivalent event is OnVTCommand. Please refer to the Scripting Guide for more details.

    function OnIBMCommand ( session, command ) 
    { // do some validation...  
    // Disable scanner 
    CETerm.PostIDA( "IDA_SCAN_DISABLE", session );  
    // Enable scanner 
    CETerm.PostIDA( "IDA_SCAN_ENABLE", session );  
    }