Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

NIDAQ800_RedHat.iso DAQmxSet/GetBufInputBufSize()

Go to solution


It contributes for the first time.

The program of S Series AI module such as PXI-6133 is developed by using C/C++ API of Linux version DAQmx8.0.

The error of -50352 occurs in the place where the task is done in commit by the DAQmxTaskContol function.

The BufInputBufSize seems to influence if it examines it.

PXI-6133 is an error in one case when making it to 5,400,000 with OK when it is 5,300,000.

PXI-6133 is an error in two cases when making it to 2,800,000 with OK when it is 2,700,000.

PXI-6133 is an error in three cases when making it to 1,900,000 with OK when it is 1,800,000.


To achieve a multi channel(about 40) and a high-speed sampling(up 1MS/sec), the BufInputBufSize is flexibly specified.
(MXI-4 has the forwarding performance of 78Mbyte/Sec. MXI-Express has the forwarding performance of 110Mbyte/Sec. )

I want to do.

BufInputBufSize was investigated in Windows version DAQmx8.7.2.

When two PXI-6133 was used, 8,000,000 was able to be set.


The restriction by the Linux version strongly hopes for the improvement because the patch is acceptable if it is a problem on the DAQmx side.

Please teach if there is an action method if it is a kernel, and a problem on the LinuxOS side.

My best regards I hope.


0 Kudos
Message 1 of 7

When you set the buffer size this memory must be page locked in physical memory.  Depending on the available physical memory, what else is page locked, and what else is consuming memory, the National Instruments memory allocator may or may not be able to allocate the memory.  Often it is helpful to think in terms of total memory that will need to be allocated rather than the number of samples.  First it is important to note that when you use the DAQmxInputBufSize function you are allocating that number of samples for every channel.  If you are using 40 channels and are allocating 5.4 MSamples this equates to 5.4 MSamples * 2 bytes/sample * 40 = 432 MB.  If you don't have 432 MB of memory available to be page locked in the kernel than memory allocation will fail.  Since Windows and Linux perform different memory management schemes it is not always easy to compare the two.  Furthermore, I know we have made some changes to our memory manager between when 8.0 for Linux was released and 8.7.2 for Windows was released.  Have you tried to compare 8.0 for Windows to 8.0 for Linux?




Neil S.

National Instruments

0 Kudos
Message 2 of 7

Thank you for the reply.

It is not when windows DAQmx 8.0 and Linux DAQmx 8.0 are compared.
It is because of not developing with Windows DAQmx 8.0.

One example of the size that I want to set is size (160Mbyte) of the buffer of 40Ch and 2MS.
The reason for the example of the size of the buffer previously shown is that it is thought that the total size is limited in the size of the buffer that can be set.
In Linux DAQmx 8.0, to take how much size of the maximum buffer logically, are you designed?

It develops in the following memory situations in my PC.


# free
                 total          used           free     shared       buffers     cached
Mem:       2067348    1285168     782180          0     146460     847440
-/+ buffers/cache:      291268    1776080
Swap:      4128752     0              4128752

My best regards it asks.

0 Kudos
Message 3 of 7

It does not surprise me that NI-DAQmx 8.0 for Linux and NI-DAQmx 8.7.2 for Windows behave differently, but I don't have enough experience to say what the specific differences will be.  Are you most interested in what the maximum buffer size in Linux can be?




Neil S.

0 Kudos
Message 4 of 7

 Thank you for the answer.


> Are you most interested in what the maximum buffer size in Linux can be?



The improvement is strongly hoped for so that the size of the buffer for which DAQmx8.0 for Linux can be used may become equal to DAQmx8.7 for Windows.
The DAQ module made by the NI company becomes more accessible, and the performance might be able to be demonstrated effectively by doing so.


My best regards it asks.


0 Kudos
Message 5 of 7
Accepted by topic author s.imazu

Sorry for the delay in getting back to you.  I have been a bit busy with a number of other things.  I was talking with a colleague the other day and he had a recommendation that might help.  Apparently NI-DAQmx 8 for Linux uses vmalloc to allocate the memory buffers in the kernel.  However, vmalloc space is only 128 MB on systems with more than 896 MB of space.  I haven't had a chance to try this out, but you can increase the amount of vmalloc space by adding "vmalloc=512M" to your kernel boot line in grub.  The upper bound on vmalloc space is < 1 GB.  Since it sounds like you have plenty of RAM it seems like a reasonable way to go.




Neil S.

Message 6 of 7

Thank you for the answer.


When vmalloc=512M was set when the kernel was booted, the size of InputBuffer was able to be enhanced. It took notes of the bug of GRUB when setting it.  In this, it can be able to be settled ..the development of the program...


I wish to express my gratitude for your advice.


My best regards.


0 Kudos
Message 7 of 7