LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pre build actions

Hello all 
 
I looking for some good materials about Pre-build actions in Labview. 
 
I am usualy making small aplications and modify global variables like date, time, revision, some bools an other maualy. 
I would like to do this automaticly. Can you propose me some good reading materials for that cind of action. 
 
Best Regards 

0 Kudos
Message 1 of 11
(4,370 Views)

The LabVIEW help file. 

aputman
0 Kudos
Message 2 of 11
(4,341 Views)

Hi, I checked the help file and found nothing that could help me.

I easily created Prebuild vi, which creates a string with the current date and time and places it in a global variable.

in the main application the global variable is read and displayed on the front panel, unfortunately it is empty.

Pre-compile the file in the attachment

Please have a look.

0 Kudos
Message 3 of 11
(4,323 Views)

The global variable that's in your prebuild.vi and the one in your application are not the same.  You need to look at some other method like an INI file. 

aputman
0 Kudos
Message 4 of 11
(4,311 Views)

The Pre-Build Actions are a little bit like scripting -- you use them to make changes to LabVIEW VIs before you use those VIs in building an Executable (except, of course, when NI prevents you from doing this ...).  So if you have a Global Variable and wanted to set its value at "Pre-Build" time, you'd need to open the VI, edit it, and then save it in its "edited" state before starting the Build.

 

I'm currently rebuilding my LabVIEW PC, so I don't even have access to the LabVIEW Help.  However, if you search in the Forum for "pre-build action", you'll find some discussions of using this to set, for example, a Version Number into the Build Specification (there's a "design flaw" here, and an argument in the Idea Exchange that I originated saying that "Pre-Build" means "before the build", but NI disagrees with me ...).

 

Bob Schor

0 Kudos
Message 5 of 11
(4,309 Views)

Clipboard.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 6 of 11
(4,282 Views)

Thank You all for answers

unfortunately solution is not working Build was unsuccessful

Click the link below to visit the Application Builder support page. Use the following information as a reference:

Error 1073 occurred at Invoke Node in Pre-Build Action.vi->AB_Build.lvclass:User_PreBuild.vi:6150001->AB_Build.lvclass:Build_from_Wizard.vi->AB_UI_Frmwk_Build.lvclass:Build.vi->AB_UI_FRAMEWORK.vi->AB_Item_OnDoProperties.vi->AB_Item_OnDoProperties.vi.ProxyCaller

Possible reason(s):

LabVIEW:  This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.

Method Name: Default Values:Make Current Default
 

 

0 Kudos
Message 7 of 11
(4,237 Views)

Paul's method is the obvious one to try, but as your Error Message indicates (and I've confirmed it), you can't run the "Make Current Values Default" Method except when in Edit mode, so this doesn't work.  A perfectly-workable solution was suggested by aputman -- create a .INI file in the Pre-Build Action, save it in the Build's "Data" folder, and have your Application initialize the Globals from the .INI file.

 

Bob Schor 

0 Kudos
Message 8 of 11
(4,215 Views)

@plpablo wrote:

Thank You all for answers

unfortunately solution is not working Build was unsuccessful

Click the link below to visit the Application Builder support page. Use the following information as a reference:

Error 1073 occurred at Invoke Node in Pre-Build Action.vi->AB_Build.lvclass:User_PreBuild.vi:6150001->AB_Build.lvclass:Build_from_Wizard.vi->AB_UI_Frmwk_Build.lvclass:Build.vi->AB_UI_FRAMEWORK.vi->AB_Item_OnDoProperties.vi->AB_Item_OnDoProperties.vi.ProxyCaller

Possible reason(s):

LabVIEW:  This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.

Method Name: Default Values:Make Current Default
 

 


Oops.  Try this:

ClipboardG.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 9 of 11
(4,187 Views)

I have tried method with ini file. Additional function i would like to add auto increment version number.
But when I try to compile it i have error

Click the link below to visit the Application Builder support page. Use the following information as a reference:

Error 7 occurred at Open/Create/Replace File in NI_LVConfig.lvlib:Load.vi->NI_LVConfig.lvlib:Open Config Data.vi->Pre-Build Action.vi->AB_Build.lvclass:User_PreBuild.vi:6150001->AB_Build.lvclass:Build_from_Wizard.vi->AB_UI_Frmwk_Build.lvclass:Build.vi->AB_UI_FRAMEWORK.vi->AB_Item_OnDoProperties.vi->AB_Item_OnDoProperties.vi.ProxyCaller

Possible reason(s):

LabVIEW:  File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to 

I am sure that file exist because when i run this VI is working without errors

 

0 Kudos
Message 10 of 11
(4,176 Views)