LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Pressure

Hello,
 
I think part of your timing problems may be caused by redundant code. Having the elasped time and wait (ms) in the same loop with the same 10msec is extra code you don't need. If you wait 10msec in the loop, you can just wire a true constant to the stop terminal. For that matter, you don't even need that part of program in a while loop at all, unless you intend to keep that feedback node. You could accomplish the same thing with a flat sequence structure and a Wait (ms).
Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 11 of 15
(809 Views)

Hi Charlie,

Yes you are right ...but how can I generate that ramp as per the rate using flat sequence...and the problem I am getting with the counter(which increases using feedback node) does not reinitialise to zero even when I use invoke node for reinitialize to default....it starts with its previous value...so how else I can make it zero after I reach my set point.

 

Regards

0 Kudos
Message 12 of 15
(801 Views)
Hi James,
 
What I meant by the flat sequence structures is that in one of your previous posts you had a while loop nested inside another while loop. The way you have the while loop programmed, it would only execute one iteration per iteration of the larger loop. Thus, you could accomplish the same thing by have a flat sequence structure inside the larger while loop instead of a while loop inside a while loop. (Whew! That's a lot of loops!) This won't get you any performance gains, however, you you can just leave it as a while loop with a true constant wired to the stop condition if you like...
 
Instead of using a feedback node for your counter, you could use a shift register. That way, whenever you want to re-initialize, you can just wire a zero to the right side of the while loop. You can use a case structure (or whatever logic you prefer) to determine when you wire a zero and when you don't. For example:
 
 
Hope this helps!

Message Edited by Charlie S. on 08-14-2006 06:13 PM

Message Edited by Charlie S. on 08-14-2006 06:14 PM

Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 13 of 15
(773 Views)
0 Kudos
Message 14 of 15
(523 Views)
0 Kudos
Message 15 of 15
(509 Views)