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.
Summary of Contents for OMB-CHARTSCAN 1400
Page 1: ...August 2002 OMB CHARTSCAN 1400 Portable Data Recorder p n OMB 483 0901 Rev 3 1...
Page 6: ...iv ChartScan User s Manual...
Page 24: ...ChartScan User s Manual...
Page 32: ...2 8 General Information ChartScan User s Manual Notes...
Page 56: ...3 24 ChartScan User s Manual Notes...
Page 124: ...6 20 Calibration ChartScan User s Manual...
Page 126: ...A ii ChartScan User s Manual...
Page 136: ...API Commands Appendix A A 10 ChartScan User s Manual Notes...
Page 176: ...API Commands Appendix A A 50 ChartScan User s Manual...
Page 230: ...Appendix C Registers Data Formats Queries ChartScan User s Manual C 13...
Page 237: ...Registers Data Formats Queries Appendix C C 20 ChartScan User s Manual Notes...
Page 257: ...E 2 ChartScan User s Manual Notes...
Page 265: ...ASCII Code Summary Appendix F F 8 ChartScan User s Manual Notes...
Page 269: ...Abbreviations Appendix H H 2 ChartScan User s Manual Notes...
Page 271: ...ChartScan User s Manual...