LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous execution with While Loops and Timed Loops: troubleshooting and advising

Hello, all,

I realize this may be too large of a topic to handle on the forum, but please bear with it; any and all advice and suggestions are greatly appreciated.
I was introduced to LabVIEW about two months ago and, after some tutorials and self-teaching, inherited this program for the lab I work in. Basically, as far as I can tell it runs a GC (gas chromatograph) that takes samples from four pre-run analog inputs and a run analog input, graphing the latter. Originally, the program consisted of a timed loop (following the defining of variables, which is the same) with two frames, one before a GC run in which the four analog inputs were taken, and a second one which contains all the GC programming and other analog input reading. My goal is to get the analog readings (and operation of certain valves, which are all in the same loop) to run constantly, taking readings or adjusting for a varied valve value every thirty seconds, while keeping the GC programming such that it waits a given time in between runs (as before) and then executes. I separated the analog inputs into their own while loop and placed it evenly with the timed loop that has the wait time followed by the GC programming, and though the analog readings now work all the time, not just before a run, after the wait time is up, the GC programming fails to engage – when I run it and highlight steps, the second frame in the timed loop lights up, but the Detector V (other analog input) doesn’t take readings and there is no graph. If I disable or delete the While Loop, the Timed Loop works, but obviously I don't get the four analog inputs or valve adjustment abilities. Is this a timing issue? Is the while loop altering things? I’m still new to this, but again, any and all help would be great. Thanks!

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

This looks like a horrible mess and there is no way to troubleshoot this from a 14+MB (once uncompressed!) 2786x1810 size bitmap picture. There are a lot of hidden wires so there is no way to really tell what's going on. It is always better to attach an actual VI

 

There is a time loop inside a time loop, timing code (wait) inside a time sequence that has a potentially very long wait in the first frame, a parallel while loop running at a rate of once every 30seconds. This is way too long to stall parts of the code, because there is no way to intereact with it. 

 

You probably should start from scratch and implement a clean state machine architecture instead.

0 Kudos
Message 2 of 2
(2,158 Views)