LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the current frame of an Event Structure


@Ben wrote:

Most of the events offer a control ref node taht can be used to get the name of the control associated with the event.

 

Does not help with the timeout case of course.

 

Ben


Yep, that almost works, but the User Events output a UsrEvtRef and not a CtlRef. Could still be used, but not without more wiring and more nodes.

Richard






0 Kudos
Message 11 of 17
(954 Views)

 


@Ravens Fan wrote:

The reason that the VisFrame EventStructure scripting property is not useful is that it only defines what frame is showing on your block diagram, and when you are running, it doesn't matter which is showing.


I bet if you turn on Execution Highlighting, which flips the frames as it executes, that the node would do what you're wanting. Doesn't solve BrokenArrow's problem, but might be useful to someone else.

 

0 Kudos
Message 12 of 17
(929 Views)

@Aristos Queue wrote:

 


@Ravens Fan wrote:

The reason that the VisFrame EventStructure scripting property is not useful is that it only defines what frame is showing on your block diagram, and when you are running, it doesn't matter which is showing.


I bet if you turn on Execution Highlighting, which flips the frames as it executes, that the node would do what you're wanting. Doesn't solve BrokenArrow's problem, but might be useful to someone else.

 


@and that was the second part of what I wrote:

 

"The exception, (and I haven't tried this to test it out), would be if you have highlight execution turned on since the BD changes its appearance from one event case to another depending on which code is running.  However, if you are doing something to debug event structures, then you probably aren't going to have Highlight execution turned on as that would completely mess up any event timing you are trying to look at."

 

Smiley Wink

0 Kudos
Message 13 of 17
(914 Views)

A bit off topic, but referring back to the code I posted, I can easily "find" the Event Structure labeled "hello" with the code shown. However, when I wrap a While Loop around the Event Structure, I can not find the Event Structure, and I've tried all sorts of things like using the labeled While Loop's refnum into the "owner" input, etc, with an array of names into name/order. Any help?

Richard






0 Kudos
Message 14 of 17
(897 Views)

When you are looking for objects buried in structures I recommend doing a traversal.  There is a great VI in the vi.lib to do this:

 

vi.lib\Utility\traverseref.llb\TRef Traverse for References.vi

 

This will return references to all Event Structures (probably not a large number if your VIs look like mine) which you can verify by label if necessary.

Message 15 of 17
(888 Views)

Thanks Darin, I didn't think of that.

BTW, that VI has been renamed and is on the VI Scripting palette as Traverse for GObjects.vi. The one you referenced still exists, but it is just a wrapper for Traverse for GObjects.vi (in 2010 that is).

Richard






0 Kudos
Message 16 of 17
(866 Views)

Ravens Fan wrote:

[...] 

The exception, (and I haven't tried this to test it out), would be if you have highlight execution turned on since the BD changes its appearance from one event case to another depending on which code is running. [...]


 

Purely academic, but I have confirmed this to be true. Not so useful of course, since you are running so slow you can just watch the structure. Smiley Wink

Richard






0 Kudos
Message 17 of 17
(854 Views)