Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx in Visual Basic for M-series

Hello dear NI lovers Smiley Wink,
 
I have to acquire one sample from 60 different channels in one time...Therefore I HAVE to use Visual Basic 6 and DAQmx 7.5
My DAQCard is a M-series 6225 (80AI Channels). My old code was written with Trad Daq and I have to change 1 line of code to DAQmx.
I know that writing code via Visual Basic.net is quite easier, but I don't have the choice and have to use VB 6.
 
When using the VB6 example code (Acq Int-clock) on my hard disk provided by the DAQmx driver, a DAQmx error occurs telling me that "the buffer size is too small".
This example is able to acquire 1000 samples of e.g. 2 channels (=2000 points). I tried to acquire 2 samples of 60 channels (= 120 points) and it tells me that the buffersize is too small??? How can resolve that problem???
 
Can somebody plaese explain me this "buffersize" phenomena or send me a good example to acquire 60 samples with sample per channel?
 
Thanks everybody!
0 Kudos
Message 1 of 2
(2,636 Views)

Hello DeMassi,

Have you solved your problem?

In fact, if you do a continous acquisition, LabVIEW creates like an "interactive" buffer in function of the rate acquisition. Anyway, you are able to overwrite this function and give a buffer size by this way :

DAQmxCfgInputBuffer

int32 DAQmxCfgInputBuffer (TaskHandle taskHandle, uInt32 numSampsPerChan);

Purpose

Overrides the automatic input buffer allocation that NI-DAQmx performs.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
numSampsPerChan uInt32 The number of samples the buffer can hold for each channel in the task. Zero indicates no buffer should be allocated. Use a buffer size of 0 to perform a hardware-timed operation without using a buffer.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.

 

This is the description of the function you should employ.

Regards,

Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 2 of 2
(2,607 Views)