Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Where can i change the buffer mode for anlog Input/Outputs

Hi,
I'm writing an application in C# for a mobile test Stand...
There i use analog Input and Output Channels...
 
I read an analog Input with 50Hz, Scan Frequency 500Hz....
that works fine,
ich only copy the values to an output channel...and write them to my scope...
the problem is...ich have a time delay...but thats not the most problem...it seems to me that the output or even the input values...get bufferd from the national instruments hardware...anybody experiences with that?
is there the possibility to change the buffer mode?
or who knows anything about buffering data using national instruments daq cards?
 
thanks
0 Kudos
Message 1 of 5
(3,850 Views)
Look up DataTransferRequestCondition and DataTransferCustomThreshold.
0 Kudos
Message 2 of 5
(3,836 Views)

Hello Defence,

What exactly are you trying to accomplish with your analog outputs?  What questions do you have about buffering?

Regards,
Sean C.
0 Kudos
Message 3 of 5
(3,834 Views)
at the moment i only read an analog input signal and write it to an output channel....
the problem is....i read a sinus wave....in the output on the scope i have a little time delay...that is ok...but i have the feeling that the values aren't write all the time to the output channel,only at certain times but then all the values at one time....
i hope you understand what i mean...
so i have the feeling that there is an hardware buffer....
 
0 Kudos
Message 4 of 5
(3,831 Views)

Hello defence,

You are correct that there is some hardware buffering taking place.  Take a look at the Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi shipping example (this is the most relevant to your application).  You can find this VI in LabVIEW by selecting Help >> Find Examples... and then browsing to Hardware Input and Output >> DAQmx >> Analog Generation >> Voltage >> Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi.
In this VI, the DAQmx Write.vi is called before the DAQmx Start Task.vi is called.  This write VI fills the analog output (AO) buffer on the DAQ device with the number of samples specified in the "Size (Sample)" control before any generation has taken place.  When the DAQmx Start Task.vi is called, the DAQ device begins generating the data in the AO buffer at the specified sample rate.  In the next iteration of the while loop, the DAQmx Write.vi is called again.  Again, it writes the set number of points to the AO buffer.  However, this time the Write.vi will hold execution until all points are written to the buffer.  For example.  The default number of samples is 5000 and the sample rate is 20,000 S/sec.  So in this case, the DAQmx Write.vi is called 4 times per second.
With Non-Regeneration enabled, you need to be sure to continuously write data to the AO buffer fast enough that there will always be data for the AO task to generate.  If you are writing to the buffer at a slower rate than you are generating data, you will eventually empty the buffer, and receive a buffer underflow error.

Does this answer your question?  Please let me know if you need any clarification on how AO buffering works.

Regards,
Sean C.

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