11-28-2024 09:10 AM
Place the attached VI in all of your ...\LabVIEW 20??\project\ folders.
(it's a good idea to compile each one in the corresponding version of LV; or just mass compile the folder).
Now when you run LabVIEW, you will have menu item: Tools -> Save - Retain LV Version...
When you select that menu item, it will save the current VI for whichever version of LabVIEW it was last saved for.
11-29-2024 03:47 AM
@paul_a_cardinale wrote:
Place the attached VI in all of your ...\LabVIEW 20??\project\ folders.
(it's a good idea to compile each one in the corresponding version of LV; or just mass compile the folder).
Now when you run LabVIEW, you will have menu item: Tools -> Save - Retain LV Version...
When you select that menu item, it will save the current VI for whichever version of LabVIEW it was last saved for.
I will really appreciate if you will be able to implement the same for LabVIEW Snippets (I mean Edit->Create VI Snippet from Selection - Retain LV Version)...
11-29-2024 07:28 AM
@Andrey_Dmitriev wrote:
@paul_a_cardinale wrote:
Place the attached VI in all of your ...\LabVIEW 20??\project\ folders.
(it's a good idea to compile each one in the corresponding version of LV; or just mass compile the folder).
Now when you run LabVIEW, you will have menu item: Tools -> Save - Retain LV Version...
When you select that menu item, it will save the current VI for whichever version of LabVIEW it was last saved for.
I will really appreciate if you will be able to implement the same for LabVIEW Snippets (I mean Edit->Create VI Snippet from Selection - Retain LV Version)...
As far as I can tell, there is no way to programmatically create a Snippet.
11-29-2024 07:44 AM
@paul_a_cardinale wrote:
@Andrey_Dmitriev wrote:
@paul_a_cardinale wrote:
Place the attached VI in all of your ...\LabVIEW 20??\project\ folders.
(it's a good idea to compile each one in the corresponding version of LV; or just mass compile the folder).
Now when you run LabVIEW, you will have menu item: Tools -> Save - Retain LV Version...
When you select that menu item, it will save the current VI for whichever version of LabVIEW it was last saved for.
I will really appreciate if you will be able to implement the same for LabVIEW Snippets (I mean Edit->Create VI Snippet from Selection - Retain LV Version)...
As far as I can tell, there is no way to programmatically create a Snippet.
I will carefully say: "impossible is nothing", the snippet is just regular PNG with VI placed into custom data private chunk, but yes, at least not trivial.
11-29-2024 08:07 AM
@paul_a_cardinale wrote:
@Andrey_Dmitriev wrote:
I will really appreciate if you will be able to implement the same for LabVIEW Snippets (I mean Edit->Create VI Snippet from Selection - Retain LV Version)...
As far as I can tell, there is no way to programmatically create a Snippet.
There is the 'Code Capture Tool' which can create snippets. Not a 'one node' solution, but a starting point.
https://lavag.org/files/file/63-code-capture-tool/
https://www.vipm.io/package/lava_lib_code_capture_tool/?utm_source=vipm_desktop
11-29-2024 11:37 AM
I downloaded and attempted to open "Save - Retain LV Version.vi" in LabVIEW 2019. It appeared to "lock" LabVIEW -- the screen flickered briefly, a LabVIEW icon appeared on the Task Bar, but I couldn't open anything, couldn't get LabVIEW to respond, and had to resort to killing LabVIEW.exe.
I'm assuming that this is not "protected" code, and isn't supposed to simply hang LabVIEW if opened. I'll note that I didn't exactly follow your instructions -- I had not put it inside an existing LabVIEW Project, but just tried to open it as though it was a stand-alone VI (still residing in my "Downloads" folder). I also assumed that since you mentioned "LabVIEW 20??", it should have worked if I opened it with LabVIEW 2019.
I look forward to your comments.
Bob Schor
11-29-2024 03:09 PM
@Bob_Schor wrote:
I downloaded and attempted to open "Save - Retain LV Version.vi" in LabVIEW 2019. It appeared to "lock" LabVIEW -- the screen flickered briefly, a LabVIEW icon appeared on the Task Bar, but I couldn't open anything, couldn't get LabVIEW to respond, and had to resort to killing LabVIEW.exe.
I'm assuming that this is not "protected" code, and isn't supposed to simply hang LabVIEW if opened. I'll note that I didn't exactly follow your instructions -- I had not put it inside an existing LabVIEW Project, but just tried to open it as though it was a stand-alone VI (still residing in my "Downloads" folder). I also assumed that since you mentioned "LabVIEW 20??", it should have worked if I opened it with LabVIEW 2019.
I look forward to your comments.
Bob Schor
When you open it directly it's supposed to do nothing. And it doesn't really do anything; but it leaves its FP open and hidden (which seems to be hard to recover from if nothing else is open).
You don't need to put it in a Project, you need to put it in the folder ...\National Instruments\LabVIEW 201xx\project\
Note that 'Run When Opened' has to be set for it to work as a menu item.
Attached is a version that closes its FP even if it's run incorrectly.
It should work in any LV version from 2018 onward.
12-01-2024 02:05 AM
@Andrey_Dmitriev wrote:
I will really appreciate if you will be able to implement the same for LabVIEW Snippets (I mean Edit->Create VI Snippet from Selection - Retain LV Version)...
While the CCT, linked to by UliB, doesn't have this specific option, it does have the option of selecting the version to save the snippet to.
I don't remember offhand the details of what happens if you select a version which doesn't support features which exist in the code you're capturing. A quick test shows that the image appears correctly and that LV tries to do the standard mutation. I haven't checked what happens when there is no mutation path.
In theory, it shouldn't be difficult to add a checkbox to default to the save version of the VI.
Also, it might be useful to have the snippet option available when no selection has been made (and then you need to select the entire BD). That change is probably a bit more complex.
12-01-2024 07:25 AM
@tst wrote:
@Andrey_Dmitriev wrote:
I will really appreciate if you will be able to implement the same for LabVIEW Snippets (I mean Edit->Create VI Snippet from Selection - Retain LV Version)...
While the CCT, linked to by UliB, doesn't have this specific option, it does have the option of selecting the version to save the snippet to.
I don't remember offhand the details of what happens if you select a version which doesn't support features which exist in the code you're capturing. A quick test shows that the image appears correctly and that LV tries to do the standard mutation. I haven't checked what happens when there is no mutation path.
In theory, it shouldn't be difficult to add a checkbox to default to the save version of the VI.
Also, it might be useful to have the snippet option available when no selection has been made (and then you need to select the entire BD). That change is probably a bit more complex.
I looked at the Code Capture S/W. I'm not willing to search for, and dig out, the part that saves a snippet.
12-01-2024 02:33 PM
OK, I think I get it. I didn't realize this was plunked into a location within C:\Program Files (x86)\National Instruments\project, where it apparently is incorporated into how LabVIEW behaves during (Project, I assume) development.
I'm sure there is a lot of cool and interesting stuff inside this little VI. If it is not "protected", is there a "safe" way to open it and look at (and try to understand) what it is doing? It is always useful to extend one's knowledge ...
Bob Schor