ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

UsbSession read error

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

0 Kudos
Message 1 of 2
(3,500 Views)

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

Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,480 Views)