LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop

hi, can someone help me with this issue..
i am trying to do temperature cyclying..
i have this vi i created...
i wanted to change the temperature once i finished a pressure cyclying sequence..
can someone give me any idea/sugguestion on how to do this?
i want something like..
temp @ 37, pressure cycle
then to
temp @ 42, pressure cycle
then to
temp @ 35, pressure cycle



Message Edited by krispiekream on 04-28-2008 01:30 PM
Best regards,
Krispiekream
Download All
0 Kudos
Message 1 of 16
(4,065 Views)

Hi krispiekr...,

you can use your sequence like you have it now and add an for loop around it. See the attached picture. Hope it helps.

Mike



Message Edited by MikeS81 on 04-28-2008 08:33 PM
Message 2 of 16
(4,059 Views)
i tried that..
but everytime, the next temp is 0, and not 42..



Message Edited by krispiekream on 04-28-2008 03:16 PM
Best regards,
Krispiekream
0 Kudos
Message 3 of 16
(4,031 Views)
You did not understand Mike's code. Mike was using an autoindexed for-loop to replace your method, which was completely Rube Goldberg. What's inside the for-loop is what you do for a specific temperature. I'm not sure why Mike has a while-loop that runs just once inside the for-loop, but that's another story. You just copied your sequence into another loop inside your outer while-loop. The inner while-loop runs only once since a True constant is wired to the loop terminal. Right now your code has no indexing being performed for which temperature you're at.

It seems to me that you need to refresh on the concepts of while-loop, for-loops, and auto-indexing.

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
Message 4 of 16
(4,017 Views)
thank you so much guys,
everything is working..
the method and suggestions you gave worked.



Message Edited by krispiekream on 04-28-2008 05:22 PM
Best regards,
Krispiekream
0 Kudos
Message 5 of 16
(4,001 Views)
Please don't embed images that are wider than a typical window. It blows the margins.
Message 6 of 16
(3,986 Views)
Another thing: Try stop using (locale) variables and sequencestructures. They are ugly to read and maintain, and regarding the locals, exposed to race conditions. Race conditions can alter your dataset in an unintended way, leading to strange behaviour and instability of your application! In your screenshots, the way locals are used, are eating up memory making your application unneccessarily large and perharps slow.

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 16
(3,950 Views)
Hi krispiekream,

one more note: It's also critical to compare floats for equality (even when it might be ok in your case).
Why don't you just compare the index values instead of indexing "TempStart" twice?


Message Edited by GerdW on 04-29-2008 11:26 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 16
(3,940 Views)
thanks for all the wise advices..
i try to get the program to work before i clean up my codes..
i have alot to learn..
i made this vi..
i start with 37 temp..
cycle loop..
then once a temperature wait temp is not on...i will change to the next temperature..which is 42..
then cycle loop..
then once i hit the last temperature.....i never got to test with the last temperature because my while loop ended..
can you give me sugguestion to let me run the last temp at 35, then end the program?

Best regards,
Krispiekream
0 Kudos
Message 9 of 16
(3,895 Views)
i try to use less local variables, but i am modifying a really complicated program because it have too many local variables and local sequences...
its hard for me to keep up with the go around...
i think i should take my time when i do have time to go over those tutuorial sessions smeri..... mentioned..

Best regards,
Krispiekream
0 Kudos
Message 10 of 16
(3,890 Views)