06-22-2007 12:43 AM
06-22-2007 01:45 AM
I can't look at your code, but what you want is the event structure. You register a value change event for those controls and then you will have code which will execute only when their value will be changed by the user. You can find some examples in the example finder (Help>>Find Examples)
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
06-22-2007 02:12 AM
Hi tst,
Thanks for suggestion I will definatly go through it. But at present can please tell me how to know the mouse click event for control. I am using base version 8.2 in which event structure is not provided? Please help me out.
Thanks:=-
Mike
06-22-2007 02:46 AM
@MikeMike wrote:
I am using base version 8.2 in which event structure is not provided
That's a problem. Most of us are so used to events by now, that we forget they are not available in the base version (which in general seems fairly crippled).
I'm attaching a quick example (showing two ways of detecting changes), but this would turn ugly for a larger VI with more controls. If you want to do this with individual controls, you can build their values into an array. You can also use their references and run the code in a subVI, so that your UI VI is not too big.
06-22-2007 02:51 AM
Also, this is how it would look using events. Much better.
BTW, usually select all buttons have three states - none, partial and all. When the user selects or deselects some of the options, the button goes into partial mode and that way it can also be used for deselecting all the options.
06-22-2007 05:09 AM
tst,
I tried without Event structure, seems to be pretty much difficult...
Can you please post the same thing done without ES ?
I tried different types of coding, including SRs, Array of booleans, then 10 Buttons built into as Array [as described by the original poster], etc... but in vain. ![]()
I think that without ES, it is almost impossible. Now, a strong reason why ES are so handy in LabVIEW programming.
Can you please help ?
06-22-2007 05:17 AM
Hi tst,
Thanks for the help. I think this Events.llb I can use in my application. I will let you know if any problem comes across.
Thanks:-
Mike
06-22-2007 06:01 AM
@parthabe wrote:
Can you please post the same thing done without ES ?
Look at reply #4. As you see, it's considerably less elegant, although there are probably better ways to handle this.
Mike, you can get this to work with a cluster of booleans by using Cluster to Array and Array to Cluster (you have to right click that one and set the cluster size). After converting you can type cast the cluster to your cluster to get the proper names.