04-09-2010 03:58 PM
I would like to link a number of boolean control buttons in an array without grouping them on the front panel the way it does when you make an array and then put in a boolean control.
Here's the background:
I have 8 linear motors controlled by CANbus, and so each button type (Move, Stop, Home, etc) is duplicated 8 fold. I have an event structure that is currently triggered with a separate case for EVERY button with only a very small difference in the code inside each case. Ideally I could have the buttons in arrays and then check the new array value against the old value on a value change event. The alternative for me is to have each case handle the 8 buttons (with a Mouse Down? filter event) and then use the Boolean.Text value from the CtlRef and search an array of all Boolean.Text Values for the 8 buttons to see which name matches and process accordingly. I have something like 200 buttons, so making the arrays of Boolean.Text values from the reference nodes is WAY too time consuming as I have to go through like 5 levels of right click menus. Any suggestions?
04-09-2010 04:16 PM - edited 04-09-2010 04:19 PM
Mark,
You might consider using clusters on the front panel. Create a type def'd cluster that has all the boolean controls for 1 channel. You can drop 8 of these on the front panel and the event structure can detect a change in a cluster. Easy to convert cluster to array behind the scenes. Remember that order of cluster determines index of value in array.
04-09-2010 04:20 PM
No. You could create an array of references to all of those controls.
Unless someone has some clever ideas, I think you are going to need to use the method you are doing now.
But to assist in creating these arrays, there a number of scripting tools you can use to get rid of the tedium of creating these arrays. Check out the JKI Right Click Framework.
04-09-2010 04:42 PM
Hmm. Is it possible to hide the cluster shell so that the items will be considered clustered on the block diagram but be separable and distinct on the front panel? That could work.
04-09-2010 04:49 PM