Buffer overrun – Measurement Computing TempScan/1100 User Manual
Page 101

TempScan / MultiScan User's Manual
889897
System Operation 5-11
Before all of the scan data is read, the Buffer Status String response indicates that the total number of Trigger Blocks
available in the buffer is 5, and the total number of scans available in the buffer is 18860 (20215-1355). Furthermore, it
shows that the current location of the Read Pointer is at Pre-Trigger scan -100 in the first Trigger Block. All of the scan
data can be retrieved as follows:
•
Line 4: Get all of the scan data in the Acquisition Buffer.
•
Line 5: Get the response.
•
Line 6: The screen will show all 18860 scans of data for each of the four (4) configured channels.
•
Line 7: Now, get the current status of the Acquisition Buffer.
•
Line 8: Get the response.
•
Line 9: The screen will show the new current status of the Acquisition Buffer.
Notice that after all of the scan data is read, the Acquisition Buffer is now complete empty.
Read (R3) Buffer Operation – Multiple Trigger Blocks, Part 4 (of 4)
Buffer Overrun
The TempScan/1100 or MultiScan/1200 Acquisition Buffer will wrap around on itself if the controlling
computer cannot read the data out fast enough before the buffer gets completely full. This situation is
called buffer overrun (as opposed to a Trigger overrun). Although this situation prevents new data from
being lost and keeps the scan rate consistent, it also overwrites the oldest data.
A buffer overrun is registered as an error. However, in some applications, a buffer overrun may be a part of
normal operation. For example, if a TempScan/1100 with 256 Kbytes of memory was configured to scan
16 channels at a one minute interval, the buffer would get completely full and an overrun would occur in
about 5.6 days. Regardless of how long the TempScan/1100 is left unattended after that point, it will
always maintain the newest 5.6 days of scan data.
There are two cases of buffer overrun as follows:
• When the Acquisition Buffer contains a single Trigger Block.
• When the Acquisition Buffer contains multiple Trigger Blocks.
If a buffer overrun occurs, it may be detected by querying the Status Byte Register (
STB
) via either of the
following commands:
•
SPOLL:
Serial Poll command. For IEEE 488 interfaces only.
PRINT#1, “SPOLL 07"
INPUT #2, S%
IF (S% and 128 = 128) THEN
PRINT “Buffer Overrun Occurred”
ENDIF
•
U1:
User Status (
U1
) command. For both IEEE 488 and RS-232/RS-422 interfaces.
PRINT#1, “OUTPUT07; U1X”
PRINT#1, “ENTER07"
INPUT #2, S%
IF (S% and 128 = 128) THEN
PRINT “Buffer Overrun Occurred”
ENDIF
Buffer Overrun With One Trigger Block
When only one Trigger Block is in the Acquisition Buffer, a buffer overrun will erase the entire Pre-Trigger
area. If Pre-Trigger scans were being read when the buffer overrun occurred, the Trigger scan will be the
next scan read from the buffer.
However, if no Pre-Trigger scans were configured or the Pre-Trigger has already been read, a buffer
overrun will only erase the oldest Post-Trigger scan in the buffer. If the scan being erased is currently
being read, the contents of the read scan will be in error.
If the controller detects a buffer overrun condition during a read operation, any further reading will be
considered corrupt until a buffer reset is issued. This buffer reset can be done via the Flush Acquisition
Buffer (
*B
) command or reading the remaining data out of the buffer until it is clear.