From: Dekay on
I am programming a PCI 6251 using LabView 8.5 to measure the voltage across a voltage divider. The board and circuit are connected via a BNC-2090. If the measurement is made using DAQ Assistant, the correct voltages are measured. If the DAQ Assistant is converted to code, the voltages measured are not correct. The program is attached with either method available by disabling or enabling one path or the other. A screen shot of the results of each is also attached. The correct measurements are also obtained when using NI-DAQ MX. The same results are obtained with NRSE and Differential measurements, within reason. The circuit is connected using AO0 as the source voltage, AI0 measuring (checking) the voltage across the two resistors (test resistance and sense resistor), and AI1 measuring the voltage across a sense resistor. It appears that some configuration information is lost in the translation when generating the code. Any ideas on what to change, e.g. using channel node?Thanks


DAQ Asst vs Gen Code.pdf:
http://forums.ni.com/attachments/ni/170/321519/1/DAQ Asst vs Gen Code.pdf


DO AO AI 2CH - IVT Sub.vi:
http://forums.ni.com/attachments/ni/170/321519/2/DO AO AI 2CH - IVT Sub.vi


AI - CH0 CH1.vi:
http://forums.ni.com/attachments/ni/170/321519/3/AI - CH0 CH1.vi
From: NI-Bongo on
Hi Dekay, There is a major architecture change between the two different versions.  The version with the DAQ assistants does not acquire both channels at the same time, it acquires all data from the first channel, then all data from the second.  The version without the DAQ assistant acquires the data for both channels at the same time (a multiplexer alternates both channels to the ADC, but it is near simultaneous).  The values your read on the AI channels are probably different because
you are influencign the measurements by doing them simultaneously or in
series.LabVIEW follows a dataflow programming model.  Any subVI will only run when it has received all the input values it needs.  Likewise, a subVI will only output values when it is completely finished running.  This means that your first DAQ assistant finishes acquiring before the second ever runs because the second is waiting on the error output of the first.The reason your DO and AO tasks still appear to be running is because they remain fixed at the last value that was written to them even after the task is cleared.  Once you set the digital lines and a DC value on the AO, those values will remain until you set them to something else in a new task or shut down your device.  I'd recommend setting up a single DAQ assistant to acquire both channels and get rid of the second AI DAQ Assistant.  You can add additional channels under Channel Settings in the Configuration tab of the DAQ Assistant.  The behavior of that setup should be the same as the DAQmx code.Also, if you removed the error wire between the DAQ assistants in your existing code, you would receive error -50104 "Specified Resource is Reserved."  This is because the 2 DAQ assistants would separately try to use the AI Sample Clock at the same time.  By configuring the channels within one DAQ assistant, we associate both channels with the sample clock in one task which will work.I hope this helps!