Queuing and Callback Mechanism Sample Code Example (VB)
From NI-VISA
Queuing and Callback Mechanism Sample Code Example (Visual Basic)
| Note The Visual Basic examples in the NI-VISA Help use the VISA data types where applicable. This feature is available only on Windows. To use this feature, select the VISA library (visa32.dll) as a reference from Visual Basic. This makes use of the type library embedded into the DLL. |
Visual Basic does not support callback handlers, so currently the only way to handle events is through viWaitOnEvent(). Because Visual Basic does not support asynchronous operations either, this example uses the viRead() call instead of the viReadAsync() call.
Private Sub vbMain() Const MAX_CNT = 1024
Rem NOTE: For simplicity, we will not show error checking stat = viOpenDefaultRM(dfltRM) If (stat < VI_SUCCESS) Then Rem Error initializing VISA...exiting End If Rem Waveform not received...exiting End If End Sub |