LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically move virtual folders and contents into a library

I have been attempting to automate a process that converts my LabVIEW project with auto populating folders into a packed library build without disturbing the original project. I have so far been able to accomplish the following automated steps:

1) Clone the project

2) Turn the auto-populating folders into virtual folders

3) Create an empty library in the cloned project

4) Create root level empty folders in the library

3) Set permission on the folders

 

Where I get stuck is in moving the virtual folders into the library. This is very easily done manually by dragging the folders into the library and seems to correctly resolve all of the VI dependencies without issue. I haven't been able to reproduce that behavior in an automated fashion. I have tried the following:

- Used AddItem invoke node on the library with a type 'Folder' and a path to the folder that was once auto-populating, but is now virtual. This only adds an empty folder of the same name and does not move any of the contents

- Tried AddItemFromMemory invoke node on the library, which doesn't generally work it seems because the items are not 'in memory' I have debugged enough to see that the names being passed to the invoke node are as expected and have made it work on other small test cases where the VIs were in the dependency list, but it doesn't appear to work on items that are on disk and included in the project generally

- The most success I have had was with a recursive VI that rebuilds the folder structure in the library. Each item that is moved is deleted from the virtual folder before calling AddItem to bring it back into the library (to prevent a load conflict which will throw an error). This generally works, but is VERY slow compared to the manual drag and drop and leaves unresolvable dependencies in some cases that seem to depend on the order in which I move the items. In particular, it leaves class references in the unknown state and can't automatically resolve them even though they are in the project library when all is said and done. These conflicts do not arise when I manually drag-and-drop.

 

Questions:

- Is there a way to automate the drag-and-drop of folders into the library that works so well manually?

- If so, how do I do it?

- If not, what can I do to achieve the same result?

 

Thanks!

 

LabVIEW Pro 2017 x64

Win 7

0 Kudos
Message 1 of 4
(2,171 Views)

Hmmm... the project file is just an xml file, so you could probably manipulate the xml file to include the desired folders and files.  I don't know what the effort involved is, though.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(2,143 Views)

I have partially implemented a solution like that as an alternative, but here are a couple of problems I have with it:

1) The way that LabVIEW links libraries and their contained items both ways makes it more difficult than it would be otherwise

2) What guarantee do I have that the xml file won't change format?

 

I am willing to implement it in this way if necessary, but I didn't want to reinvent the wheel if there was already an interface provided to accomplish the same thing. I was also even considering trying to somehow simulate the drag/drop mouse actions as a workaround, but I'm not sure if that is possible...

0 Kudos
Message 3 of 4
(2,140 Views)

I understand.  This should be a "last resort" option, not a "first resort" one.  Maybe someone familiar with scripting can help here?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(2,138 Views)