Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Driving a NI-USB device through VISA instead of NI-DAQmx

I am programming a rather complex instrument that will use different hardware devices (cameras, galvanometers, line cameras, light sources, motors, etc.), so there are different interface types involved.
I am skilled in ANSI C, and my design choice was to use the VISA library to access all of them, in order to abstract as much as possible the interface from the differences among the various hardware devices.

Of course (that's what you get when you enter a project already running), various interfaces are already established, and the one driving the galvanometers is just one of those. It is a NI USB-6001.

How nice: NI hardware and NI software! BUT it doesn't come with VISA compatibility out of the box: you have to create the driver yourself (OK, now I know how to do that...), and that's finally a done deal.

BUT (yes, again) it is NOT a USBTMC device (...), it is a RAW device!
And NI expressely tells that (roughly translating from Spanish from https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1qzCAA&l=en-US) "Establishing communication with a RAW-class USB device is more complicated, as any device can use its own communication protocol. Contact with the provider of your device for details on your device communication protocol."

So, my question is: how do I contact with NI for this thing? Don't take me for a lazy guy: it is a few days that I am spinning round and round in the NI website just to make the USB-thing visible from VISA, and I should be programming, not surfing the web.

Is there some special support line or web-page where I can request this information?

Thank you all!

0 Kudos
Message 1 of 6
(4,154 Views)

Do these instruments follow the SCPI syntax and commands?  This would allow you to use VISA for the basic communications protocol between the instruments.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 2 of 6
(4,136 Views)

Hello Minions,

and thank you for the track to follow.
I don't know what SCPI is, so I will go and look for it, then I'll let you know.
Although I actually hoped that someone from NI would reply. It is their stuff!

0 Kudos
Message 3 of 6
(4,126 Views)

I checked that.
No: if you send an *IDN? command you receive nothing back but a timeout, and if we cannot get *IDN?...
But I was also replied from NI: I sent them the very same request that opened this thread and (I translate it):

"Our devices aren't designed to work with VISA, but they do that at a higher level throught the drivers we give with them. In your case, if the development environment you are using is ANSI C, I recommend you to use the DAQmx driver API for this IDE".

Which is to say: we did write NI-VISA so to unify the control of hardware, but then we don't implement it on all our devices and you are back to #include yet another driver.
To me, this makes no sense whatsoever: I can have good IDE's for free, good GUI designers for free, good C compilers for free, good standard compliance for free. I can have the Intel MKL for free: it's open source! For free, I will be able to get advised on stackoverflow about ANSI C99 subtleties, instead of having to fight with odd "design choices" where pointers are used instead of integers and vice-versa. I will have to add an include file for some device, that's a part of the game, but that's not like "yes, we do that at a cost" and then you find out that "no, you paid for it but we we don't do that!"

0 Kudos
Message 4 of 6
(4,120 Views)

Hello, I was just about to contact NI for this puzzle as well when I saw your post! I bought a NI USB 6002 to use it for a scanning galvo, but when it arrived, I found that it doesn't appear when I type in "list_resources()" under visa. At first I thought it was because I had to install NI-DAQmx because the daq was only showing up on my computer's device manager with a yellow exclamation mark. When I installed that, the daq was finally recognized (and it appeared in Labview as well). BUT it still doesn't show up in visa!! Now your post confirms this whole USBTMC issue and having to make my own inf file. I haven't gotten there yet, but I was wondering if that's what you are going to do now? If so, I probably will have lots of questions! Best, bert.  

0 Kudos
Message 5 of 6
(4,098 Views)

No, I received a very straightforward reply: those devices are not meant to be used with VISA. NI-DAQmx is to be used instead.
So long for the possibility to reduce the code bulk and improve its portability!
I will use DAQmx, what else? I lost too much time already on this stupid matter. Hopefully, in the next project I will be in a better position to steer technical decisions and purchases from day 0.

0 Kudos
Message 6 of 6
(4,093 Views)