04-20-2015 04:22 AM
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
Solved! Go to Solution.
04-20-2015 06:37 AM
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
04-20-2015 06:55 AM
Maybe something similar to this? (I like how it turned out)
/Y
04-20-2015 07:18 AM
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:
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
04-20-2015 07:31 AM
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...)?
Regards,
cpschnuffel
04-20-2015 07:53 AM
04-20-2015 08:11 AM
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
04-20-2015 08:28 AM
Run it in highlight mode, done. 🙂
/Y
04-20-2015 08:48 AM
@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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-20-2015 10:06 AM
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