Finding Resources 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. |
Rem Find the first matching device and return a session to it Const MANF_ID = &HFF6 '12-bit VXI manufacturer ID of a device Rem Error initializing VISA ... exiting End If Rem Error finding resources ... exiting End If stat = viOpen(dfltRM, desc, VI_NULL, VI_NULL, sesn) stat = viGetAttribute(sesn, VI_ATTR_MANF_ID, iManf) stat = viGetAttribute(sesn, VI_ATTR_MODEL_CODE, iModel) Rem We have a match, return session without closing End If End If End If Wend End Function |