LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find icon position of currently executed VI on caller's block diagram

Solved!
Go to solution

Dear forum,

I currently try to use a LabVIEV VI as a simple sequencer: Several (very slow) actions have to execute one after another. Each action is represented by a Sub-VI, some actions are executed several times. My task is to visualize the currently executed Sub-VI somehow.

 

My first intention (simply manipulate the icon of the currently running VI with "VI Icon.Get as Image Data" / "VI Icon.Set from Image Data" invoke nodes) failed, because this changes the icon of ALL instances of this VI; if you use the same VI several times, the icons of all these VI are changed (see here: http://forums.ni.com/t5/LabVIEW/How-to-change-animate-icon-of-currently-running-VI/m-p/3120754/highl...

 

My current approach is to use an image of the block diagram (with "VI: Block Diagram: Get Image Scaled" invoke method) within a picture control of the front panel and to work within this control. But for this I need to know the position of the icon of the currently executed VI. I know that I can evaluate Bounds and Position via the GObj properties, but how do I find the currently running VI (note that a VI may reside several times on the block diagram, so the name of the VI is not unique)? IMHO the simpliest way would be if a VI could find its icon on the caller's block diagram itself when executed...

 

It's clear that this position is not the position on the picture yet, but this conversion is a small piece of work...

 

Regards,

cpschnuffel

 

 

0 Kudos
Message 1 of 17
(5,036 Views)

Getting the VI icon is a cute idea (writing it sounds dangerous), just write it to a picture control on your sequencer front panel. If you want some log/history, just make an array of it. E.g. a cluster with an icon and a string with the VI name.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 17
(5,015 Views)

Maybe something similar to this? (I like how it turned out)

/Y

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 17
(5,005 Views)

Hi Yamaeda,

thanks for your reply. Maybe I did not express myself well: my goal is to highlight the icon of the currently executed VI within the block diagram (or within an image of the block diagram which resides in a picture control on the front panel) to show the user which part of his sequence is just executed, like this:

 

Untitled 1.jpg

 

A "sequence" is a VI with all the capabilities of LabVIEW (loops etc.), so a list of VI icons in an array (as I understand your suggestion) doesn't fulfill my needs. This VI contains self-written Sub-VIs with some functionality (controlling hardware etc.). I want to show the user which of these self-written VIs is currently executed, so he can see which steps are already done and which steps have still to be executed.

 

To place a marker on the Sub-VI(s) currently executed, I need the position of its icon on the block diagram of the calling VI. If I have this position, I can calculate the position of the icon within the image of the block diagram.

 

Regards,

cpschnuffel

 

 

 

 

 

0 Kudos
Message 4 of 17
(4,997 Views)

If you create a VI with this snippet and call this VI from another VI, this snippet returns all positions and bounds of its own icon within the block diagram of the calling VI - but which of them is just executing (sorry, snippet is quick and dirty...)?

 

snippet.png

 

Regards,

cpschnuffel

0 Kudos
Message 5 of 17
(4,996 Views)
Keep in mind that the typical operator for a test sequence has no idea what a block diagram or VI is. It's probably enough to just show the name of each sequence and its status - pass/fail, running, pending as done by TestStand for example. A simple progress bar is often enough to show that the sequence is running. Your idea sounds kind of neat but you may be overthinking the whole thing.
0 Kudos
Message 6 of 17
(4,985 Views)

Hi Dennis,

thanks for your reply.

 

Normally you are absolutely right, but this is not my idea, but the idea of the customer; the user is no typical operator and knows LabVIEW.

 

 

Regards,

cpschnuffel

0 Kudos
Message 7 of 17
(4,978 Views)

Run it in highlight mode, done. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 17
(4,969 Views)

@Yamaeda wrote:

Run it in highlight mode, done. 🙂


Sure if you don't mind having functional checks taking hours instead of minutes...okay maybe that is exagerating for a simple VI like this, but it would increase cycle time.  Honestly I think the best solution would be to use the helper VI that was mentiond before, which keeps track of what VI is running.  You can of course use scripting to get the block diagram image, but there isn't a good way to know what exact VI is running using VI server.  Here are a few discussions.

 

https://lavag.org/topic/16660-how-to-get-actual-vi-execution-state/

https://decibel.ni.com/content/thread/18687

0 Kudos
Message 9 of 17
(4,962 Views)

Hi Hooovahh,

I agree with you that highlighting mode is no possible solution for me because the execution time is dramatically increased.

 

Which helper VI do you mean? <IconList.vi> from message 3?

 

I will now check your very interesting discussion links; stay tuned...

 

Regards,

cpschnuffel

0 Kudos
Message 10 of 17
(4,943 Views)