LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding a start button to my visa vi so I can build an executable

I have a vi which i need to build into an executable. I have been advised to put in a start button and set my VI to run when opened. I have put a case structure around my original vi and a while loop around that. However, before I even build it into an executable I cannot get the new vi to run in labview. I keep getting an error message [Error - 1073807346 occurred at property node (arg 1) in 'vi name'. This error code is undefined.......]. Any help/advice would be much appreciated. Both vi's attached (original vi, vi after start button added)

Download All
0 Kudos
Message 1 of 14
(3,779 Views)
Attachments missing!
Thanks
uday
0 Kudos
Message 2 of 14
(3,766 Views)

attachments now added. thanks uday

0 Kudos
Message 3 of 14
(3,759 Views)

-You can uncheck VI->Properties->Run when opened.
-Then when the vi is opened you can select the VISA Resource name.
-Then click on Run.
-Follow same procedure in executable http://digital.ni.com/public.nsf/allkb/F5E0C938A602A7028625678D004B4F5A

 

Edit: vi_before_start_button_added.vi ‏22 KB is enough no need to add extra logic.

Thanks
uday
Message 4 of 14
(3,746 Views)

Hi Uday,

 

I had initally built the executable for the original vi (before start button added) and the 'run when opened' button was unchecked. I tested it on 2 pc's which had both labview runtime and visa runtime installed on them. Unfortunately when the VI application opens, it is already running and it cannot see any com ports. It works fine as a standard vi in labview. My problem is in getting it to work for runtime. See attached screenshot.

 

0 Kudos
Message 5 of 14
(3,725 Views)

Sorry that i might be reiterating the steps because if you uncheck it shouldn't tun automaically.

Step1: Just a sample project: Click on Customize VI PropertiesStep_1.png

Step2: In execution: uncheck the Run when opened.

Step_2.png

-If you can ensure above two steps the exe which you build after will wait untill you press run button.

-You could try to check and display the COM ports: programmatically determine which COM ports are available at runtime

-Did you check in Device manager and the device connected?

Thanks
uday
Message 6 of 14
(3,716 Views)

Thanks Uday,

 

unchecking it from within the application builder has worked a treat and the vi is now  not running when opened. However the visa resource is still not seeing any com ports. I will try your suggestion about programming it to search for com ports and hopefully that will be successful. Will update here tomorrow.

 

Thanks again for your help...........it is invaluable.

0 Kudos
Message 7 of 14
(3,707 Views)

Another option is to make a dialog VI that opens at the start of the program to allow you to select your serial port.  You could also go so far as to store the serial port settings in a configuration file and load that information at startup.

 

These would make your program feel a lot more professional.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 14
(3,693 Views)

"I/O name flitering" option may help finding the serial device (right-click the VISA Resource Control).

 

If the com port does not show up it may be an indication that the exe does not have VISA or serail support included.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 14
(3,683 Views)
So how can I check if the visa or serial support are included in the exercise?

Currently I build the exe from within the vI, under the tools tab. I then click the build button.
0 Kudos
Message 10 of 14
(3,669 Views)