취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Custom Menu Items Do Not Appear

해결 완료!
솔루션으로 이동

Using LV 8.5, I want to change the menu bar of my VI programmatically.  I am not using Edit >> Run-time Menu...

 

I've deleted almost all the default menu items ("File", "Edit", etc.) except "Help", then inserted my own "Config" menu.

In the IDE it works great; when I make an executable my menu does not appear.  Instead, the default items

I deleted are indeed gone and the only item showing is "Help".

 

What am I doing wrong?  I've looked at the posts where it says to add an item name and item tag and I've looked at all the

LV examples for adding a menu.  Things are fine until I build the executable and then my little menu item just doesn't show up.

 

There's no reason why I could not use Edit >> Run-time Menu... but I figured I could do it programmatically.  Just trying to figure out what is causing my menu to not appear.

0 포인트
1/8 메시지
5,795 조회수
I would first verify that a shipping example works correctly when built into an application. There's a shipping example called "Dynamic Insert Demo" that creates a menu programmatically. Build this into an app and see if the menu shows up. If it does, then it's clearly something you are doing in your code. As for what, if anything, you might be doing wrong, you will need to show us the code.
0 포인트
2/8 메시지
5,771 조회수

Yeah, that was a good idea.  I added that VI to my build path and created a standalone exe.  It seems to work, so that leaves my code.

 

Attached is a screenshot of the menu insertion sequence.  It's the very first thing in my program.  In a later sequence, I use an event structure to detect "Menu Selection (User)".

 

I've also played with File >> VI Properties >> Screen Appearance.  I've attached a screenshot of that, too.

모두 다운로드
0 포인트
3/8 메시지
5,766 조회수

The demo VI has the entire menu bar erased then a few items are added back in.  In my code, I chose to erase most of the menu items but not all, so as a test I deleted all the menu items and now it shows my custom menu item after I build and then launch the exe.

0 포인트
4/8 메시지
5,759 조회수
솔루션
주제 작성자 SashaBC이(가) 승인함
Now that I see your code it makes sense. The reason why it doesn't work the way you had it before is that you are actually getting an error when you run the application. The error is because not all of those menus actually exist in the run-time environment. Thus, the Delete Menu Items function generates an error, and the rest of the code gets bypassed. The example simply deletes all the menus, and no error gets generated, since only the menus that actually exist get deleted.
5/8 메시지
5,747 조회수

I added Simple Error Handler.vi to the error bus of the chain and now I see "Error 1162 -> Labview: Cannot find one or more tags."  This error does not appear when I'm in the Labview IDE.

 

Dude, thanks for this great debug, but can you give me a clue as to how to add my custom menu and keep the "Help" application menu?  Since I did not see an error in the IDE I "assumed" Labview was happy.

 

When it comes to system I/O is it a good idea to assume simulation will not work in the IDE?

 

0 포인트
6/8 메시지
5,742 조회수

Hi Sasha,

 

simply check the error cluster once in a while 윙크 이모티콘 And never rely on "It works for my IDE, so it will work always and ever."!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 포인트
7/8 메시지
5,740 조회수

Yet another good tip -- will make error handling more visible in the future.

 

I did find it.  Apparently, one of the tags I'm removing exists in the IDE but not in the runtime menu:  "Project".  Apparently, after this it just stopped processing menu bar code.

 

I do appreciate the help.

0 포인트
8/8 메시지
5,735 조회수