| Instrument Control Toolbox | ![]() |
Debugging: Recording Information to Disk
While the instrument object is connected to the instrument, you can record this information to a disk file:
Recording information to disk provides a permanent record of your instrument control session, and is an easy way to debug your application.
You record information to a disk file with the record function. The properties associated with recording information to disk are given below.
| Property Name |
Description |
RecordDetail |
Specify the amount of information saved to a record file. |
RecordMode |
Specify whether data and event information are saved to one record file or to multiple record files. |
RecordName |
Specify the name of the record file. |
RecordStatus |
Indicate if data and event information are saved to a record file. |
Example: Introduction to Recording Information
This example creates the GPIB object g, records the number of values transferred between g and the instrument, and stores the information to the file text myfile.txt.
g = gpib('ni',0,1);
g.RecordName = 'myfile.txt';
fopen(g)
record(g)
fprintf(g,'*IDN?')
out = fscanf(g);
End the instrument control session.
fclose(g) delete(g) clear g
Use the type command to display myfile.txt at the command line.
| Saving Objects to a MAT-File | Creating Multiple Record Files | ![]() |