LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having strange action with case structure on a timed loop.

Solved!
Go to solution
Had one question solved yesterday, lead to a new problem. In this VI, I have a count down timer that triggers an external counter. The counter "counts" 1 to 24, each having an action at a particular instant. However, once I got the timer and counter to work, I found that the boolean trigger stayed on for the enitre hour, and my action was repeated multiple times instead of a single shot. So, I altered the counter to count 0.1 each interval, rather than 1.0, thinking it would only allow my state cases to function for a shorter window. However, when I run the VI, the state cases are active around the interval, not at the interval. For instance, stae case 2 is active between iteration 1.5 to 2.5 and iteration 2.5 throguh 3.5 state case 3 is active. Can anyone suggest how to get either 1)better resultion on th state case or 2)a differnt way to fire the boolean value for only a few seconds?
0 Kudos
Message 1 of 12
(3,787 Views)

ASAT, would you mind telling me which version of LabVIEW you're using?  I started looking at your previous posts but wasn't sure. 

 

I think I've got a solution for you, but I can only give you a VI saved in LabVIEW 8.2, 8.5.x, or 8.6. One question, however:  do you absolutely need your Booleans to be true for a few seconds, or can they just come on momentarily?  ("One shot?" )

 

Jim

Message Edited by Mr. Jim on 12-02-2008 11:37 AM
Message Edited by Mr. Jim on 12-02-2008 11:37 AM
0 Kudos
Message 2 of 12
(3,770 Views)

I don't see any "timed loop" structure and I have no idea what you mean by "boolean trigger" in the context of your diagram.

 

Could you clarify?

0 Kudos
Message 3 of 12
(3,764 Views)

Jim,

 

It is very easy to tell what version of LV a posted VI is for.

 

Open the VI.  If it opens, the version you are using is equal to or newer than the one in which the VI was last saved.

Close the VI.  When the "Save changes before closing?" dialog pops up, select the List Unsaved Changes link.

The list will tell you if the VI was last saved in an earlier version.

Cancel the Close operation.

 

ASAT's VI was saved in LV 8.2.

 

Lynn 

0 Kudos
Message 4 of 12
(3,762 Views)
Solution
Accepted by topic author ASAT

Thanks, Lynn.  Yep, I tried that (at least half of it.)  I opened it in my earliest version installed, which happens to be 8.5.1.  I didn't think to check in the unsaved changes dialog, though.  I sort of feel sheepish having never tried that before.  Smiley Sad

 

 

Well, here's my interpretation of what was asked for... I had to make a few assumptions, namely that the "timed loop" refers to the while loop that's executing at a set interval, and that the "triggers" are just the Boolean indicators.

 

Hopefully this at least partially answers the questions?

 

Jim

Message Edited by Mr. Jim on 12-02-2008 11:56 AM
0 Kudos
Message 5 of 12
(3,754 Views)

Sorry for the delay, I just returned to my desk. To fill in the blanks, I am useing 8.2 pro-dev. With regards to this VI, this is a piece of test code that is going to be inserted into a much larger program. The boolean  LEDs would be attached to a series of subVIs that swing valves and read analog output. Essentially the original intent was to have a timer that would count down over a period of 24 hours. At particular intervals (ie 1,9,17 hours) a true statement would be shot over to a subVI to activate a series of steps (different that 2,4,6...22). The first problem was that the subVI was supposed to only execute 1 time per interval, but the "True" state was held for an hour, and thusly made the subVI execute numerous times. So, I tried to cut the interval down into fractions of an our, but now the hysteresis in the original VI caused a lot problems in the larger code.

 

So, a one shot would work great, I hoave no idea how to code that. Or if I could get the true statement to only activate for a few seconds when commanded, that woudl work as well.

 

Thanks for the help, I appreciate the input.

0 Kudos
Message 6 of 12
(3,728 Views)

Hi ASAT,

 

I think the VI I posted should do what you want it to do.  Certainly let me (or anyone else) know if you still have questions about how it works...

 

Jim

Message 7 of 12
(3,726 Views)

Hey Jim:


THanks for  the help (as well as everbody else on the list). This VI works. I had to prove it out to myself a few times. As long as the subVI completes before the programmed interval time, everyting stays synchronized. I got a little confused when I was testing it out and had the interval set at a time less than the overall execution of the sub VI, and the whole execution fell out of sync.


Thanks again

Cheers;
Sig.

0 Kudos
Message 8 of 12
(3,705 Views)
I'm glad it helped you out, ASAT.  Good luck!
0 Kudos
Message 9 of 12
(3,700 Views)
Ok, how do you un-solve. I meant to click on your tab.
0 Kudos
Message 10 of 12
(3,699 Views)