Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Number retrieval within Linux using DAQmxBase and plain ansi C

Hi all,

I have trawled through the website for examples of how to retrieve the serial number of a DAQ unit in DAQmxBase.  This was very possible in DAQmx, but no function exists in DAQmxBase that I can see.  I have seen several examples about using Lab Windows, LabView etc even compiling it into a DLL...  we can't use LabWindows, LabView or compile the function to a DLL - Linux uses something completely different.

Anyways, I need to be able to retrieve this information, and it seems that 'lsdaq' has no problem doing this - albeit as part of a full string of information.  Is there any code or examples there that I can use to do this?

Any ideas anyone?

Thanks
Chris
0 Kudos
Message 1 of 6
(3,600 Views)

Hi Chris,

Can you let me know a little bit more about your system:

What version of Linux is your system running on?

What version is your linux kernel?

Which DAQ device do you want to programmatically retreve the serial number from?

What version of DAQmx Base have you got?

What other NI software, drivers do you have installed in what versions? eg LabVIEW, NI-VISA?

Regards

Emma R

NIUK & Ireland

0 Kudos
Message 2 of 6
(3,586 Views)
Hi Emma,
 
The version of Linux is Red Hat Enterprise 4, kernel is 2.6.9-5, the USB DAQ device is the USB 6501 and the DAQmxBase version is 2.0.  I don't have any other NI software installed - just DAQmxBase. 
 
There is a function in DAQmx to do just this, and it does look like its in the NIDAQmxBase.h header file, but it is not part of the library.
 
I tried to install DAQmx on this system, but didn't see any point when I looked at the release notes and found that USB DAQ units are not supported.
 
I had no problems installing DAQmxBase 2.0 on this system, unlike version 1.5 - which I couldn't get installed at all.  'lsdaq' even reports the USB DAQ unit with no problems, including the Serial number...  can we use the same principle here?
 
Thanks
Chris
0 Kudos
Message 3 of 6
(3,584 Views)
Chris,

Do you have access to LabVIEW for Linux? If so, you can certainly create a shared object and call it. I would recommend basing it off of this example. The function call to which you are referring in NIDAQmxBase.h is commented out, meaning that it has not yet been implemented. If you don't have LabVIEW, let me know and I'll see what I can do about building that VI into an SO.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 4 of 6
(3,550 Views)
Ryan,

Unfortunately, we don't have LabView. Would it be possible for you to create an SO and .h file for this function?

Cheers
Chris
0 Kudos
Message 5 of 6
(3,543 Views)
Chris,

I haven't tried it out yet, but here is the .so and .h straight from LabVIEW. Just pass the device string, and the data will be returned in SerialNumber. len is the size of SerialNumber. Let me know if you have any problems.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 6 of 6
(3,541 Views)