The sample output from the above code has six comma-delimited entries per line (reading, channel,
reading, channel, reading, channel):
3.181298825e-002, 2001+, -5.602844334e-002, 2002+, -7.811298360e-002, 2003+
3.228547367e-002, 2001+, -5.299202901e-002, 2002+, -8.676257870e-002, 2003+
3.736769697e-002, 2001+, -3.247188344e-002, 2002+, -5.106155438e-002, 2003+
-6.473406636e-002, 2001+, -9.218081926e-002, 2002+, 3.419026595e-002, 2003+
-3.856921662e-002, 2001+, -6.672781529e-002, 2002+, -7.762540017e-002,
2003+
2.876431571e-002, 2001+, -4.056434134e-002, 2002+, -6.119288115e-002, 2003+
-7.301064720e-002, 2001+, 2.893913659e-002, 2002+, -3.164065858e-002, 2003+
-6.794576932e-002, 2001+, -8.067066262e-002, 2002+, 2.339088329e-002, 2003+
-5.288247880e-002, 2001+, -6.769966949e-002, 2002+, -7.572277347e-002,
2003+
2.618149827e-002, 2001+, -3.164126270e-002, 2002+, -6.306067024e-002, 2003+
If you want to see more information about the readings, add the appropriate buffer recall attribute to
the printbuffer line in the sample code. For example, to see the relative timestamp with each
reading, add mybuffer.relativetimestamps to the printbuffer command as follows:
printbuffer(x, y, mybuffer, mybuffer.channels, mybuffer.relativetimestamps)
In the output from this printbuffer command, nine comma-delimited entries appear on each
line. Each line will include the following entries: Reading, channel, relative timestamp, reading,
channel, relative timestamp, reading, channel, relative timestamp.
Exceeding reading buffer capacity
If the reading buffer count is not exceeded, readings are stored as expected. But if new readings
would exceed reading buffer capacity when they are added to the current buffer index, the count is
lowered to a new count so it does not exceed the buffer capacity. Once the buffer is full (to the new
count), no more readings are taken and error code 4915, "Attempting to store past capacity of reading
buffer," is displayed. If you attempt to store additional readings in a full buffer, the same message
appears, and no readings are taken.
Example
Create a buffer with:
• A capacity for 50 readings
• Append mode enabled
• Measure count to 30
Tell the instrument to print the current number of buffer elements stored and take readings to store in
the buffer. The following occurs:
1. The first time the measurement is called, the buffer is empty (no readings), so it stores 30
readings.
2. The second time the measurement is called it stores only 20 readings. This is because 30 + 30 is
60 readings, which exceeds buffer capacity (50). Because 30 readings are already stored, only
20 readings are taken and stored. Error code 4915, "Attempting to store past capacity of reading
buffer," is displayed.
3. The third time the measurement is called, the buffer is full (already has 50 readings). Because
there is no more room, no readings are taken (nil response for reading) and error code 4915,
"Attempting to store past capacity of reading buffer," is again displayed.