06-18-2019 11:32 AM
Hello community
I am a beginner with labview ,I am writing a VI using a while loop to measure current in time and plot it using a graph. the time axis shows the number of iterations and not the time.
is it possible to plot the current with time and not with the number of iterations of the while loop in the graph?
how many iteration while loop executes per second ?
the same questions for For loop!
06-18-2019 11:51 AM
The short answer is yes, it is possible, and actually easy. Just set your DAQmx (you are using DAQmx and not the DAQ Assitant express vi, right?) to output waveform data and connect that to your chart.
06-18-2019 02:53 PM - edited 06-18-2019 02:54 PM
To address several of the points you raised:
Do you know the distinction (in LabVIEW) between a Chart and a Graph? Do you know that the Dreaded DAQ Assistant (and its Evil Twin, the Dynamic Data Wire) are "crutches" for LabVIEW beginners whom noone teaches how to use DAQmx? [And if you have to ask "What's DAQmx", then never mind ...].
LabVIEW differs from other Programming Languages in its treatment of Time (there are two whole Palettes on the Block Diagram devoted to this, the "obvious" one and the one marked "Waveforms"). You want to learn about Waveforms ...
I assume you know the difference (besides appearance) between a While Loop and a For Loop, right? ["It's just appearance ..."].
Bob Schor
06-18-2019 03:14 PM
actually I am using the DAQ assistant.
I understand that with the DAQmax it is possible and with DAQ assistant it is not.
06-18-2019 03:14 PM
Oh, yes, you need to learn the Principle of Data Flow, which deals with Inputs (to a function or Structure, like a loop), timing (of Structures and Loops), and Outputs (from functions and Structures:
A corollary of the Principle of Data Flow is that two functions that share no common input or output will (for all intents and purposes) run at the same time (or as close as the computer can make this happen). Think about this when you ask how many iterations the While Loop executes per second (use Principle #3).
Bob Schor
06-19-2019 06:24 AM
I would not say that it is impossible with DAQ Assistant, but DAQmx is much more powerful. Look at some DAQmx Analog Input examples. Also, if you haven't already, go through some basic LabVIEW tutorials.