Jump to content

Run VI Comparison Tool in Build Executable?


Recommended Posts

I use SVN for version control in my project and am often faced with many conflicted VIs that must be dealt with. I have found that frequently, the changes causing these conflicts are not "real" changes (for example, a wire was moved or a typedef for a cluster control was changed). So, I am trying to create a tool that queries my project directory for any VIs that have conflicts, and running the VI Comparison tool with only non-cosmetic changes enabled to automatically find VIs that don't have any "real" changes and marked the conflicts as resolved. I would like to build the tool into a .exe because I would like to be able to run this tool from the command-line so that I can create a right-click menu item in my Windows environment to easily run the tool from any folder containing conflicted files.

 

I found vi.lib\SourceControl\support\SCCSup Compare Two VIs.vi which performs the comparison operation, allows me to specify which types of changes to detect, and returns if there are differences. This is exactly what I need and it works perfectly in the development environment. However, when I build my tool to a .exe file, I get a LabVIEW error with the following description:

Error 1574 occurred at Open VI Reference in SCCSup Compare Two VIs.vi->Resolve False Conflicts.vi

Possible reason(s):

LabVIEW:  (Hex 0x626) Cannot open a file with separated compiled code in the LabVIEW Run-Time Engine.

An error occurred loading VI 'my.vi'.
LabVIEW load error code 59: The source file's compiled code has been separated, and this version of LabVIEW does not have access to separated

Where my.vi is the path to the VI that it is attempting to compare. All of the VIs in my project have "Separate compiled code" enabled since I use version control on them, therefore turning it off it not an option. Is there any way to get around this issue?

Link to comment

Not really.  I mean turning VI source code into a compiled piece of binary, is the responsibility of the compiler.  In a built EXE, there is no compiler, this is in the LabVIEW IDE only.  So when you look at a VI file that has separate compiled code, the compiled binary is saved in a temp location that I can't remember at the moment, but I suspect it is in ProgramData or AppData somewhere.  

 

If this tools needs compiled code to execute, and you don't have it in the VI file, and you are running from the run-time engine, then you have no way of using this tool.  But if this tool can run from the LabVIEW IDE I think you should be fine.  

 

You can still invoke a VI to run programatically from a command line, and get functionality that looks like a built EXE, but runs from the IDE.  LabVIEW.exe supports a command line parameter, which it will attempt to open as if you did a File >> Open.  If this file is a VI, and it is set to run when opened then this might be a solution for you.

Link to comment

Long and short your answer is what you suspect - there are several VI server methods that are not implemented in the run-time engine and are thus not available if you build an executable. The same issue crops up in other areas like build automation.

 

The way I get around this is to use the IDE but automate the process via scripting. I have a build VI (happens to be a VI Package) that runs automatically via LabVIEW command line arguments that performs the necessary operations and then quits LabVIEW. Not ideal I know but the only realistic option I have found.

Link to comment

You can still invoke a VI to run programatically from a command line, and get functionality that looks like a built EXE, but runs from the IDE.  LabVIEW.exe supports a command line parameter, which it will attempt to open as if you did a File >> Open.  If this file is a VI, and it is set to run when opened then this might be a solution for you.

 

Thanks, this is likely what I will do since I don't see this tool being useful on systems without the LabVIEW development environment installed anyway. Is there a way to pass a command-line argument to the VI itself (since the VI needs to know which directory to search)? I guess I could create a compiled launcher that generates a .ini file somewhere with the path in it then calls my VI via command-line, and my VI can check that file for the path, but is there a better way?

Edited by etgohomeok
Link to comment

Oh yeah that is a sticking point isn't it.  So I made a VI that is set to run when opened, and when it runs it just reads the Command Line Arguments using the property node.  I then opened this VI (and ran it because it was opened) using a command line call to LabVIEW.exe.  It opened and ran the VI just fine, but any command line parameters passed to LabVIEW.exe were not then passed along to my VI, I was hoping they would be.

 

A launcher would work, you could then write to a temporary path, or the ProgramData folder, and your VI could then open it.  I wish there was more documentation on the behavior of LabVIEW.exe when it comes to command line arguments, it might be possible to do what you want but I'm not aware of any other simple solution.

Link to comment

Oh yeah that is a sticking point isn't it.  So I made a VI that is set to run when opened, and when it runs it just reads the Command Line Arguments using the property node.  I then opened this VI (and ran it because it was opened) using a command line call to LabVIEW.exe.  It opened and ran the VI just fine, but any command line parameters passed to LabVIEW.exe were not then passed along to my VI, I was hoping they would be.

 

A launcher would work, you could then write to a temporary path, or the ProgramData folder, and your VI could then open it.  I wish there was more documentation on the behavior of LabVIEW.exe when it comes to command line arguments, it might be possible to do what you want but I'm not aware of any other simple solution.

 

If LabVIEW was already opened, it indeed doesn't pass new arguments from command line. One possible workaround is adding "allowmultipleinstances=True" line to labview.ini config file. Command line call to labview.exe will then open new LV instance each time, and consequently the arguments will be passed. However, as with every not well documented features: use allowmultipleinstances with caution (it can go weird if you open same code in more than one instance of LabVIEW).

post-50361-0-03728100-1458683727.png

Link to comment

What about the LVCompare.exe tool that can be used to automate source code control clients to know how to deal with LabVIEW files more friendly?

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/configlvcomp_thirdparty/

 

That should do most of the things required here and has various options to ignore certain classes of changes in the comparison.

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
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.