ironcross77 Posted February 15, 2007 Report Share Posted February 15, 2007 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 Quote Link to comment
Jeff Plotzke Posted February 15, 2007 Report Share Posted February 15, 2007 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.