8: TSP command reference Model 2450 Interactive SourceMeter® Instrument
8-12 2450-901-01 Rev. B/September 2013
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 contains the name of the file on the USB flash drive to which to save
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 or
1
• Saves relative time stamps; buffer.SAVE_RELATIVE_TIME or 2
• Saves seconds and fractional seconds; buffer.SAVE_RAW_TIME or 4
• Saves time stamps;
buffer.SAVE_TIMESTAMP_TIME
or
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(bufferVar, "/usb1/myData")
buffer.save(bufferVar, "/usb1/myData.csv")
Invalid destination filename examples:
buffer.save(bufferVar, "/usb1/myData.")
— The period is not followed by csv.
buffer.save(bufferVar, "/usb1/myData.txt")
— The only allowed extension is .csv. If .csv is not assigned, it is automatically added.
buffer.save(bufferVar, "/usb1/myData.txt.csv")
— Parameter error: filename must not contain two periods or extensions.
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.