Instrument Control Toolbox    

Event Types and Callback Properties

The event types and associated callback properties supported by serial port objects are listed below.

Table 5-5: Serial Port Event Types and Callback Properties  
Event Type
Associated Properties
Break interrupt
BreakInterruptFcn
Bytes available
BytesAvailableFcn
BytesAvailableFcnCount
BytesAvailableFcnMode
Error
ErrorFcn
Output empty
OutputEmptyFcn
Pin status
PinStatusFcn
Timer
TimerFcn
TimerPeriod

The break-interrupt and pin-status events are described below. For a description of the other event types, refer to Event Types and Callback Properties.

Break-Interrupt Event.   A break-interrupt event is generated immediately after a break interrupt is generated by the serial port. The serial port generates a break interrupt when the received data has been in an inactive state longer than the transmission time for one character.

This event executes the callback function specified for the BreakInterruptFcn property. It can be generated for both synchronous and asynchronous read and write operations.

Pin-Status Event.   A pin-status event is generated immediately after the state (pin value) changes for the CD, CTS, DSR, or RI pins. Refer to Serial Port Signals and Pin Assignments for a description of these pins.

This event executes the callback function specified for the PinStatusFcn property. It can be generated for both synchronous and asynchronous read and write operations.


  Events and Callbacks Storing Event Information