Instrument Control Toolbox    

Storing Event Information

You can store event information in a callback function or in a record file. Event information stored in a callback function uses two fields: Type and Data. The Type field contains the event type, while the Data field contains event-specific information. As described in Creating and Executing Callback Functions, these two fields are associated with a structure that you define in the callback function header. Refer to Debugging: Recording Information to Disk to learn about storing event information in a record file.

The event types and the values for the Type and Data fields are given below.

Table 3-10: GPIB Event Information 
Event Type
Field
Field Value
Bytes available
Type
BytesAvailable
Data.AbsTime
day-month-year hour:minute:second
Error
Type
Error
Data.AbsTime
day-month-year hour:minute:second
Data.Message
An error string
Output empty
Type
OutputEmpty
Data.AbsTime
day-month-year hour:minute:second
Timer
Type
Timer
Data.AbsTime
day-month-year hour:minute:second

The Data field values are described below.

The AbsTime Field.   AbsTime is defined for all events, and indicates the absolute time the event occurred. The absolute time is returned using the MATLAB clock format.

The Message Field.   Message is used by the error event to store the descriptive message that is generated when an error occurs.


  Event Types and Callback Properties Creating and Executing Callback Functions