01-13-2015 02:50 PM
Dear all,
We are trying to generate an analog voltage output with the NI 9263 and then read that as an analog input with the NI 9215 as part of an academic exercise. Both of these are on board the NI cDAQ-9174 (compact DAQ). An analog waveform is generated within Labview (either a sine, square, or constant), and that signal is fed into the DAQ assistant to make an analog output.
01-13-2015 03:14 PM
Part of your problem at least is your data flow. One thing you need to undertand about labview is that you have to be careful about the way data progresses through your program. The easiest way to make things execute in the order that you want them to is to make sure you wire the error signal sequentaly through the ins and outs of each sequential daq icon instead of having the error out of each merged together.
01-13-2015 03:30 PM
If you run the input and output processes in parallel, you have a much better chance of capturing the response. Triggering can also be your friend if your hardware supports it. Running a continuous input acquisition which is started before the output starts will assure that you capture the response although it does not tell you anything about when the output started.
General comments: You have a huge amount of duplicated code. Except for the signal source generation the code in each of the three cases seems to be very similar. Move the case structure inside the while loop and only put the parts which differ inside the case strucrture. Things like the file pathname generation and the 10/(A/D Span) calculation which do not change while the program is running belong outside the loop. Why recalculate the same thing repeatedly? You also seem to have an aversion to straight wires! Try Diagram Cleanup. At the very least do not run wires under or behind other structures where it cannot be seen how they connect.
Lynn
01-14-2015 03:53 PM - edited 01-14-2015 03:53 PM
Thanks! Putting the input DAQ assistant first in the flow allows us to capture the behavior.
01-14-2015 04:03 PM
I tried cleaning up the program as best I could. I'm sure you can tell I am new with LabView. Thanks for taking a look even though it was so messy.
The problem we are having now is that the input data lags the output data by anywhere from 30-50 ms, which seems like far too large a delay. This is when I turn the Waveform Graph to "Ignore Time Stamp". Because the generated output voltage is graphed from the waveform generator, it seems to take a while for it to progress through the program and through the hardware, thus the input voltage graph lags.
When I turn the Waveform Graph to not "Ignore Time Stamp," the signal from the waveform generator occurs in the year 1903. I've tried searching on how to change this to the current time, but I can't seem to find a way to do that, despite plenty of other people wondering about this. Is there a way to do this so we can know the time at which the generated waveform signal is actually sent to the output DAQ assistant?
01-15-2015 12:20 AM
If the timestamp is showing up 1903, you're getting the all 0's point. It works by counting seconds since that point. You'll want to take a look at how you're setting your timestamp.