LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute vi automatically on project open

Is there a way to have a LabVIEW project automatically run a vi when the project is opened? My current workaround is to first open a vi that does my "pre project" code then opens the project. While this works, it's not intuitive to open a vi in order to open the project. For a single project and single developer, I wouldn't mind - but this is going to be many projects with several developers. 

0 Kudos
Message 1 of 6
(3,473 Views)

A project is for development. A running Vi is for deployment. Can you explain how this is used? Makes little sense to me.

0 Kudos
Message 2 of 6
(3,462 Views)

This may sound a little convoluted...but there are many benefits and so I try...

 

I'm working on code modules that are used on both Windows and Linux RT (class based, Actor Framework). The desire is to keep one source code since the same functionality is used across many targets (we have lot's of cDAQ's and lot's of cRIO's and many reusable code modules). I want to use PPL's to protect the code and provide a simple interface to building applications. PPL's are compiled code specific to target OS. A child class points to a specific parent. That parent must be of the same OS, bitness, LV version, etc of the child class for it to work.

 

To create a code module from the same source but compiled into two different versions, I first copy the parent PPL of one type into a master directory. The child source points to the PPL in the master directory. Write code, test, then make a PPL build of that child. Then to create the child of the other OS type, I first overwrite the parent PPL in the master directory with the corresponding PPL of that type. I use a separate project and add the child source code to that project, under the new target type. I can then create a PPL for the other OS type. When creating builds, this process of copying the file to the "master location" can be automated with pre-build actions. The problem when developing code is that I have to make sure the appropriate PPL is in the master directory before I open the child class or vi's. 

 

Hence the desire for some sort of "pre-project" vi or action that allows me to automate the process of copying (or verifying) the right PPL into the master directory. 

0 Kudos
Message 3 of 6
(3,454 Views)

Edit: Nevermind now that I saw your response.

 

What I have been doing is build the PPLs into the directory the final project will be using.  This reduces the number of file copies needed.


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 4 of 6
(3,450 Views)

I've talked to several folks, even at NI, who do exactly this with builds when working across targets or bitness or versions. It's certainly not common, but very useful when building common code. Even without the PPL's that I'm aiming for, working cross target code has it's challenges. Creating exe's doesn't solve the problem - LabVIEW compiles and saves the code per the target type. That's the problem I face right now, every time I switch between Win and RT projects, all my ancestor classes and common actors are recompiled and saved (even though nothing really changed). Makes version control ugly. 

0 Kudos
Message 5 of 6
(3,441 Views)

Ha, the ever existent problem of responding to a post not realizing that another response is already there waiting for you! I just did the same. 

0 Kudos
Message 6 of 6
(3,439 Views)