LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop – can active and pause time deviate from each other?

I’m able to adjust the cycle time while it is running, but I want to differentiate the time the valve is open vs. closed.  That is the valve might end up being open for several seconds and then closed for a longer period of time.  The attached VI is LabView 7.1

0 Kudos
Message 1 of 13
(3,455 Views)
Simplest solution: just use another switch and and select between the two timer values.
0 Kudos
Message 2 of 13
(3,447 Views)

I have a manual switch now, but haven’t figured out how to automatically cycle it between the two paths.

0 Kudos
Message 3 of 13
(3,427 Views)
Sorry, I no longer have LabVIEW 7.1, but here's one very simple possibility.
 
You are making serious mistakes, for example you should never put indicators inside case structures, or they will only show one state. The other state never gets updated because the case is skipped.


Message Edited by altenbach on 03-20-2008 02:19 PM
0 Kudos
Message 4 of 13
(3,423 Views)

Thank you very muchSmiley Happy  I converted it over to LabView 7.1 and it works great, but then realized I may have painted myself into a corner now since this will be apart of a larger VI running in parallel.  Or maybe I need to put the larger VI within this timed loop, but then I notice that the time clock is only intermittent.

0 Kudos
Message 5 of 13
(3,411 Views)

I tried putting everything into a while loop and noticed the same issue.  Would a sub-VI be helpful so that the clock displayed time second by second rather then updating it sporadically?

0 Kudos
Message 6 of 13
(3,405 Views)

Hi nonenanone,

I'm not sure if I am understanding the question. Would you mind elaborating a bit more on: "I tried putting everything into a while loop and noticed the same issue" ? Also, I'm noticing in your VI that you have two separate timestamp VIs. Are you just using those to compare the two values or is there another reason for having two? Also, what do you mean by updating it sporadically? Hopefully, with some of these answers, we can help guide you to a solution! Thanks!

National Instruments
Applications Engineer
0 Kudos
Message 7 of 13
(3,390 Views)


nonenanone wrote:

Or maybe I need to put the larger VI within this timed loop, but then I notice that the time clock is only intermittent.


If you want a continuously running time clock, you need to put it in a parallel loop. I am not sure why you also use the "get time/date string" since you don't use it's output it has no purpose. Your timestamp display is already formatted to display seconds.

nonenanone wrote:

 tried putting everything into a while loop and noticed the same issue.  Would a sub-VI be helpful so that the clock displayed time second by second rather then updating it sporadically?


You can't just randomly add loops and hope that the code miraculously fixes itself. Whatever you are doing makes no sense. Have you tried running the code in execution highlighting mode? Dataflow determines when an indicator receives an update. if your loops runs only every 5 seconds, the time display only will update to the current time every 5 seconds.
 
Again, if you just want a clock display that updates every second, make a parallel loop that with a one second wait and update the time display in it. It will run independent of your timed loop.

0 Kudos
Message 8 of 13
(3,385 Views)

Hi guys, I’ve made some progress in my understanding since I last posted and I’ve included a little more activity in the VI below so it will make more sense.  I’ve play around with more than one version.  In this one the clock works fine until I begin to cycle the valve and the time updates only during each cycle of the valve.  Also, the cycle off valve time is not right in the execution.  I’ll look into a parallel loop.

0 Kudos
Message 9 of 13
(3,377 Views)
This one is a little better.
0 Kudos
Message 10 of 13
(3,373 Views)