01-27-2011 03:41 PM
I have a couple of oddities going on. I am trying to control a device (solenoid driver) via USB through an interface board that has a PIC18F1450 on it. I managed to command the device with the code in the picture (without the VISA read). The board sends a 64 byte reply to all commands, so I added the VISA Read. That's when I get the error. The VISA open and write still work, but the read gives the error. The other oddity is where the device is visible. I used the device driver wizzard to create a driver for it. When I did that, it dissapeared from Windoze Device Manager. When I move it to another USB port, it appears in Device Manager, but dissapears in MAX. When I return it to the original port it reappears in MAX, but again dissapears in Device Manager.
Solved! Go to Solution.
01-28-2011 07:18 AM
Sorry, I guess an explicit question is better than an implicit one. Anyone have an idea as to why (in the first post) the VISA Read is throwing the error but not the write, or why the device shows up either in MAX or device manager, but never in both?
01-28-2011 04:24 PM
Jim,
I did some searching on the error in your screenshot (1073807302) and I came across a KnowledgeBase article VISA Error -1073807360 (system error) or Error -1073807302 when Stop Bits Set to 1.5. It does not look like you are configuring the port, but you may want to check that any settings you have are not unusual for the read. Also, can you include the top portion of the error (above "Possible reason(s)") that you are seeing in a screenshot? It might provide some additional information about where the error is occuring.
I also found an example program in the Example Finder called the Advanced Serial Read and Write. The code looks similar to yours, so it seems that the concept of what you are doing is not necessarily the problem. This might be a good thing to look at to model configuring a port.
Also, can you provide more information about the USB device you are using? Is it something that you have designed? There is a tutorial that steps through the process of using a USB device with VISA called USB Instrument Control Tutorial. It seems like driver maybe is not associated properly. Walk through these steps to make sure there is not something missing. It could also be that the device does not actually disappear from the device manager when you plug it into another port, it just appears in another part of the device manager.
Hope this helps,
Jen W
Applications Engineer
National Instruments
ni.com/support
01-31-2011 10:35 AM
Hi Jen,
Thanks for the response. The device that I am working with is a board that was designed by a Microchip AE to be an interface between our product and a PC. It has a PIC 18F1450 micro on it to provide the USB interface. It is supposed to reply to any command with a 64 byte packet. I know that down traffic is working because I can activate the product, and change the timing. The VISA Read is not timing out, but is giving the aforementioned error message. Before the Possible reason(s) it says: "Error -1073807302 occured at VISA Read in ChangeFlushTiming.vi"
01-31-2011 11:55 AM
appears in Device Manager, but dissapears in MAX. When I return it to the original port it reappears in MAX, but again dissapears in Device Manager
NI VISA is reserving the Old Alias- Awaiting reconnection. You need to "clear" the alias to allow MAX to see the device on the new port.
From MAX :
Tools>NI-VISA>VISA Options. This pulls up th VISA configuration panel select:
My System>General Settings> Aliases. to pull up the Resource list. Select:
the conflicting OLD resource Right click> Clear Alias.
All better.
02-01-2011 02:56 PM
Jim,
Can you provide a spy capture and a MAX configuration report of your system so that I can take a closer look at what is causing the error?
Thanks!
Jen W
Applications Engineer
National Instruments
ni.com/support
02-01-2011 03:53 PM
Hi Jen,
This is the first time I have used the configuration report tool, so I hope I did it correctly. I also included my VI.
Thanks for your help,
Jim
02-02-2011 11:55 AM
Jim,
Thanks for the additional information. Do you know if your device supports an interrupt pipe? You may need some additional code to read from your USB RAW device, like what is in the example program VISA USB RAW Mode Get Interrupt Data Example.
Let me know if that helps,
Jen W
Applications Engineer
National Instruments
ni.com/support
02-03-2011 07:23 AM
Jen,
Thank you, you have led me to the solution. I don't understand the details of USB, but I have attached my VI for future solution seekers. Evidently I can write to the PIC with a VISA Write, but I need to use a USB interrupt to receive the return packet. A VISA Read did not work. Thanks again for your help!
Best Regards,