User | Kudos |
---|---|
10 | |
3 | |
2 | |
2 | |
2 |
Hi All,
I've just been working with the histogram function, and as you can see it returns an error (but no error cluster....but I know thats another issue ;-)) if the Interval is wired at less than or equal to zero. I wanted to avoid this error so I quickly checked what the default was and wired my code so this was used when the input was set 'out of range'. Then I thought of an alternative way to do it - put the subVI in a case structure so that the false case is unwired....and therefore use default.
And then I thought perhaps I could suggest a third way - how about a 'constant' - called maybe [DEF] (which will adapt to the data-type of the SubVI input). This would save the user from using a case strucure or from looking up the default value for subVIs. An alternative (in some cases identical, in some not) option would be a [Do Not Update] constant.
I've thought of a few other places where this might be useful. For example I like to set my subVIs inputs to 'this connection is required'. However there are times when you would like to use the default values or the last used values. If this is the case you have to set your subVI inputs to recommended rather than required. I'd like to be able to wire up a [DEF] constant or a [Do Not Update] constant so I can have my cake and eat it too;-)
Similarly of you are updating a front-panel object from different cases (i.e. a state machine) and there is a case where you don't want the FP object updated I either wire up a shift register with the previous value or (if I'm lazy) use a local variable. With this idea just wire up the 'Do Not Update' constant and it wouldn't update the FP object.
Dave
What I'm doing:
What I'd like:
And to conclude let me quote a hero of mine:
De-fault! The two sweetest words in the English language.
-- Homer Simpson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has not received any kudos within a year after posting will be automatically declined.