From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I quickly get all the open Block Diagrams

Hi All,

I am building a 'BD-Mosaic' LabVIEW IDE Tool.

For this tool I need all the VIs which BDs are open. However getting all the VI references for an application, results in >300 VIs, getting the BD.Status property of every VI takes up to 3 seconds.

Not very good...

Has anyone a quick method to get all the VIs with an open Block diagram?

Most favourable would be an invoke node : App.OpenBlockDiagrams

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 1 of 7
(5,108 Views)

Have you benchmarked exactly where your problem is occurring?  Querying for the BD.State property takes between 10µs and 20µs on my machine (3.0GHz Core 2 Duo processor).  How are you getting the VI references?

0 Kudos
Message 2 of 7
(3,270 Views)

App.AllVIs in memory.

Will do some more benchmarking on friday.

Have you tried getting the BD.Status as well?

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 7
(3,270 Views)

GetBDState.png

Using the above code, it took between 250ms and 350ms to query a bit over 600 VIs and controls.  If you are using a build array primitive in your query code, this may be causing the slowdown.

I do not have a BD.Status property.  I suspect a localization difference.

0 Kudos
Message 4 of 7
(3,270 Views)

A few years ago Jack Hamilton put together a utility called Workspace that would save and restore the layout of open VIs on the desktop.

I rewrote and extended it to include open block diagrams, give a list of files, browse the files to exclude restore of given VIs, etc and called it Workspace2000 and later Workspace2003 setup to be aTools menu item in LabVIEW.

I used it all the time to take a snapshot of my desktop, then close all the open VIs (there is a button to do that, it also allows you to save VIs if needed before closing), then open another desktop layout of VIs for a different client's work.  I couldn't live without it. However, then LabVIEW projects came around.

The code is rather old, (V6.1) so it should run on everything, maybe even RT (not sure).

It does not handle the Project and associated memory spaces and application/project references. That was my next item to add, but things have been to busy and the next version was pushed back a lot.

If it helps, hooray.  It would be nice to see some more tools /IDE stuff of this type.

Cheers,

Mike Ashe

0 Kudos
Message 5 of 7
(3,270 Views)

Is there not a way (LabVIEW or OS) to get all application's windows?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 7
(3,270 Views)

My bad, the code I used on the open BDs was the actual slow code.

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 7
(3,270 Views)