| External Interfaces/API | ![]() |
Debugging: Recording Information to Disk
While the serial port object is connected to the device, you can record this information to a disk file:
Recording information to disk provides a permanent record of your serial port 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 is 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 records the number of values written to and read from the device, and stores the information to the file myfile.txt
s = serial('COM1');
fopen(s)
s.RecordName = 'myfile.txt';
record(s)
fprintf(s,'*IDN?')
idn = fscanf(s);
fprintf(s,'RS232?')
rs232 = fscanf(s);
fclose(s) delete(s) clear s
You can use the type command to display myfile.txt at the command line.
| Controlling the Flow of Data: Handshaking | Creating Multiple Record Files | ![]() |