01-20-2014 01:54 AM
I'm trying to use a case structure where each case is triggered by a button press. This is simple using a numeric control, however I do NOT want the up down arrow to select the desired case. I need individual buttons displayed on the front panel (one button for each case). In the code pasted below I want to use the Case 0-4 buttons instead of the numeric control. Is there a way to modify the numeric control to be individual buttons instead of the arrow up/down control?
Solved! Go to Solution.
01-20-2014 02:00 AM
If you are working with LV 2013, you should use the "Create Project" Assistant. You will find a "Simple State Machine" there.
Please check out if you understand the code thhis assistant provides. If you don't understand it, your LV skills have to be improved. You can do this by following online tutorials as well as attending LV classes.
01-20-2014 02:01 AM
Yes, use a radiobutton control. Attach your actual VI instead of a picture if you want more specific help.
01-20-2014 02:09 AM
Assuming the buttons are latch action, you can build them into an array and serch for the position of the true element.
If the buttons are switch action and you want a case for all possible button combinations, again built them into a boolean array and then use boolean array to number.
01-20-2014 02:31 AM
Thanks, I think the radio buttons are exactly what I need. I had looked at the radio buttons earlier but but seeng them only in the Boolean menu made me think they could only be a single boolen true/false. I see now you can copy/paste more buttons.
Sorry if this question was too simple. I did spend a lot of time looking for a solution before posting believe it or not.
01-20-2014 02:36 AM
01-20-2014 05:04 AM
01-20-2014 12:03 PM
The event sructure seems to match better what I am working on partly because the physical layout of the buttons seems easier to control. Basically i'm creating a buttons in labview for each button on some test equipment, creating a front panel that matches the real equipment. Thanks for the help.
01-20-2014 12:08 PM
An event structure has nothing to do with the physical layout of the buttons and seems to address a question quite different from your original problem description. Please tell us a little more about your application.
01-20-2014 01:26 PM
More info: I have an Advantest R3463 spectrum analyzer (although this idea will apply to many GPIB enabled instruments) and I am trying to use Labview to control the instrument via GPIB commands. On the labview front panel I want to place a bunch of buttons where each button sends a specific GPIB command. E.g.: clicking a button on the front panel labeled "View Trace" will send the GPIB command "AV" once and only once per click. Clicking the button "Max Hold" will send the GPIB command "AM", etc. After the button is clicked and the command sent, it needs to reset to the unpressed position. The event structure seems to work fine. For the purpose I described, is there any advantage to either the case structure or event structure?