08-20-2009 01:47 PM
I'm currently using the measurement studio package in visual basic 2008, I am trying to communicate with a USB instrument with the following code:
Public CurrentSession As New NationalInstruments.VisaNS.UsbSession("USB0::0x0957::0x3018::MY48000107::INSTR")
CurrentSession.Write("*IDN?\n")
sleep(100)
buffervar = CurrentSession.ReadString(1024)
This seems to just return a read error. I have also tried using Query, same result. The instruement communicates just fine in the MAX, so I'm at a bit of a loss as to why this code doesn't work. Any help would be appreciated, thanks.
-Andrew
08-21-2009 05:46 PM
Hi afl3,
I would try getting a spy capture of both the communication in Measurement and Automation Explorer, and with your program, hopefully comparing the 2 will help you find out what's going wrong.
Performing a Good NI Spy Capture for Debugging/Troubleshooting
Scott M