salikatt Posted September 25, 2008 Report Share Posted September 25, 2008 Hi you all, I have been searching all over this forum trying to find how I reference a sub vi when compiled to exe-file, i mean to be able to show/close front panel of the sub vi. It runs nicely from project but not when compiled. The sub vi is just a serial port reader, showing buffers, error messages etc. At the moment I'm able to open sub vi (NP_Serial) running the EXE file, but the VISA reports an argument error. If I delete Static VI ref. the NP_Serial is working fine, but i'm not able to show the Front Panel when using EXE file. I have also been trying the open.method but with the same result. Anyone hwo can help me out? I know i can use the custom settings - "show when called", but that is not convinient for me as the sub vi is called every loop from the top vi. regards Kenneth Quote Link to comment
Neville D Posted September 26, 2008 Report Share Posted September 26, 2008 When building an exe, the front panel of subvi's is automatically removed. Go into the build and manually uncheck the "remove frontpanel" checkbox. But I this may not work to see the front panel. Re-architect your code to call the subVI and display as a subpanel in your top-level VI. This way it is always visible. This screen shot shows how to open a VI as a subpanel, given the VI name and path. The loop is just a re-try incase the open fails. You can add a tab to the top level VI and embed the subpanel in it, so that you have additional screen space. Put the data coming out of the subpanel VI on a Q and read that in the top-level VI. N. Quote Link to comment
salikatt Posted September 26, 2008 Author Report Share Posted September 26, 2008 Hi Thanks for your replay Neville D I will re-organize my code to your recomendation at a later stage. I actually solved my problem, i had done a blunder in the NP_serial sub vi. I did not close all ports properly when closing application so when I tried the exe-file the ports were already occupied. I also did som chages in the build properties, I put the NP_Serial in "always included". -kl Quote Link to comment
PaulG. Posted September 26, 2008 Report Share Posted September 26, 2008 Are you including your called subVI in your build specifications, i.e. you have your startup vi but your called VI needs to be under the "always included". Quote Link to comment
Mellroth Posted September 26, 2008 Report Share Posted September 26, 2008 QUOTE (PaulG. @ Sep 25 2008, 03:23 PM) ...but your called VI needs to be under the "always included"... I don't think it has to be set as always included, if it being used by static VI reference as indicated in the screenshot. But I would recommend that you retrieve the VI name from the static VI reference instead of having a constant specifying the name. Here is a little trick I used in the past to force a FP to be included in a build, without having to explicitly set this in the build specifications; 1. Open VI properties 2. goto "Window Appearance" , customize 3. uncheck the "Allow user to close window" option I don't remember if I used this in LabVIEW 8.5, as I recall it is enough to have VIs included as static VI references, but I might be wrong. /J Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.