08-04-2022 07:01 AM
I have been working on a project for a few months and was finally ready to build a standalone .exe through .lvproj application builder.
For some reason, once the exe was built, it would not call my subs. The main.vi would open and run but would not function properly.
I could clearly see the subs listed in the dependencies. I made sure to move the subs into the always include category when the application was built. I kept having issues with it so I would remove the exe from the project and start the process over again. In hopes to find what I was doing wrong.
Unfortunately, Application Builder decided to over write my Main.vi (FF_Main.vi) with what looks to be a LabVIEW example file. I did not create this and it appears to be the start of an Application Builder .vi example???. I will attach it here. My original Main.vi was about 6MB+ and whatever this was overwritten with is 8kb. All of my other sub vis are in tact. All of my other files are there, just my Main.vi was effected by this. I can't even fathom how my Main.vi could be overwritten by a LabVIEW example file. I assume this is an example file because it actually has notes on the block diagram.
Is there any way to recover a project, a vi, revert back to a previous version, etc? I cannot spend another 3 months recreating this main.vi.
If there isn't a solution, what is the best way to keep revision history in LabVIEW so I can revert back to a previously saved version of the development vi in the future?
No, I did not have a backup.
No, I do not work from a cloud.
The project was on a USB drive. -I used a recover utility (diskdrill, and others) and have recovered some files but the older version I recovered gives me an error code 13 (Hex 0xD) and cannot be opened, pasted in as a sub vi, or called upon. I opened it up in notepad and it doesn't look like the same type of coding as when I opened up a sub.vi and compared them.
Yes, I have learned my lesson.
Yes, I am sick to my stomach.
I am using 19.0.1f4 (64bit)
Solved! Go to Solution.
08-04-2022 07:28 AM
Trying to retrace my steps in how this could have happened, I opened a blank project. After selecting New ->Application (EXE), build exe, My Application Properties window comes up.
Since I was having so many issues with the main not calling the subs, I decided to click on the pre/post build actions and preview the application before it was built to eliminate having to continuously start over.
When I click on the Generate VI button, I see that another window "Save the generated VI (*.vi) file" shows that a Pre-Build Action.vi. Sadly, this appears to be what overwrote my original code.
Has anyone seen this happen?
08-04-2022 07:28 AM
08-04-2022 07:45 AM - edited 08-04-2022 08:03 AM
Hi Brian,
@BrianK75 wrote:
Is there any way to recover a project, a vi, revert back to a previous version, etc? I cannot spend another 3 months recreating this main.vi.
If there isn't a solution, what is the best way to keep revision history in LabVIEW so I can revert back to a previously saved version of the development vi in the future?
No, I did not have a backup.
No, I do not work from a cloud.
A German computer magazine offers stickers saying "No backup, no ruth…" 😄
To keep a revision history you should ALWAYS use some SCC tool (source code control)! Often used SCC tools are (Tortoise)SVN or GIT…
When there is no backup then there is no other way than recreating the missing code.
@BrianK75 wrote:
When I click on the Generate VI button, I see that another window "Save the generated VI (*.vi) file" shows that a Pre-Build Action.vi. Sadly, this appears to be what overwrote my original code.
Has anyone seen this happen?
The AppBuilder will not overwrite your MainVI on its own.
It will overwrite the MainVI when you select that specific VI filename in the file dialog that opens upon "Generate VI"…
@BrianK75 wrote:
My original Main.vi was about 6MB+ and whatever this was overwritten with is 8kb.
This is not a good sign. Having a VI of more than 1MB in filesize should be quite uncommon!
(VIs can get that big when there are large images on the frontpanel or huge constants (or default values) in the VI…)
@BrianK75 wrote:
The project was on a USB drive.
This also in not recommended!
You should put your project on your local harddrive and use that USB drive only for backup purposes…
08-04-2022 08:09 AM
Sad to hear that you lost your 3-months of work. I guess that you had unknowingly selected the FF-Main.vi while it was asking to save the post/pre-build action VI and hence overwritten it, there is no way LabVIEW automatically overwrites something unless you tell it to.
Even for file recovery, it works for deleted files where the files are still present on the drive but their index entry has been removed from the file system, these file recovery software goes through every bit on the disk to match the known structure of data such as JPG and read them even without the index file. In your case, you may have overwritten the data (lost for good) or the file system chose to write the new file in a new location than the old one (there is a chance the recovery software can help).
08-04-2022 09:08 AM
I think most of your problem originate from a complete misunderstanding of the application builder.
It is rare if dependencies are not correctly included. The option "always include" is typically only needed for subVIs that are loaded dynamically by name, certain custom dlls, custom help pages, etc.. Maybe we should investigate the cause for your original problems.
@BrianK75 wrote:
Trying to retrace my steps in how this could have happened, I opened a blank project. After selecting New ->Application (EXE), build exe, My Application Properties window comes up.
Since I was having so many issues with the main not calling the subs, I decided to click on the pre/post build actions and preview the application before it was built to eliminate having to continuously start over.
To preview the build, go the the "preview" option below. Pre/post build actions are something completely different. They allow you to create an extra code that runs before or after the build process. Not what you want!
08-04-2022 10:44 AM
You are correct GerdW. It appears that I probably selected the name of my Main.vi as the Pre-Build.vi and....bam...Gone!
Most of my vis are in the 15-75kb range. That one in particular had an image cut/pasted into the front panel (not set as background). It accounted for about 90% of the file size.
08-04-2022 10:45 AM
Santo_13
Unfortunately, I know way too much about data being overwritten and unrecoverable.
08-04-2022 10:52 AM
Altenbach,
Obviously I have a complete and utter misconception of Application Builder. I have used it many times before. Never ran into this.
Once I have my code ready to convert into an executable, I only open my Main.vi, I select to create a project. That project pulls in all the dependencies (sub.vi s) in with it. I add in my notes/read_me files to the project. From there I click New-Application (EXE) .
I tell it what to name it and where to put it. Done.
Except when I ran the code, it didn't work. This is where my problem started. It was not calling my subs like it did when it was in development mode. So, for funsies, I thought, I will place all the subs and the main into the main vi section and ta-da...they all opened! Only problem was they all opened at once. So, I went back to original config of how LVPROJ configures the files and started screwing around with pre/post....and here I am providing a lesson to others that I didn't want to learn.
08-04-2022 02:00 PM - edited 08-04-2022 02:04 PM
@BrianK75 wrote:
Altenbach,
Obviously I have a complete and utter misconception of Application Builder. I have used it many times before. Never ran into this.
Once I have my code ready to convert into an executable, I only open my Main.vi, I select to create a project. That project pulls in all the dependencies (sub.vi s) in with it. I add in my notes/read_me files to the project. From there I click New-Application (EXE) .
I tell it what to name it and where to put it. Done.
Hmmm... Maybe this is part of your issue? Here's my workflow for a new program.