Omega Vehicle Security 1500 Manual Do Utilizador

Página de 256
Configuration Aspects for Programmers
Appendix C
C-24
NetScan User’s Manual
 
Reading the Acquisition Buffer
 
The three previous sections briefly discussed how the acquisition buffer may be accessed and read.  In this
section the methods by which the acquisition buffer is read will be discussed in more detail.
 
 
As mentioned earlier, the Acquisition Buffer is organized as a FIFO (First In, First Out).  As such all data read
from the Acquisition Buffer will be the oldest available data.  Furthermore, once the data has been read from the
buffer it is no longer available.  Upon completion of a read operation, the data associated with the read operation
will be deleted.
 
 
The Read Acquisition Buffer (
R
) command is the command by which Acquisition Buffer data is read.  You can
use this command to read anywhere from one scan to all the scan data currently residing in the buffer.  This
command has the following valid forms:
 
 
R1
Read the oldest scan available.
 
R2
Read the oldest trigger block available.
 
R3
Read all available scan data.
 
 
When an 
R
 command is issued, the NetScan unit checks to see if the request can be fulfilled.  If s, the requested
scan data is moved from the Acquisition Buffer to the Output Queue where it waits until the controller initiates
transfer.
 
 
Note:
The request may will not be fulfilled if either (1) no channels are configured, or (2) the
amount of scan data requested is not available.  If either of these is true a Conflict Error will
be posted.  The 
R1
 and
 R3
 commands require that at least one scan be available and the 
R2
command requires that at least one complete trigger block be available.
 
 
The Scan Available bit in the Status Byte (STB) Register can be used to determine whether or not the
Acquisition Buffer is empty.  This bit is set when at least one scan is available in the buffer.  The Buffer Status
String (
U6
) command may also be used to retrieve more detailed information about the state of the Acquisition
Buffer.
 
 
The following are simple examples to illustrate the uses and effects of all three 
R
 command types.
 
 
Note: 
Although not mentioned prior to these examples, the responses to all queries (
U6, R1, R2
,
etc.) can be configured with specific field separators and response terminators.  For detailed
instructions on setting query terminators, refer to the 
Q
 command description in Appendix D.
 
 
The 
R1
 command will read the oldest scan in the oldest trigger block.  For instance:
 
 
PRINT#1,"U6X"
 
‘ Request the current status of the  Acquisition Buffer
 
LINE INPUT#1, A$
‘ Retrieve it.
 
PRINT A$
‘ Screen shows...
 
0000006,0020216,-00000100,12:51:43.100,03/24/97,00000100,01:53:01.300,03/24/97,00000250,01
 
The above response indicates that there are 6 trigger blocks currently defined in the Acquisition Buffer and there
are 20216 total scans in the buffer.  Furthermore, it shows that the current read pointer is at scan # -100 in the
1st trigger block.  To retrieve that scan perform the following:
 
 
PRINT#1,"R1X"
‘ Request the oldest scan
 
LINE INPUT#1, A$
‘ Retrieve it.
 
PRINT A$
 
‘ Screen shows (4 channels are configured)...
 
+0234.20-0019.40+0001.40+0023.60
 
PRINT#1,"U6X"
‘ Request the current status of the Acquisition Buffer
 
LINE INPUT#1, A$
‘ Retrieve it.
 
PRINT A$
‘ Screen shows...
 
0000006,0020215,-00000099,12:51:43.100,03/24/97,00000100,01:53:01.300,03/24/97,00000250,01
 
 
Notice that after reading the scan there are now 20,215 scans in the buffer and the current read pointer is now at
scan # -99.