LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get menu selection help

Hi I am new to the Labview world and am having a bit of an issue with the get menu selection vi.  I opened an example (Queued Message Handler.vi) and basically copied that get menu selection setup in my vi.  Yet all i get for menu selections are null strings.  I have tried to set the get menu selection timeout to -1 then selecting a menu item.  I still get a null string from it so I know it isn't some timing issue.  I have attached a copy of my vi.  The runtime menu I was using was just File with an exit option.  There are a couple sub vi's that i made that are required to run Queue.vi but they arent really needed to see what I am doing.  Thanks for any help in advance.
0 Kudos
Message 1 of 9
(3,567 Views)
could you plz save ur Vi in 8.2 version adn post it up ?
LV 8.2
0 Kudos
Message 2 of 9
(3,559 Views)
Here you go.
0 Kudos
Message 3 of 9
(3,557 Views)
You may also provide your subVIs within your VI. SubVIIs Algae_Queue_SetupFile.vi and Algae_Queue_WritetoFile.vi are missing 
It's always sunny in California! Certified LabVIEW Associate Developer!
0 Kudos
Message 4 of 9
(3,551 Views)
OK I made a few revisions.  Here is the main vi and all the sub vi's that go with.  I zipped it all together in version 8.2.  Thanks again.
0 Kudos
Message 5 of 9
(3,545 Views)
If you are curious as to why my files have Algae in the name, I am monitoring the growth of algae with this program and this version i am using a queue method to create program instead of a sequence structure.  The labview will start the microcontroller and then collect the data from the serial and record it in a file and then display the last recorded data.  I will eventually have it update a graph, on the front panel, that shows the growth.  Thanks again for all your help.
0 Kudos
Message 6 of 9
(3,535 Views)

Your problem is that you are trying to read the menu using the Get Menu Selection function and you also have an event structure. The event structure has registered the event of the user selecting a menu item. Thus, it will prevent the Get Menu Selection function from working.

 

You also seem to be trying to mash together a standard producer-consumer architecture into a single loop. This usually doesn't work out too well. Also, you should not use the Stop function to stop your VI. You should program it so that a graceful exit is performed.

Message 7 of 9
(3,524 Views)

Hi Superseadragon,

I recommend you to use an event-driven state machine desing pattern that combines a queued state machine and event structure into a hybrid single-loop design pattern.

I made an example with your code but as I don't have your set up I put in commentary all the communication function.

To close the VI click on the cross on the upper right corner like for a tradionnal application.

You can fire an event from the run time menu. I included a case in the event structure. Have a look at it. This is not the only way to do it.

 

Have fun with your algae!

Charly

It's always sunny in California! Certified LabVIEW Associate Developer!
Message 8 of 9
(3,510 Views)

Charly,

           Thanks for the help.  It seems that I still have a bit to learn here.  I get what you were doing and I like it.  The event structure seems to work a lot better the menu actions.  I think the event structure may even slim the program up a bit.  Thanks again!!

0 Kudos
Message 9 of 9
(3,460 Views)