07-18-2019 08:28 AM
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
07-18-2019 09:08 AM
The LabVIEW help file.
07-18-2019 09:25 AM
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.
07-18-2019 09:54 AM
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.
07-18-2019 09:58 AM
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
07-18-2019 10:59 AM
07-20-2019 06:43 AM - edited 07-20-2019 06:45 AM
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
07-21-2019 10:43 AM
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
07-22-2019 07:20 AM
@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:
07-22-2019 08:35 AM
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