ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor 1D Boolean 8Bit array for Changes

Solved!
Go to solution

HI;

 

In the attached VI, I'd like to continuously monitor the the 8 switches (1D 8-bit Boolean array) for any changes in value and which switch changes.

 

I'd also like to clear the switches on Stop.

 

Any suggestions?

 

Thank you.

 

 

4BoysDad

 

 

0 Kudos
Message 1 of 17
(4,116 Views)
Solution
Accepted by 4BoysDad
Message 2 of 17
(4,109 Views)

Could you please explain how to create that VI invoke node?

 

And why you choose invoke node instead of property node?

 

Thank you

0 Kudos
Message 3 of 17
(4,097 Views)
  • Place an invoke node from the palette, right-click the top and select class :VI server...VI..VI.
  • Click the method and select defautl value...initialze to default

 

This will do it for all controls and indicators on the front panel in one step. Seems easier. :D. 

Message 4 of 17
(4,083 Views)

Of course you can further simplify your code dramatically if you would use an array of switches on the front panel instead of 8 seperate switches. Make the array size 8, all false, and make this the default. 

0 Kudos
Message 5 of 17
(4,081 Views)

Thank you altenbach. Have a nice holiday!

0 Kudos
Message 6 of 17
(4,059 Views)

Thank you for the suggestions.

 

How might one capture which of the switches changed value and the associated value? I think I could use a switch that holfd its True (selected) value only so long as the switch is held. I would need this switch type to get back to the feault state automatically. What do you think?

 

 

4BoysDad

0 Kudos
Message 7 of 17
(4,021 Views)

@4BoysDad wrote:

How might one capture which of the switches changed value and the associated value?


I don't understand what you mean by the rest of your comment, but to find the changed boolean, simply do a "not equal" comparison in "compare elements" mode and search for TRUE. If the result is not negative, use "index array" to find the new value.

 

Here is a simple example.

0 Kudos
Message 8 of 17
(4,011 Views)

Thank you.

 

What if I had a refnum to the 1D 8 bit boolean array? 

 

I assume I would use a similar technique if not the same technique.

 

 

4BoysDad

 

 

0 Kudos
Message 9 of 17
(4,007 Views)

Yes.

 

(You can always have a refnum, but why would you use one at all here?)

0 Kudos
Message 10 of 17
(4,003 Views)