LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching State with Boolean Button Press/Counter/Timing

Solved!
Go to solution
Solution
Accepted by topic author tuyenhoang7

This seemed to work pretty well and is easy to modify for different timing/boolean states.

 

Use a producer/consumer-ish design but with a DVR instead of a Q. Consumer loop reads the DVR every 5 ms and updates the booleans as needed. Producer mostly just waits for the user to trigger, then we set lines 3 and 4 high, use the structure of the in place element to pass a wire through to a wait, then not lines 1 and 2.Capture.PNG

Message 11 of 16
(1,773 Views)

Wow, this looks great, though a little more involved than I had thought. Would you mind sharing this .vi with me, so I can play around with it?

 

Thank you

0 Kudos
Message 12 of 16
(1,742 Views)

Sorry I was busy at work all day. Here is the code LV2014

 

0 Kudos
Message 13 of 16
(1,724 Views)

Thank you so much for this, your code is great, and does what I described. I need to have state 3 and 4 ON a little later however, after state 1 (or state 2) is ON, instead of before. I attached a picture showing the change. On the left is what your code is doing. On the right, is what I need to change it to. I tried figuring it out myself, but I have a feeling that I have to change the order in which the inputs are going to, and I was not sure how to proceed.

 

Thank you, you have been very helpful.

0 Kudos
Message 14 of 16
(1,697 Views)

That's an easy fix, expand the index array terminal on the first in place element structure and NOT lines 0 and 1, then remove the NOTs from the second in place element structure.

Message 15 of 16
(1,684 Views)

Awesome man, that fixed it for me. Elegant solution, and easy to modify. I learned a lot from it also.

Thank you again! I marked it as a solution, plus kudos to you!

0 Kudos
Message 16 of 16
(1,673 Views)