Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA C/C++ code for NI-USB 6251 DAQ

I'm looking to write a C++ application that interfaces with the 6251 DAQ using VISA library functions, e.g. viOpen(), viWrite(), viPrintf(), etc., but I haven't found any documentation saying that's possible or gives any sort of example.  I have had success writing a basic C/C++ application using the NIDAQmx.dll, but that is still not quite what I was hoping for.  I would like to incorporate the handling of the DAQ into an existing test hardware architecture that uses VISA function calls without having to include a specialized class that uses this NIDAQmx driver.  I also do not wish to write a LabView vi or something like that because I'm more of a text only kind of programmer. 

 

So all that being said, now my questions...

 

Is it possible to interface with the NI-USB 6251 DAQ via the VISA libraries?

If it is possible, are there any available resources, i.e. example code/documentation?

0 Kudos
Message 1 of 5
(5,275 Views)

Hi theAlias-

 

Yes, it is theoretically possible, but the USB protocol used by USB DAQ devices is complicated and not documented externally.  The 622x/625x/628x devices are some of the more complicated of USB DAQ to program, and I do not believe you could be successful writing a VISA-based instrument driver for them in a reasonable amount of time.

 

I understand the desire to avoid re-writing your existing code, but it should not be that bad of an undertaking because the programming semantics of NI-DAQmx are conceptually similar to those in NI VISA.  You still have to open (DAQmx Create Channel), configure (DAQmx Configure Timing, Triggering, Routing, etc), write/read (DAQmx Start Task and DAQmx Write, Read), and close (DAQmx Stop, Clear Task). 

 

If you have any questions concerning how to port your application to NI-DAQmx, please feel free to post them on this board.

 

Hopefully this helps-

Tom W
National Instruments
0 Kudos
Message 2 of 5
(5,265 Views)

Hi Tom,

 

Thank you for your response.  Given that what I want to do is theoretically possible, despite your doubts regarding the success of such an attempt, can I obtain a copy of the externally undocumented USB protocol and/or the DAQ hardware's available command set and accessible registers (typical datasheet information)?  Regardless of complexity, I would prefer to make the time and success estimations on my own behalf and then make a determination if using the provided drivers is the more desirable approach.

 

I appreciate your offer to help in porting my application, but I can't post it and I don't think it will be necessary, as the driver functions seemed aptly named and documented sufficiently.

0 Kudos
Message 3 of 5
(5,244 Views)

Hi theAlias-

 

There is no documentation or example code available internally or externally that can be released for the USB-622x/625x/628x devices.  We have produced a small amount of example code and documentation for USB-600x and USB-621x devices (this info is current as of Summer 2009).  This material is not available for wide release, but we do release it to some users on an extremely limited basis.  

 

Thanks-

Tom W
National Instruments
0 Kudos
Message 4 of 5
(5,236 Views)
Hi Tom,

I must say that we're slightly disappointed. 😉 In our institute, we code in Delphi almost exclusively, and installing the DAQ support for Delphi has turned out to be a nightmare. However, we do have a reliable Delphi VISA unit. Since NI supports VISA actually quite well, I don't see why there's no VISA layer in the DAQ devices. Having to deal with multiple APIs/DLLs for multiple devices is really difficult with Delphi. VISA has helped greatly with that.

Now we have to write our own Delphi bindings to the DAQ DLL.

Besides, this is true for all not-hugely-popular programming languages. I myself wrote VISA support for Python, which is used by many groups (I even got forwarded emails from Agilent customers). However, there is no DAQmx support for such languages out-of-the-box.

Regards,
Torsten Bronger, Research Centre Jülich.
0 Kudos
Message 5 of 5
(5,169 Views)