LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different results in DAQ Assistant and generated code

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
0 Kudos
Message 1 of 8
(3,468 Views)
One thing that I noticed is that when you create your virtual channels both channels are configured as analog voltage inputs.  I believe that you want one of them set to analog output voltage.
0 Kudos
Message 2 of 8
(3,455 Views)
Normally, I would put both AI channels in the same channel creation routine, comma separated. The code in the attachment (AI CH0 CH1) was generated from a NI-DAQ task, which created the channels with separate blocks. The analog output is in the calling VI as 'DAQ Assistant'. 'DAQ Assistant 2' sets digital lines.
0 Kudos
Message 3 of 8
(3,445 Views)
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!
Regards,
John Bongaarts
0 Kudos
Message 4 of 8
(3,422 Views)
The problem turned out to be with the impedance of the input channels. The impedance is very high for one of the channels, and moderately high for the second channel. The manual cautions that there may be 'ghosting' from large differences in impedance. I will try inserting a grounded channel in the list of scanned channels, or using a voltage follower, as suggested in the manual. Anyway, this is the reason that the measurements were correct when read individually, but not when scanning more than one channel.
Thanks for the suggestions. I'm sure if I had given you the info on impedance you would have picked up on the problem immediately.
0 Kudos
Message 5 of 8
(3,377 Views)
    I have a problem. I want to make some simulation programs, using a daq usb 6008 using labview. Any sugestions? Email me  at mireia_love@yahoo.com.
0 Kudos
Message 6 of 8
(3,340 Views)

Hi mireia,

It would be more appropriate to start your own thread with your question.. 

The DAQ USB-6008 is a DAQmx device.  You can start within MAX to simulate the device.  However, your question was not clear if you wanted to simulate the device or write a simulation program using Labview.

You can do both.  Can you provide more details?

RayR

0 Kudos
Message 7 of 8
(3,336 Views)

Hi mireia,

You can find some great examples for your USB-6008 in LabView by going to the NI Example Finder (“Find Examples…”) in the Help menu. Once in Example Finder, you can narrow down the examples by hardware. Simply click on the Hardware drop down menu and select the USB-6008. Also, make sure to check “Limit results to hardware.” The examples you are looking for should be under

Hardware Input and Output >> DAQmx.

I hope this helps,
S_Hong

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 8 of 8
(3,288 Views)