LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Visit the LabVIEW Wiki Application Design & Architecture Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Loop execution condition question, I am a noob
ironcross77
post Feb 14 2007, 03:00 AM
Post #1


One hit wonder!


Member
Posts: 1
Joined: 9-May 06
Member No.: 4963
LV:7.0
India India India


Hi I have a temperature measurement vi running inside a for loop. I want the loop to execute only when the present value of teperature is 5 degrees or more than the previous value. I am storing values using shift registers.


here is my block diagram. I am a noob so give me step by step instruction please

This post has been edited by Michael_Aivaliotis: Feb 14 2007, 04:19 AM
Reason for edit: Changed Image to Attachment.

Attached thumbnail(s)
Attached Image
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Feb 14 2007, 03:00 AM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Jeff Plotzke
post Feb 14 2007, 03:27 AM
Post #2


Very Active
***

V I Engineering, Inc.
Posts: 131
Joined: 8-February 06
Member No.: 4078
Using LabVIEW Since:2002
LV:8.20 ,8.0 ,7.1
United States us_michigan Nothing Selected


QUOTE (ironcross77 @ Feb 13 2007, 10:00 PM) *
Hi I have a temperature measurement vi running inside a for loop. I want the loop to execute only when the present value of teperature is 5 degrees or more than the previous value. I am storing values using shift registers.


The easiest way to do this is probably to have a while loop around your acquisition -- Have it exit the while loop when the value is 5 degrees more than the last time the loop exited. I'm assuming that you're acquiring the temp signal in the "LJ EAI" VI towards the top of the loop. Inside that VI, where you actually do your DAQ read, make this VI wait until temp is achieved.

However, two warnings to watch out for:

-You'll need to make sure you synchronize with the other VIs in your top-level for loop. As it is right now, it's undetermined if the top "LJ EAI" VI will run before the bottom one. You'll want to use a wire to make sure that the bottom executes after the top is complete.
-While you're doing the acquire and waiting for temp to become greater than 5 degrees from the last reading, this loop may run forever if the temp never rises. You'll need to implement a way to ensure that this loop will stop (A notification from the top-level will work, or something similar)

Note: You could put a while loop around the top "LJ EAI" VI assuming that all that VI is doing is acquisition of your signal.

I've attached a quick screenshot of what your acquisition would look like.
Attached image(s)
Attached Image
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 22nd November 2008 - 05:08 AM