From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically rename Build Specification (Change Name in Project File)

Hello,

 

i want to change the build specification name programmatically. I had no problem to do that with the Tag "Bld_buildSpecName" but the displayed Name at the project explorer is different to the build specification name displayed in the properties dialog.

I allready tried to:

  1. open project --> save and programmatically,
  2. Expand all --> Collapse all (maybe front panel update missing)

I thought about change the xml entry inside the project xml file. Maybe someone have a differnet way to solve this problem.

0 Kudos
Message 1 of 5
(3,409 Views)

Why do you want to do this?  As I've discovered, Build Specs and the Build parts of Project are wonderfully arcane, illogical, and mysterious, and NI is reluctant to mess with it.

 

Can you possibly do this with VI Scripting?

 

Bob Schor

0 Kudos
Message 2 of 5
(3,356 Views)
You say, "...the displayed Name at the project explorer is different to the build specification name displayed in the properties dialog."

If the properties dialog you are referring to is the dialog for editing the build spec, you are simply wrong. The name in the build specification is the name shown in the project.

Now if you are programmatically modifying the build spec using the project API, you might have to refresh the display to see the change.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(3,334 Views)

Hi.

I have the same problem, and I looked in to what happens in the project file when you change the build spec. name using the API vs. using the build spec. properties dialog. I have done so by opening the LabVIEW project file I am working on in Notepad++, since this file is basically just an XML file.

Before I do anything the file section for build specs. looks like this:

I<Item Name="Build Specifications" Type="Build">
            <Item Name="Module App" Type="EXE">
                <Property Name="App_copyErrors" Type="Bool">true</Property>
                <Property Name="App_INI_aliasGUID" Type="Str">{CBF47618-0997-4E5B-8B92-54FC9488DCA8}</Property>
                <Property Name="App_INI_GUID" Type="Str">{08C674C6-5E10-495E-BC78-C1A1F052FCB8}</Property>
                <Property Name="App_serverConfig.httpPort" Type="Int">8002</Property>
                <Property Name="Bld_autoIncrement" Type="Bool">true</Property>
                <Property Name="Bld_buildCacheID" Type="Str">{530F7D44-44BC-4F35-8A99-5F0583B3CD7C}</Property>
                <Property Name="Bld_buildSpecName" Type="Str">Module App</Property>

 

There are more lines in the section than shown above, but these are the esential to explain the issue.

 

When I change the name by using the API method "Set Tag" with the tag nam "Bld_buildSpecName" the section in the project file changes to look like this:

<Item Name="Build Specifications" Type="Build">
            <Item Name="Module App" Type="EXE">
                <Property Name="App_copyErrors" Type="Bool">true</Property>
                <Property Name="App_INI_aliasGUID" Type="Str">{CBF47618-0997-4E5B-8B92-54FC9488DCA8}</Property>
                <Property Name="App_INI_GUID" Type="Str">{08C674C6-5E10-495E-BC78-C1A1F052FCB8}</Property>
                <Property Name="App_serverConfig.httpPort" Type="Int">8002</Property>
                <Property Name="Bld_autoIncrement" Type="Bool">true</Property>
                <Property Name="Bld_buildCacheID" Type="Str">{530F7D44-44BC-4F35-8A99-5F0583B3CD7C}</Property>
                <Property Name="Bld_buildSpecName" Type="Str">Instrument Server App</Property>

 

As you can see the string value of "Bld_buildSpecName" changed. If I open the project file with LabVIEW at this point name displayed in the Project Explore under Build Specification is still "Module App".

Now I revert the project file and then use the properties dialog of the build specification to change the name. I save the project file and open it in Nopad++ again. Now the section looks like this:

<Item Name="Build Specifications" Type="Build">
            <Item Name="Instrument Server App" Type="EXE">
                <Property Name="App_copyErrors" Type="Bool">true</Property>
                <Property Name="App_INI_aliasGUID" Type="Str">{CBF47618-0997-4E5B-8B92-54FC9488DCA8}</Property>
                <Property Name="App_INI_GUID" Type="Str">{08C674C6-5E10-495E-BC78-C1A1F052FCB8}</Property>
                <Property Name="App_serverConfig.httpPort" Type="Int">8002</Property>
                <Property Name="Bld_autoIncrement" Type="Bool">true</Property>
                <Property Name="Bld_buildCacheID" Type="Str">{530F7D44-44BC-4F35-8A99-5F0583B3CD7C}</Property>
                <Property Name="Bld_buildSpecName" Type="Str">Instrument Server App</Property>

 

As you can see the Item Name below Build Specification also changed.

This tells me that the name displayed in the Procject Explore is the value of Item Name and thus setting the value of Bld_buildSpecName does not generate the result I wanted.

It also tells me that the properties dialog does some modifications to the XML that we do not have direct access to via the API, or am I missing something here?

Best regards
Jens Christian Andersen.
CLA, CTA, CPI
Message 4 of 5
(2,980 Views)

Hello,

 

Thank you for refreshing this post. At that time I unfortunately had not mentioned a solution.

 

"It also tells me that the properties dialog does some modifications to the XML that we do not have direct access to via the API, or am I missing something here?"

You are right withyour statement.

 

I have solved the problem as follows:

1. Using the API method "Set Tag" with the tag name "Bld_buildSpecName"

2. Close the project file + reference of the project

3. Open the *.lvproj file programmatically. (I use a self-written XML tool for this and further steps)

4. Search for the group [<Item Name="Build Specifications" Type="Build">]

5. Search for the entry [<Item Name="App Name - Application" Type="EXE">]  ("App Name - Application" = self-chosen identifier)

6. Replace with the same name choosen in point 1

7. Save the project file

 

Best regards

Felix

Certified LabVIEW Developer

Message 5 of 5
(2,970 Views)