Visual Basic Example
A-6 PN: 10580-00306 Rev. E MS20xxC PM
Rem Set the timeout for message-based communication
Rem TODO: Add error handling.
stat = viSetAttribute(sesn, VI_ATTR_TMO_VALUE, 120000)
Rem Ask the device for identification
Rem TODO: Add error handling.
stat = viWrite(sesn, “*IDN?”, 5, retCount)
stat = viRead(sesn, buffer, BUFFER_SIZE, retCount)
Rem TODO: Add code to process the data.
byteCount = retCount
returnBytes = Left(buffer, retCount)
Rem Close down the system
Rem TODO: Add error handling.
stat = viClose(sesn)
stat = viClose(dfltRM)
End Sub