FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting a Boolean button

I have a electric 6 position valve that operates using two contact closure; one to step to the next position and a second closure to more the valve to the home or first position.  I have been using the compact fieldpoint relay to control the valve using a push button Boolean set to switch until released.  The  valve offers no feedback to the position it is currently in. I have to count to figure out what position the valve is in.  I tried to convert the Boolean to an integer but when I release the button the integer goes back to zero.  How can I count the number of times the button has been true and then reset the count using a second Boolean button? 

 

Cheers

 

Danny

 

Danny
0 Kudos
Message 1 of 3
(6,034 Views)

Danny,

 

Best way to keep track of something like that is with a shift register.  I've attached a simple example.  Depending on how your code is structured, it may be advantageous to implement the shift register in a 'Functional Global Variable'.  http://decibel.ni.com/content/docs/DOC-2143

Message 2 of 3
(6,021 Views)

Centerbolt, 

 

Thank you for the help.  That should work great for my application.

 

Cheers

Danny
0 Kudos
Message 3 of 3
(6,000 Views)