07-06-2021 04:13 PM
Hello, I found few methods, but results are wrong - many connections get broken.
This picture below shows screen dump from LabVIEW window:
And this next was acquired programmatically (using VI Invoke "Node BD.Get Image Scaling") - here the broken connections can be seen:
The problem is that LabVIEW handles the VI alone, aside from the project the VI belongs to - and does not recognize objects defined in the project.
I tried to open the project in the application (the Open VI Reference function has an "application reference" input and I tried passing there a reference which I used to open the project with Application Invoke Node Project.Open), but the result was the same.
Possibly there is some way to tell the LabVIEW "handle the VI in a project context", but I spent 2 days looking for a way to do it, without success. Has anyone an idea?
Thakns in advance, Jerzy Tarasiuk
07-07-2021 01:30 PM
Have you tried the Print Method ?
07-07-2021 02:41 PM
I think the trick is that you are looking at FPGA code and each FPGA target in the project is its own application context. You were right in that you have to use the application reference input for the open VI reference function but it has to specifically be the application reference of the FPGA item. I did this for a very simple project and you can see I got the project reference and instead of going straight to getting the application reference I had to traverse the project to find the FPGA target (I cheated a bit by only having one item under my computer so I could just index the first item from the ownedItems[] array).
07-07-2021 02:43 PM
Post your script; I'll take a look at it.
07-07-2021 03:44 PM - edited 07-07-2021 03:46 PM
Right today i tried the following - result as previously:
I will also try something like the script posted here by Jacobson.
.
07-08-2021 12:14 PM
The Jacobson's script did not work, but it told me a proper direction to go.
Here is a working VI block diagram (and the VI is attached):
The key is: use Application Invoke Node Project.Open, then get Project Property Node Targets, and find between them a target for which the VI is one of OwnedItems[] obtained from the target Property Node; then use the target Property Node to get Application and finally use the Application to open the VI.
Seems now it is working correctly for few VI-s I tried and I hope for the same for other VI-s.
Thanks for help which pointed me to the solution.
Jerzy Tarasiuk
07-09-2021 10:56 AM
Yet another version - this processes all VI-s of a project.
pvibd2img1.vi - Convert BDs of all VI-s of a project to PNGs
controls: ProjectPath, LogFilePath, VI full paths, Image Counter in
indicators: -, Log path out, -, Image Counter out
* ProjectPath - a full path of LVPROJ file
* LogFilePath - a path of LogFile, may be relative
* VI full paths - full paths or names only of VI-s are listed
* Image Counter in - initial value for an image counter (0)
* Log path out - an expanded path of LogFile
* Image Counter out - final value of the image counter
Images are created in Application Directory, using names
bd%u.png, where the %u is substituted by the image counter;
the counter is incremented before its values is used, so
if it was 0, images will be named bd1.png, bd2.png, etc.
07-12-2021 07:22 AM
Try this:
07-13-2021 09:13 AM
I tried my script on a project containing a VI which uses as SubVI a VI not being in the project. And the SubVI was not processed, therefore I modified the script, adding an ability to process dependencies (it is optional, controlled by Dependencies button.
I tried to use Find SubVIs property, but it didn't return SubVI-s used by a VI or a Target.
The included VI (as well as previous) can be invoked as a SubVI (e.g. by a main VI
which reads a list of project paths and makes FP/BD images of all VI-s in them).
Maybe it will be helpful for someone wanting to quickly review several projects.
By using a VI Invoke Node Print.VItoRTF, an RTF output can be created. In such a case, images of many VI-s can be output to one file if using Append input of the Invoke Node.
04-07-2022 05:12 PM - edited 04-07-2022 05:27 PM
Additional information on the pvibd2img2.vi
Controls (inputs to the VI):
LogFilePath (Path/String)
ProjectPath (Path/String)
VI Full Paths (Boolean) Show full paths of VI-s in log
Image Counter in (Integer) Image names "bd%u.png", start from number+1
Dependencies (Boolean) Get dependent VI which aren't in the project
Indicators (outputs from the VI):
Log path out (Path/String; full path)
Image Counter out Copy it to "in" before the next run
Log contains lines:
VI=<path>.vi
Image=bd<count>.png
- they tell which PNG is for which VI.
Below the VI block diagram: