Instrument Control Toolbox | ![]() ![]() |
Event Types and Callback Properties
The GPIB event types and associated callback properties are described below.
Event Type |
Associated Property Name |
Bytes available | BytesAvailableFcn |
BytesAvailableFcnCount |
|
BytesAvailableFcnMode |
|
Error |
ErrorFcn |
Output empty |
OutputEmptyFcn |
Timer | TimerFcn |
TimerPeriod |
Bytes-Available Event. A bytes-available event is generated immediately after a predetermined number of bytes are available in the input buffer or the End-Of-String character is read, as determined by the BytesAvailableFcnMode
property.
If BytesAvailableFcnMode
is byte
, the bytes-available event executes the callback function specified for the BytesAvailableFcn
property every time the number of bytes specified by BytesAvailableFcnCount
is stored in the input buffer. If BytesAvailableFcnMode
is eosCharCode
, then the callback function executes every time the character specified by the EOSCharCode
property is read.
This event can be generated only during an asynchronous read operation.
Error Event. An error event is generated immediately after an error, such as a timeout, occurs. A timeout occurs if a read or write operation does not successfully complete within the time specified by the Timeout
property. An error event is not generated for configuration errors such as setting an invalid property value.
This event executes the callback function specified for the ErrorFcn
property. It can be generated only during an asynchronous read or write operation.
Output-Empty Event. An output-empty event is generated immediately after the output buffer is empty.
This event executes the callback function specified for the OutputEmptyFcn
property. It can be generated only during an asynchronous write operation.
Timer Event. A timer event is generated when the time specified by the TimerPeriod
property passes. Time is measured relative to when the object is connected to the instrument.
This event executes the callback function specified for the TimerFcn
property. Note that some timer events might not be processed if your system is significantly slowed or if the TimerPeriod
value is too small.
![]() | Events and Callbacks | Storing Event Information | ![]() |