User`s manual

8 Serial Port I/O
8-62
Debugging: Recording Information to Disk
While the serial port object is connected to the device, you can record this
information to a disk file:
The number of values written to the device, the number of values read from
the device, and the data type of the values
Data written to the device, and data read from the device
Event information
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.
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);
Table 8-13: Recording Properties
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