LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using pre-build action to display svn version number

Solved!
Go to solution

Right so I am having this issue when using the pre/post action. It basically wont let me edit the Vi or put a new one in there. When I select a new file to be executed it gives me connector pane issue warnings. This is because the original VI in there had a few connector panes and the latest one dosn't. It basically wont let me select the new VI and somehow defaults back to the original one even though I have deleted it and renamed it. It will only work with this "old" VI in there but I cant get rid of it. Its somehow stuck in there. Is it possible to flush it out and add a new one??

 

 

0 Kudos
Message 11 of 25
(1,625 Views)
Are you using the Generate VI button? This should create a new VI with the correct connector pane. The pre-build and post-build actions can't be just any VIs.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 12 of 25
(1,612 Views)

Yes, the "form" of the Pre-Build and Post-Built VIs, including their Connector Panes, Inputs, and Outputs, are "fixed" by the Build "machinery".  You can "import" things into a Pre-Build Action by using VIGs or Constant VIs (like my "Version" VI) or by adding a sub-VI whose inputs come from the Pre-Build's inputs (like my SVN Build).  

 

What is it you are trying to do?  Maybe we can suggest a work-around ...

 

Bob Schor

0 Kudos
Message 13 of 25
(1,607 Views)

I have used the generate VI button and used the default name of "Post-Build Action" and just left it empty( to test). It still loads the old VI into it. When I go back and hit the generate VI button the icon of the VI is like below.

 

SVN Folder.jpg

 

Is SVN putting it in there somehow. How is a VI with different name keep getting put in here.

0 Kudos
Message 14 of 25
(1,587 Views)

All I want to do is run a VI at build to write the SVN number to a config file. This I can do seperately but cannot implement it in the pre/post build actions. It should be very straight forward but this old code always end up in it even if its deleted. Its driving me mad.

0 Kudos
Message 15 of 25
(1,573 Views)

Right click the VI and go to the SVN option "Unversion and add to ignore list".

You could also try the SVN Delete function rather than trying to delete through Windows. This is usually the safer way to delete anyways because someimes SVN can get confused.

 

If it's still including the Pre-Build action when you build, are you sure you're unchecking the box to "Execute VI before build"?

Make sure you're saving your project as well...

 

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 16 of 25
(1,567 Views)

Am I correct that you want a Pre-Build Action that gets the Version Number from SVN and writes that to a file in .INI format (using the LabVIEW Config functions)?  I'd think that would be (as my Canadian friends would say) un morceau de gateau.  I just banged this out, and absolutely haven't tested it, but it seems to me this should work (Famous Last Words) ...

SVN Build to INI.png

Bob Schor

0 Kudos
Message 17 of 25
(1,553 Views)

@Bob_Schor wrote:

Am I correct that you want a Pre-Build Action that gets the Version Number from SVN and writes that to a file in .INI format (using the LabVIEW Config functions)?  I'd think that would be (as my Canadian friends would say) un morceau de gateau.  I just banged this out, and absolutely haven't tested it, but it seems to me this should work (Famous Last Words) ...

SVN Build to INI.png

Bob Schor


This is what I was referring to above, but as a Post-Build Action. It would be super easy to edit the config file that is built with the executable it include a Version tag (or Build or whatever) and just pull the executable's INI file. This would eliminate any need to include another file with the build.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 18 of 25
(1,547 Views)

James,

 

     I'm not sure I understand, if building a Config.ini file, why (or if) it matters if it is done pre-Build or post-Build.

 

     Using a Config file certainly "decouples" the precise timing of getting the SVN Revision Number from saving it.  However, if it is saved "external" to the Build (as in a Config file), that's another file to track, unless one uses the .ini file created by the Build (which lives in the same folder as the .exe).

 

     Ohhh, now I get it -- you do this post-build because you want to use the Build-created .ini file.  Very clever, I didn't think of/realize that.  My only worry would be how to identify the .ini by name.  If the Main Destination Path points to the .exe (instead of just to the folder), then it's easy -- just replace .exe with .ini.  

 

Bob Schor

Message 19 of 25
(1,526 Views)

Smiley Very Happy I enjoyed reading your thought process.

 

The Post-Build Action VI also gives an array of files created by the build. You could pull the INI file path from this, or by pulling exe filename like you said.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 20 of 25
(1,522 Views)