14: TSP command reference 2470 High Voltage SourceMeter Instrument
14-14 2470-901-01 Rev. A / May 2019
buffer.save()
This function saves data from the specified reading buffer to a USB flash drive.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
buffer.save(bufferVar, "fileName")
buffer.save(bufferVar, "fileName", timeFormat)
buffer.save(bufferVar, "fileName", timeFormat, start, end)
The name of the reading buffer, which may be a default buffer (defbuffer1 or
defbuffer2
) or a user-defined buffer
A string that indicates the name of the file on the USB flash drive in which to save the
reading buffer
Defines how date and time information from the buffer is saved in the file on the USB
flash drive; the values are:
ï‚§ Save dates, times, and fractional seconds; buffer.SAVE_FORMAT_TIME
ï‚§ Saves relative timestamps; buffer.SAVE_RELATIVE_TIME
ï‚§ Saves seconds and fractional seconds; buffer.SAVE_RAW_TIME
ï‚§ Saves timestamps;
buffer.SAVE_TIMESTAMP_TIME
Defines the starting point in the buffer to start saving data
Defines the ending point in the buffer to stop saving data
Details
The filename must specify the full path (including /usb1/). If included, the file extension must be set
to .csv. If no file extension is specified, .csv is added.
For options that save more than one item of time information, each item is comma-delimited. For
example, the default format is date, time, and fractional seconds for each reading.
Examples of valid destination file names:
buffer.save(MyBuffer, "/usb1/myData")
buffer.save(MyBuffer, "/usb1/myData.csv")
The 2470 does not check for existing files when you save. Verify that you are using a unique name to
avoid overwriting any existing CSV files on the flash drive.
Example 1
buffer.save(MyBuffer, "/usb1/myData.csv")
Save all reading and default time information from a buffer named MyBuffer to a file named myData.csv on
the USB flash drive.
Example 2
buffer.save(MyBuffer, "/usb1/myDataRel.csv", buffer.SAVE_RELATIVE_TIME)
Save all readings and relative timestamps from MyBuffer to a file named myDataRel.csv on the USB flash
drive.