LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why does a while loop not start in a flat sequence if I have another while loop running in a different flat sequence?

Solved!
Go to solution

Hi all,

Basically I am controlling many devices sequentially and for that pourpose I have created a flat sequence to do so. Also, in certain moments I have to start the measurements with the potentiostat I am using which also follows a sequence and I created a second flat sequence to do so. In a part of my experiment I want to monitor the voltage and current of a high voltage power supply which is in the main flat sequence and also read the results I am obtaining with the potentiostat  simultaniously. 

 

In the main sequence there is a bollean constant that triggers the beggining of the secondary sequence. In the frame after such boolean contant I have a while loop in which I read 2 analog inputs of the high voltage power supply with my USB-6218 for a certain time every 100 ms. My problem is that the boolean constant effectively starts the secondary flat sequence but when it reaches a while loop in which I keep reading the results of the potentiostat, for any reason that operation does not start until the while loop placed in the main loop is not finished. 

 

I comunicate with the sotware of the potentiostat through a driver made by the manufacturer. 

 

Is it possible to read analog input with USB DAQ and simultaniously read the results of the potentiostat?

 

Thank you very much

0 Kudos
Message 1 of 6
(3,509 Views)
Solution
Accepted by rodriferfe

Without being able to see the code, one can only speculate. My guess is that you probably have some data flow to the second loop that depends on the first loop finishing.

Message 2 of 6
(3,490 Views)
Solution
Accepted by rodriferfe

I bet the data flow is forcing the order of execution you do not like.

No element can start untill it has values on all input tunnels. No element produces value on output tunnel untill it completes its job. 

Element is anything: structure, loop, subvi, wire.

Turn on highlight execution and you will see why it is stuck.

Message 3 of 6
(3,465 Views)

Suppose I asked you why my C++ program ran one function, but failed to run the other.  You'd probably say "Show me the code".  See if you can draw any analogy with your question and our ability to answer you.  And if you choose to "show us the code", attach the VI, itself, not a picture of part of the VI.

 

Bob Schor

Message 4 of 6
(3,459 Views)

@rodriferfe wrote:

 

 

Is it possible to read analog input with USB DAQ and simultaniously read the results of the potentiostat?

 

 


Absolutely! With a good architecture, you can do a lot of stuff in parallel in LabVIEW. What you want to do is actually something i would call a strong-point of LabVIEW. Like the others said, we need to see your code to tell you exactly what is keeping your loop from executing.

 

If you cannot share your code because it is top-secret, you will have to create a small, stripped-down example that illustrates your problem. Actually, it is very useful to create the stripped down example that doesn't rely on hardware. Often you will catch your mistake in the process, and at the very least we will all be able to run the stripped down example because you would take out any hardware communication (assuming it is not a hardware problem).

0 Kudos
Message 5 of 6
(3,446 Views)

Many thanks to all of you guys.

 

You were right. After having a look to your answers I revised my diagram block. In the main loop I have a elapsed time which last the "separation time" i need and I stop the while loop when the time has elapsed whith the boolean output. The thing is that I was using this very boolean output to stop both while loops and that is why the second loop was not starting. I have removed this dependency and put 2 different elapsed times and everything is working. 

 

Thank you very much

 

Message 6 of 6
(3,406 Views)