Omega Vehicle Security OMB-CHARTSCAN 1400 User Manual

Page of 273
ChartScan Program Examples                                                                                                                                       
        Appendix D
D-6
ChartScan User’s Manual
Using the event status register command “
UOX
”, we now wait until  the  acquisition complete event which
includes the stop event.
WHILE (U% AND 1) <> 1
PRINT #1, “OUTPUT 07;U0X”
PRINT #1, “ENTER 07"
INPUT #2, U%
WEND
PRINT “The Acquisition is now complete”
During or after the acquisition has been completed, the internal buffer can be queried for the amount of data
available for transfer.  The 
U6
 command will return the trigger block number, the current scan number, the
current read pointer, the trigger time/date stamp, the scan number where the stop event occurred, the stop
time/date stamp, the scan number of the end of the trigger block, and the block complete flag.
This example uses the last parameter in the return string as an indicator of how much data is available to
transfer to the controller.  QuickBASIC’s  
MID$ 
function extracts 6 characters from the string
 U$
 starting at
character 
8
.
   
PRINT #1, “OUTPUT 07;U6X” ‘Ask for trigger block info
PRINT #1, “ENTER 07"
LINE INPUT #2, U$
PRINT U$
UA$ = MID$(U$, 8, 6)
UA% = VAL(UA$)
PRINT UA%
PRINT #1, “The ChartScan collected ”; UA%; “ scans of data”
The R1 command is used to request one scan from the unit.  Using the variable 
UA%
 calculated from the
previous step, all of the data is transferred to the controller.
FOR i = 1 TO UA%
PRINT #1, “OUTPUT 07;R1X”
PRINT #1, “ENTER 14"
INPUT #2, SCAN$
PRINT “Scan ”; i; “ is :”
PRINT SCAN$
NEXT I
Operating Alarms using ALARM2.BAS
The following program, ALARM2.BAS, in the EXAMPLES directory will set up the alarm system of the
ChartScan.
Although not necessary, it is good practice to reset the ChartScan at the beginning of your application by
sending it the “*R” command then waiting a few seconds.
CLS : PRINT “The ChartScan is resetting..”
PRINT #1, “OUTPUT 07;*RX”
SLEEP 10
To be certain that the reset was successful and the device is ready, serial poll the device until the proper
status is returned.
S% = 0
WHILE (S% AND 4) = 0
PRINT #1, “SPOLL 07"
INPUT #2, S%
WEND
The C command is used to configure multiple channels as part of the scan group and to assign them a type.
Additionally, the alarm parameters are used to activate the alarms for those channels.