Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxBaseReadAnalogF64 on OpenSUSE Linux returning no samples

I've been battling with this for several days.

I have an OpenSUSE based system (I've tried several variants 12.2 (64-bit), 13.1 (64-bit) and 12.2 (32 bit). with NI-DAQmxBase 14.0 installed, but have had no success reading from the card. The 64-bit installations install and recognise the card via lsdaq, the 32-bit did not even recognise the card.

When I try to do a read from the card I get 0 (zero) samples returned. I thought the issue might be my software so I tried several of the sample/example code, but with no success either.

The card itself functions correctly when installed in a Windows PC, so I don't think the hardware is an issue.

The niiotrace and nidatalogger both complain about liblvrt.so.12.0 not being loaded, which I suspect is a 32/64 bit issue.

Any suggestions?

0 Kudos
Message 1 of 9
(6,666 Views)

Finally got niiotrace to work having added lots of extra packages to the system, however results are very strange. When I run lsdaq there are functions logged in the trace, but when I run the examples I still get no results and nothing shows up in the trace program.

0 Kudos
Message 2 of 9
(5,668 Views)

Finally found an answer and more problems!

Got the sample code to work after installing the USB drivers. I had not previously done so because I was only using a PCI card and didn't need USB support. So at this point have sample code and my test program functioning, but not my main code. My main code is a highly multi-threaded environment and I wonder if there is some other interference going on. I will post more here as I find a solution, but I hope this proves helpful to some of you.

0 Kudos
Message 3 of 9
(5,668 Views)

Hi,

post here a card type what you have.

0 Kudos
Message 4 of 9
(5,668 Views)

PCI 6220

0 Kudos
Message 5 of 9
(5,668 Views)

DAQmxBase is not multithread safe.  It will fail if you try to have two VIs try to access the same analog input board at once.  At least this is my experience with the USB-6211.  I had to redisign an application to be sure that there was never interference in accessing the board.

0 Kudos
Message 6 of 9
(5,668 Views)

I have DAQmx 8.0.2 running with kernel 2.6.37.6.  It is old (2011) but lists the PCI-6220 as supported in the readme file.  I just installed a newer version of the VISA files and then the VISA installation in the DAQmx distribution skipped over the VISA installation since a newer version was there.  I have not been able to get it to work on a 3.x kernel but didn't try very hard.

0 Kudos
Message 7 of 9
(5,668 Views)

Thanks for your input, making progress slowly - will post findings and solutions here in the hopes that it will help others - the linux implementation is not as robust as one would like!

0 Kudos
Message 8 of 9
(5,668 Views)

This is what finally worked on OpenSUSE 13.1 64-bit. The 32-bit version did not work. I think this will also work for some earlier versions of OpenSUSE.

All of the following are done as superuser.

* First of all install the prerequisites (see script attached).

* Reboot and run script again so that it then prepares the kernel symbols

* Reboot again

* Expand the DAQmxBase v14.0.0 ISO file to a folder (or run from the CD)

* Run ./INSTALL

* Make sure you install both the C and USB support - if you don't it won't work even if you are only using a PC card

Once done you should be able to run the lsdaq command and list your NI device.

If that is OK you should then be able to compile the example programs and get them to successfully read samples.

Special notes on the read function

int32 DAQmxBaseReadAnalogF64 (TaskHandle taskHandle, int32 numSampsPerChan, float64 timeout, bool32 fillMode, float64 readArray[ ], uInt32 arraySizeInSamps, int32 *sampsPerChanRead, bool32 *reserved);

What the documentation does not make clear is that the arraySizeInSamps parameter does not take into account the number of channels unlike the numSampsPerChan and sampsPerChanRead parameters.

So my error was to use the same number for the array size, even though what I should have used was the the number of samples * the number of channels.

Anyway after a long time figuring this all out I hope it helps someone. The prerequisites script I mentioned is attached to the post.

0 Kudos
Message 9 of 9
(5,668 Views)