LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Would like to extend and sync the time in plots

Hi,

 

I am working on a VI where we are plotting multiple pressures and flows from cNI-DAQ. We can surrently display, and export to excel, 1 second of data points at a time. I would like to increase this to 2 or 3 seconds. I have looked but haven't found the place to do this. Also, I have noticed that the pressure plots are all synced in time, however the flows are not. Is there a way to sync this?

 

I have attached the VI, hope you can help!

 

THanks! John

0 Kudos
Message 1 of 2
(1,585 Views)

Have you heard of the Principle of Data Flow, which governs how LabVIEW "orders" the sequence in which it executes code?  Do you realize that you have 13 loops running in parallel, which means that you don't know the order in which they run?

 

There are a number of Worst Practices (that's a term I made up, in contrast to "Best Practices") that marks your LabVIEW code as almost impossible to improve except by "starting over".

  • Everything is in one gigantic VI, which requires a really big (3000 x 3000 pixel?) monitor.
  • I didn't notice an Error Wire in sight.  Almost all LabVIEW Functions have Error In/Error Out.  Wiring the Error lines (a) helps pinpoint errors in your code, and (b) provides a way to determine serial order in isolated code blocks.
  • You rely heavily on Express VIs, and Dynamic Data Wires.  DAQmx and Arrays or Waveforms are much simpler to use and to understand.
  • You have two parallel loops, one for Pressure Transducer, one for Flow Meter.  Data Acquisition and Data Processing are in the same loop, which means that the fastest you can run is governed by the sum of all the (sequential) steps you need to take in your loop.
  • There are no user-written sub-VIs in your code.  This makes it extremely difficult to figure out what you are doing.  One gets lost and confused by the welter of wires and processes concerned with the tiny details of "how" to do it that the purpose of the code becomes unclear.

Here's a suggestion -- program on a laptop.  The screen is typically smaller than (what I'm guessing is) the monitor(s) you are using, and there's only one monitor.  Shrinking a screenful of code into a 32x32 pixel sub-VI with 4 inputs on the left (Error In on the lower left), four outputs on the right (with Error Out on the lower right), and the two top and two bottom connectors not used (well, hardly ever), will go a long way to getting your code down to the point it can be understood and better debugged.

 

Bob Schor

0 Kudos
Message 2 of 2
(1,533 Views)