LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elapsed Time [New]

Solved!
Go to solution

Hi can anyone help me on this please......

 

Comments and suggestions are welcomed. 

 

Regards,

NKR

 

Elapsed_time_demo_3.jpg

0 Kudos
Message 1 of 10
(3,423 Views)

NKR,

 

Your outside while loop is completely unecessary.  It adds nothing to the program.  You also don't need those compund arithmetic's on your Switch A and B booleans.

 

If you should only stop when A finishes, don't have the output from B drive the while conditional temrinal.  Just wire A's elapsed state to the While condition.  This way if A is shorter than B, the while loop stops before B finishes.  If A is longer, B will finish and the loop will continue until A is done.

0 Kudos
Message 2 of 10
(3,412 Views)

Hi,

 

Thanks for your feedback - I tried and the only thing is NOT working as expected is; when A is longer and B is shorter, I don't get any HIGH output to tell me SPRING OVER CHARGED has occured. I only get SPRING CHARGED after timer A completes. Do you know why this is happening?

 

Thanks,

NKR

0 Kudos
Message 3 of 10
(3,402 Views)

I can't tell if you have auto reset enabled.  If so, you don't want it enabled, as you will only see the indicator blink.

0 Kudos
Message 4 of 10
(3,397 Views)

Sorry, I was looking at your numeric, not the boolean.  Move the booleans into the while loop.  There should be a boolean output that time has expired.

0 Kudos
Message 5 of 10
(3,396 Views)

If you want help, attach your actual VI, not just a picture. Thanks.

 

  • Your VI makes very (very!) little sense.
  • If you only want to stop the loop when both timers have elapsed, change the logic to AND insted of OR. (we also need to know some express settings that we cannot tell from the picture)
  • If you want to update indicators during loop execution, they need to be inside the loop. Since they are outside the loop and the outer loop never completes, they will never show anything interesting.
  • What is the purpose and value of "switch A"? What is its mechanical action? Under what conditions is is pressed?
  • There is a logical NOT function, no need for weird constructs using compound nodes with inversions.
  • Your boolean logic on the right is just plain silly. You "NOT" the wire going to the lower LED twice, same result as wiring directly to the shift register. If you do "A or NOT A" it is always TRUE, so ANDing it with the upper value will always give you the upper value. All code to the right has no purpose!

I think all you need is a single while loop and a case structure representing the various states. The do a simple state machine. Try it!

0 Kudos
Message 6 of 10
(3,384 Views)

Hi, the actual VI is attached.

 


 

If you want help, attach your actual VI, not just a picture. Thanks.

 

  • Your VI makes very (very!) little sense.
  • If you only want to stop the loop when both timers have elapsed, change the logic to AND insted of OR. (we also need to know some express settings that we cannot tell from the picture) - I tried AND gate but it was not working.
  • If you want to update indicators during loop execution, they need to be inside the loop. Since they are outside the loop and the outer loop never completes, they will never show anything interesting. - Okay, I agree.
  • What is the purpose and value of "switch A"? What is its mechanical action? Under what conditions is is pressed? - Not it is not mech action. The conditions is set by another logic function which I have not included yet.
  • There is a logical NOT function, no need for weird constructs using compound nodes with inversions. - what I was trying to achieve is; the moment you hit the run button I don't want the program to run immediatelly, I want the button to start it.
  • Your boolean logic on the right is just plain silly. You "NOT" the wire going to the lower LED twice, same result as wiring directly to the shift register. If you do "A or NOT A" it is always TRUE, so ANDing it with the upper value will always give you the upper value. All code to the right has no purpose!

 

0 Kudos
Message 7 of 10
(3,347 Views)

Try the attached.

 

I still don't understand why you need two timers. You could eliminate the timer B and simply compare the elapsed time of A with the time target of B and turn the LED ON if the elapsed time is greater. (not implemented)

 

 

0 Kudos
Message 8 of 10
(3,340 Views)
Solution
Accepted by topic author nkrajoo

altenbach wrote:

I still don't understand why you need two timers. You could eliminate the timer B and simply compare the elapsed time of A with the time target of B and turn the LED ON if the elapsed time is greater.


I meant like this.

0 Kudos
Message 9 of 10
(3,339 Views)

Hi, I agree it works as intended. Thank very much! 

0 Kudos
Message 10 of 10
(3,301 Views)