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.
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.
07-04-2014 11:03 AM
Hi everyone, I am new with programming VISA. As part of my first few tasks, I am learning to establish a USB communication with instruments. From the little research I have done so far, I found that there are two classes of USB devices, the USB INSTR and USB RAW. I have no problem communicating with the USB INSTR device I have got. However, I have not been able to establish a successful communication with my USB RAW device. My first attempt to communicate with this device after installing the driver was by means of the NI MAX. ON querying the device to get its identity, the NI MAX returned an error that reads “VISA: (Hex 0xBFFF0015) Timeout expired before operation completed”.
Can anyone please advise me on what to do to clear this read problem? I have attached a snap shot of the NI MAX window showing the error message.
07-04-2014 11:09 AM
07-07-2014 06:10 AM
Thanks for the response. I do not have the RAW information from the device vendor. I was working based on the understanding I had from the literature I read. I understood from that literature that USB devices that are not compatible with USBTMC fall under the USB RAW class.
I think I would take a look at the RAW information of my USB device to see what the vedor has to say about it.
07-07-2014 06:12 AM
Please, further suggestion is welcomed from anyone who can help. Thanks
07-07-2014 06:47 AM
07-07-2014 09:13 AM
I got the information about the two classes of VISA Resources supported by NI-VISA from http://www.ni.com/white-paper/4478/en/.
Because my instrument was not automatically recognised by NI-VISA, I have assumed that it would be a USB RAW device. I know my assumption might not be correct, that is why I am asking for help from people who are more knowledgeable than me in this subject. I was working based on the information I have.
Regarding the question about the driver that came along with the device, I am yet to get the driver for the device as it was passed to me without a driver.
Please let me know the procedure to follow to undo what I have already done.
Thanks
07-07-2014 09:26 AM
10-01-2014 06:05 PM
I realize this thread is a few months old now, but I am having the exact same issue. I have a USB RAW device for which I created a VISA device driver. All is good with the device driver. The code on the MCU simply echoes any data on the OUT Bulk endpoint back to the IN bulk endpoint. Very simple.
I couldn't figure out why in the world I would send out a message packet and it would take 2 seconds before I got a response. The MCU is running plenty fast. I knew that wasn't the issue. In fact, using a different program, I could send data to the OUT EP and get it back immediately on the IN EP. The MCU is not the problem. So I poked around and discovered some behavior I did not expect with the VISA read and write VIs. The Timeout Property Node of the USB RAW interface was set at 2000ms. That was mighty coincidental with my above observation. Then I found that if I tweaked the timeout to be 10000ms, it would take 10000ms to get the data echoed back. If I changed it to 10ms, I got the data back almost immediately.
I should also point out that it didn't matter how much data I sent to the out EP. For example, if I sent out 64 bytes (my max MCU buffer size) and requested only 32 using the read VI I still had to wait for the timeout period to expire to get only 32 bytes back.
This is not at all how I expect the timeout property to work. I should get an error if I don't get data within the specified timeout period. If I do get data, there should be no error. Unfortunately, based upon how things seem to be working, it is necessary to poll the VISA read function repeatedly to get the data. Of course if there is no data a timeout would occur. So it is necessary to clear the error. If there is data, I can process it.
This seems to me like the wrong way to be doing things. Anyone have any suggestions? I am attaching a VI Snippet so you can see what I did.
10-01-2014 08:19 PM
Please refer to this Link.. (Hex 0xBFFF0015)
A timeout error is generally indicative of a different problem. Check the command strings sent to the VISA Read and Write calls and ensure that they are written in the proper syntax for your instrument.
10-02-2014 03:27 AM - edited 10-02-2014 03:28 AM
Do you get the correct data back?
Also, what's going on in your "Write Large Pkt USB" Sub-VI? Your timeout could be happening on the output just as likely as the input.