From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-03-2012 06:10 AM
Hi,
I want to filter unwanted numbers who occur when switch between different values.
I have 5 buttons which are all interconnected to disable the others when one of them is activated (using Set/Reset mechanism). The boolean of each button are sent into an array which is converted to an integer. The values I need as numeric outputs are 1,2,4,8,16. When I change values from e.g. 1 to 4, it will be in the sequence of 1 -> 5 -> 4. This is cause by the fact that for a very short time, two arrays are True.
In other words, I need to filter out the number 5 and all other values which are not 1,2,4,8,16 and only pass on these values. It also have to work in the opposite direction, e.g. 4 to 1.
.
Any thoughts?
/Johan
Solved! Go to Solution.
08-03-2012 06:22 AM
08-03-2012 06:27 AM - edited 08-03-2012 06:29 AM
...or, this:
This isn't what you asked for, but it does what I think you want, is easier to scale and easier to operate on the front panel.
08-03-2012 06:31 AM - edited 08-03-2012 06:38 AM
The values are indeed used in a case structure. However when any number which is not 1,2,4,8,16 occur, it returns the default case. This is what I want to prevent.
I like the solution with radiobuttons, but I'd rather keep my current panel layout with buttons. Thanks though!
EDIT: added reply
08-03-2012 07:39 AM
This might do.
Regards Florian
08-03-2012 08:14 AM
Can you please explain what you did? I don't recognise the symbol.
08-03-2012 08:36 AM
That is a feedback node. It holds a value and returns it the next iteration. It works the same as a shift register. So what Florian did is if you have an invalid number, return the previous number.
08-03-2012 09:52 AM
Exactly what crossrulz said.
I'm sorry for not explaining right away.
Regards Florian
08-03-2012 10:28 AM
Thank you both very much!
Can't seem to get it to work though. I've made an example VI to illustrate the problem if you're interested. When you switch the buttons you will see that there is an intermediate step to the default case before it shifts.
08-03-2012 12:17 PM
Why not use a radio button? It automatically does the set/reset function and outputs a numeric.
Lynn