From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI VISA USBTMC Control Out Data Corruption

I am having trouble performing USBTMC control out transfers using the NI VISA driver.

 

In terms of background, I'm presently working on USBTMC device firmware, and was hoping to use custom USB control out transactions to help with debugging. I use Windows 10, 64-bit, with NI VISA 19.0. This issue isn't critical for me to solve, but it is a bit perplexing.

 

I have tried sending data both with IVI VISA .Net, pyvisa, and the NI VISA Test Panel. In .Net, I use 

inst.ControlOut(0x21,0xCC,0x00,0x00,new byte[] {0x12,15,18,12,23,85});

 

I traced the USB activity via WireShare with USBPcap, and it shows the data was 00 00 09 00 AC 00.

image.png

Similar corruption is seen when using the NI Test Panel and pyvisa. The data received on the device is the data shown in WireShark. It's as if the wrong buffer is being used in the VISA USB library.

 

On the other hand, control IN transactions are working as expected. I wonder if control out transactions have not been tested since they are not used in the USBTMC spec.

 

Thanks!

0 Kudos
Message 1 of 1
(1,814 Views)