LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Right Click Menu

Solved!
Go to solution

Thanks for hanging in with this, Jim.

 

I have made your changes, still doesn't work for me.

A probe placed on the selector line is always an empty string (not "Not Executed") indicating that the Get Menu Selection is probably not getting the menu data.

Highlight execution just shows the Read Menu constantly pinging the selector terminal through the GMS.

 

An interesting sidelight: I asked another fellow locally to see it he could run it like you did and it won't work for him either. He's running 2013 same as me except I've got SP1 installed and he doesn't. May I ask which version you're running?

0 Kudos
Message 11 of 22
(2,971 Views)

@Kilo_Watts wrote:

 

May I ask which version you're running?


2014.  I can test your VI in LV2010 if you'll back-save and post it, but I don't suspect a version issue.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 12 of 22
(2,966 Views)

OK, thanks, the 2010 version is attached (I hope, never did a back save before)

 

It does seem odd, though, that two different 2013 installations (different S/Ns) can't run this thing and you can in 2014.

0 Kudos
Message 13 of 22
(2,956 Views)

LV2010 says that VI is version 13.  Please post your menu file, too.

 

Just to be sure, you went through this when making your menu?

sanitycheck.jpg

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 14 of 22
(2,952 Views)

Attatched is a 2013 version which uses the event structure.  It also will recreate the menu as you click on it, based on the current color selection.  So if the color is Blue the item to change it to Blue isn't an option.

 

EDIT:  Here is a snippet

 

ButtonColorChange Hooovahh Edit_BD.png

Message 15 of 22
(2,948 Views)

Yes, I did complete the menu editor screen for all three "Tags".

 

When I first saved the new menu I chose the save it "with the control" option instead of creating a separate file. I have since saved it as a separate file and it is attached with a .txt extension, the forum choked on .rtm, so you'll need to change it back. Saving as a separate file didn't help, still won't change colors.

 

Took another shot at saving a 2010 version, and it is also attached.

 

Thanks.

Download All
0 Kudos
Message 16 of 22
(2,932 Views)
Solution
Accepted by Kilo_Watts

What we've had here was a failure to communicate.  You're setting the custom right-click menu of the control (I missed that) but reading the custom menu of the VI (Current VI's Menubar); your VI doesn't have a menubar.  It's no wonder it doesn't work.  Your control menu did come in your VI, though.

 

I don't believe you can get a reference to the control's menu but, as mentioned earlier, an Event structure is really the way to go.

 

ButtonColorChange2010_2_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 17 of 22
(2,904 Views)

That's really slick, Hooovahh, thanks for sharing. Best of all....it works!

0 Kudos
Message 18 of 22
(2,890 Views)

I appreciate your ongoing help with this and agree with your analysis of reading the wrong menu, but NI seems to think it should work in this application note:

 

http://zone.ni.com/reference/en-XX/help/371361K-01/lvconcepts/customizing_vis/

 

Check out the last sentence in the second paragraph under "Creating Menus" and then their proposed vi on the second page. Unless, of course, I'm just misinterpreting their instructions.

 

Also, didn't you get it to work once you built a menu?  How did you build that menu?

0 Kudos
Message 19 of 22
(2,883 Views)

Before you hie off and reinstall things, you might consider learning the first rules of DataFlow programming:

 

1... A structure does not execute until ALL its input wires have data available.

 

2... No output leaves the structure until EVERYTHING in the structure has executed.

 

(Yes the FLAT SEQUENCE appears to violate rule #2, but it's really a collection of individual structures, so it gets away with it.)

 

 

Your example code has one loop which copies a boolean button value to a boolean indicator (at 32,000,000 times per second on my computer), while checking for a STOP button every time.

Trust me, you don't need to check 32M times per second to get a decent response time.

 

So, when does that output become available?  Apply rule 2.

 

But the OUTPUT of that loop is the INPUT of your larger loop.

 

So when does the big loop start?   Apply rule 1.

 

Appl

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 20 of 22
(2,876 Views)