jpdrolet Posted July 30, 2009 Report Share Posted July 30, 2009 I will use the VI BuildTargetBuildSpecification.vi to programmatically build a project but I first need to set some buildspec properties such as the destination folder and version number. Are there VIs or properties I can use for this? I looked into the Properties and AppBuilder folder and I did not figured anything useful. The only solution for the moment is to edit the project file (XML). Any better ideas? Quote Link to comment
Mark Smith Posted July 30, 2009 Report Share Posted July 30, 2009 I will use the VI BuildTargetBuildSpecification.vi to programmatically build a project but I first need to set some buildspec properties such as the destination folder and version number. Are there VIs or properties I can use for this? I looked into the Properties and AppBuilder folder and I did not figured anything useful. The only solution for the moment is to edit the project file (XML). Any better ideas? This won't be too detailed, but it should point you in the right direction - From the Application class properties you can get an array of all open Projects and from there you can get a ref to a specific Project. Then from the Project MyComputer property you can get the TargetItem and from there you can get BuildSpecs. Now you have a reference to the BuildSpecs and you can get a ref to the Children[] of the BuildSpecs and finally from there get a ref to the particular BuildSpec you want. Now, with a ref to the BuildSpec you want to modify, you can modify items inside the XML project file using ProjectItem Set Tag method. So, you do end up editing the project file but you can do it programatically using LabVIEW so the process can be automated. Mark Quote Link to comment
GertheDwarf Posted July 30, 2009 Report Share Posted July 30, 2009 From the Application class properties you can get an array of all open Projects and from there you can get a ref to a specific Project. Then from the Project MyComputer property you can get the TargetItem and from there you can get BuildSpecs. Now you have a reference to the BuildSpecs and you can get a ref to the Children[] of the BuildSpecs and finally from there get a ref to the particular BuildSpec you want. Now, with a ref to the BuildSpec you want to modify, you can modify items inside the XML project file using ProjectItem Set Tag method. So, you do end up editing the project file but you can do it programatically using LabVIEW so the process can be automated. I am trying to programmatically find the Startup VI, if any, of the build spec. I went through the steps you outlined above, and have found Tags SourceItem[5].Inclusion and SourceItem[5].ItemID which are "Startup VI" and "0xA1B0048A", respectively. I don't know what that hex number is. Using a similar process, I went through the project heirarchy and get the ProjectItem "ItemID" of the VI which I know is the Startup VI, but the two numbers are not equal. How can I get from the BuildSpec ItemID to the VI name/reference. Quote Link to comment
GertheDwarf Posted July 30, 2009 Report Share Posted July 30, 2009 I am trying to programmatically find the Startup VI, if any, of the build spec. I went through the steps you outlined above, and have found Tags SourceItem[5].Inclusion and SourceItem[5].ItemID which are "Startup VI" and "0xA1B0048A", respectively. I don't know what that hex number is. Using a similar process, I went through the project heirarchy and get the ProjectItem "ItemID" of the VI which I know is the Startup VI, but the two numbers are not equal. How can I get from the BuildSpec ItemID to the VI name/reference. Figured it out. Take that hex value, which is in variant form, and convert it to a ProjectItem class. This throws an error, but can be ignored, because a ProjectItem Property node will return the right Name and Path, anyways. Weird how the key to the problem was "ignoring the error." Quote Link to comment
jpdrolet Posted August 4, 2009 Author Report Share Posted August 4, 2009 This won't be too detailed, but it should point you in the right direction - From the Application class properties you can get an array of all open Projects and from there you can get a ref to a specific Project. Then from the Project MyComputer property you can get the TargetItem and from there you can get BuildSpecs. Now you have a reference to the BuildSpecs and you can get a ref to the Children[] of the BuildSpecs and finally from there get a ref to the particular BuildSpec you want. Now, with a ref to the BuildSpec you want to modify, you can modify items inside the XML project file using ProjectItem Set Tag method. So, you do end up editing the project file but you can do it programatically using LabVIEW so the process can be automated. Mark It worked. Thanks a lot Quote Link to comment
Popular Post jgcode Posted August 6, 2009 Popular Post Report Share Posted August 6, 2009 I will use the VI BuildTargetBuildSpecification.vi to programmatically build a project but I first need to set some buildspec properties such as the destination folder and version number. Are there VIs or properties I can use for this? I looked into the Properties and AppBuilder folder and I did not figured anything useful. The only solution for the moment is to edit the project file (XML). Any better ideas? This is how I auto increment an executable's version (build # only) in my build script. The child reference of the BuildSpec[] is passed to the Executable Auto Increment Build VI. The Get and Set just read or writes to the XML tags. 3 Quote Link to comment
Ton Plomp Posted August 6, 2009 Report Share Posted August 6, 2009 This is how I auto increment an executable's version (build # only) in my build script. The child reference of the BuildSpec[] is passed to the Executable Auto Increment Build VI. The Get and Set just read or writes to the XML tags. Jgcode, thanks for the info! This is very usefull. Could you share this code via OpenG or Lava CR? Ton Quote Link to comment
jgcode Posted August 7, 2009 Report Share Posted August 7, 2009 Jgcode, thanks for the info! This is very usefull. Could you share this code via OpenG or Lava CR? Ton No worries - it was a bit late, but I posted in case it helped. I can't post the VIs but can you PM me your email and I will get them to you. I also have been working on a build script that you might find useful (as I am guessing that is what you are doing?). Its all in LV 8.6 - let me know what version you are using as well and I will try to convert down if needed. Cheers JG Quote Link to comment
Bob Schor Posted November 21, 2013 Report Share Posted November 21, 2013 I'm working on a Real-Time project and wanted a way to programmatically update the Version Number in the Build Specs for both the Host and Remote targets. A Web search led me here for the solution. My code differs a little, as I'm doing this from within the Project -- in addition, the names of the Version Tags seem to have changed (in LabVIEW 2012). I tried to post snippets of my VIs here, but couldn't figure out how to do so! I'm using Chrome (if that matters). I'm guessing I should use the "Image" button, but don't know what to put in for URL (the PNG images are on my desktop machine). Bob Schor Quote Link to comment
todd Posted November 25, 2013 Report Share Posted November 25, 2013 I tried to post snippets of my VIs here, but couldn't figure out how to do so! I'm using Chrome (if that matters). I'm guessing I should use the "Image" button, but don't know what to put in for URL (the PNG images are on my desktop machine). Quote Link to comment
vekkuli Posted May 19, 2014 Report Share Posted May 19, 2014 I was looking to automatize defining the build specifications as well but I never did scripting of this sort before, so I'm a little lost. Basically I wanted to take care of, well, this http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/compiler_optimizing_for_execution_speed/ (400+ VI's, Select each VI and clickety click click... NOPE). Anyway, I didn't get much further than being able to edit the tags I saw were already there. How would I, for instance, go through every source file/VI and define both of those properties (Uncheck "Use VI Property" and "Allow Debugging")? Quote Link to comment
vekkuli Posted May 21, 2014 Report Share Posted May 21, 2014 I made a thread on the NI forums about my problem as well: http://forums.ni.com/t5/LabVIEW/Build-Specifications-Programmatically-Adjusting-quot-Source-File/td-p/2857418 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.