LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timing

Hello,
I am a biochemistry student and have been working with Labview for only few months with no professional background in electronics. I have a problem with displaying voltage vs time graph in Labview 7.1 using Cont Acq&Graph Voltage - Int Clk.vi example.
I am using a function generator as a voltage source that runs through oscilloscope and feeds into NI USB-6009 analog input. Amplitude scaling on a waveform is correct, however the timing is does not match with timing on oscilloscope graph. Labview waveform graph generates the number of samples for timing instead of seconds, where 1000 samples = apx 0.1 sec of realtime. Am I missing something fundamental here? How can I generate voltage vs real time graph on LabView, identical to oscilloscope graph?

Regards,
Vitaliy

Parameters:
Lablew 7.0/7.1
eMac OS X; G4 processor

Message Edited by kapishon on 01-15-2008 12:21 PM
0 Kudos
Message 1 of 9
(3,170 Views)
I guess the way that I would handle this problem would be to plot the waveform to an X Y graph. I would pull the "t" time component for the X and the "X" voltage component for the y. This will give you the timing that you are looing for. you may have to reformate the time to the units that you are looking for.
Tim
GHSP
0 Kudos
Message 2 of 9
(3,165 Views)
kapishon,

I don't have the example you mentioned for LabVIEW 7.1, but my 8.5 version of it seems to display the correct date and time on the graph.  On the block diagram, the DAQmx read is set to return a 1D waveform.  This waveform contains timing information, which is sent to the waveform graph.  The X-axis of the waveform graph is set to display in an absolute time format (Right-click the graph and go to it's properties, then to the Display Format tab).

Does your version of the VI differ from the above description?
0 Kudos
Message 3 of 9
(3,129 Views)
Devin,
As you see from the snapshot DAQMX read is set for 2D. Changing it to a 1D results in error between 'samples per channel'and 'DAQMX read' and also a signal loss. If I change timing to an absolute it still gives me incorrect time. Could it be a counter problem in NI USB-6009? Any chance I can get a snap shot of 8.5 Voltage vs Time example diagram
Download All
0 Kudos
Message 4 of 9
(3,103 Views)
Timothy,

Thanks for advise. I am trying different ways to run data from DAQMX read against real time and plot it on XY graph. Nothing works so far. From a diagram, am I anywhere close to getting there?

Regards,
Kapishon
0 Kudos
Message 5 of 9
(3,090 Views)
kapishon,

Here is a screenshot and the VI in LabVIEW 7.1.




Message Edited by Devin_K on 01-17-2008 01:38 PM
Download All
0 Kudos
Message 6 of 9
(3,089 Views)
While opening your attached VI, some VIs were not located in my library because they were requested as DAQMX... instead of DAQMXBase... (which I had to match and rename). I hope they are still same VIs. There was one component that was not located: DAQmx Read (Analog 1D Wfm NChan NSamp).vi
I only found this in vi.lib./daqmxbase/ - DAQmxBase Read (Analog 1D DBL NChan 1Samp).vi

In any case, an error [Possible reason(s):Value passed to the Task/Channels In control is invalid. The value must refer to a valid task.] comes up when I run it. Replacing a physical channel with a task does not work.

I've been using a task that I created using mxbaseconfig tool in NI-DAQmx Base as Analog Voltage Input Task [NI USB-6009: "Dev1" (USB0::0x3923::0x717B::011669B5::RAW) channel 0]. As you can see from my original diagram thats what I use to get the Voltage. Surprisinly, 'Dev1/ai0' value in 'physical channel' results in the error above, eventhough its the source of my task. Is there anyway to work with a task instead of a physical channel?

Thank's a lot Devin
Download All
0 Kudos
Message 7 of 9
(3,075 Views)
kapishon,

The differences we are seeing are because I am using DAQmx, and you are using DAQmxBase (which you need to use, since it seems you are using a Mac).  The error you are receiving is due to the fact that my code created a channel without first creating a task (which is allowed in DAQmx, but not DAQmx base).  Creating a task before creating the channel should solve the problem.  See the following article for more details: NI-DAQmx Base Error -200428.

It seems that DAQmxBase also does not allow you to use have a waveform output from your read VI.  I have modified your example to show how to create waveforms from the 2D array output of your read.  It's not a perfect solution, since the timestamps will start from whenever the Get Date/Time VI is executed (which in my example) instead of being synchronized with the actual time of acquisition.  However, from the description of your application, it sounds like the main concern is to have the units displayed in proper units relative to each other, so hopefully this isn't a big deal.  One other thing to note is that you must make sure that the graph does not ignore the timestamps of the waveform.  Right-click the graph on the front panel and make sure "Ignore Time Stamp" is unchecked.

I hope that helps!

0 Kudos
Message 8 of 9
(3,060 Views)
Devin,
The modified VI works perfeclty. Timing is finally accurate. That t0, dt, y0 bundle was something that I would've never come up with by myself. Thank you very much for your thorough help and for saving my ongoing project.

Vitaliy Kapishon

0 Kudos
Message 9 of 9
(3,030 Views)