Jump to content

Pre-build updating time constant doesn't get to packed library


Recommended Posts

I'm using scripting to update a time/date constant with the current time when the build occurs. This is done in the Pre-Build Action. I have verified the scripting works (the VI is saved as part of the script). The build, however, has the time in the constant before the build occurred. The VI that is modified is not loaded in memory before the build (as far as I can tell). This leads me to two questions:

One, why does the changes the scripting makes not get into the built code?

Two, how do I get this as part of the build?

I have an idea forming that should let me do what I want (create a VI that updates the constant, then runs the build script), but I really need to understand what isn't happening the way I think it should be first.

Tim

Link to comment

I am NOT particularly knowledgeable about AppBuilder. For the purposes of this post, treat me as a user, not as part of R&D. :-)

After you make the scripting changes, do you call the Save Instrument method on the VI? If you do, then I've got no idea. If you don't, then I believe I know the answer: LabVIEW loads a fresh copy of your VIs into a new application instance to do the build. I do not know if this happens before or after the PreBuild VI runs. If it happens after, then I would expect your in memory changes to be loaded into the new app instance, but it could be that we load from disk... I'm honestly not sure. If it happens before, I do know that we will not update from your developer app instance after that copy is made unless the changes are saved to disk (actually, the saving-to-disk rule is the usual rule for forcing an update of the other app instances, but the AppBuilder app instance is special and it might not update even on save, but I *think* that it does).

Link to comment

I did this exact thing in Labview 2010.

It was super annoying because then a popup would occur during the build saying that the vi had been modified (obviously) which occurred like a half hour into the build.

I cant upload files right now, but all I did was modify a string constant with a new date and save it (using Save.Instrument invoke node.) I was pretty careful about closing all the references, but I doubt that is what your problem is.

Link to comment

After you make the scripting changes, do you call the Save Instrument method on the VI?

Yes, I've got the Save Instrument method in there.

I did this exact thing in Labview 2010.

It was super annoying because then a popup would occur during the build saying that the vi had been modified (obviously) which occurred like a half hour into the build.

I cant upload files right now, but all I did was modify a string constant with a new date and save it (using Save.Instrument invoke node.) I was pretty careful about closing all the references, but I doubt that is what your problem is.

References are all closed, so, yes, that's not a problem. I started thinking about a VI that modifies the constant then starts the build. I'm not getting a modified message, but it may resolve the issue I'm having.

Tim

Link to comment
  • 1 year later...

I am running into the same issue.  I created a pre-build script that updates items in the build spec.  However these updated get applied to the build spec on the harddisk and not into the current build spec loaded into memory.  I spent hours figuring this out.  It looks like the best solution is to create a script that runs my pre-build tasks and then calls the build script.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.