Interactive SourceMeter® Instrument Reference Manual Section 8:
2450-901-01 Rev. B/September 2013 8-61
file.usbdriveexists()
This function detects if a USB flash drive is inserted into the front panel USB connector.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
driveInserted = file.usbdriveexists()
0 if no flash drive is detected
1 if a flash drive is detected
Details
You can call this command from a script to verify that a USB flash drive is inserted before attempting to write
data to it.
Example
print(file.usbdriveexists())
If the USB drive is not inserted in the USB
connector on the front panel, this returns 0.
Also see
None
file.write()
This function writes data to a file.
Type TSP-Link accessible
Affected by Where saved Default value
Function No
Usage
file.write(fileNumber, string)
The file number from file open command of the file to which to write
The data to write to the file
Example
file_num = file.open("testfile.txt",
file.MODE_WRITE)
if file_num != nil then
file.write(file_num,"This is my test file")
file.close(file_num)
Opens file testfile.txt for
writing. If no errors were found
while opening, writes "This is
my test file" and closes the
file.
Also see
None