LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the current frame of an Event Structure

Is there a way to read the current frame (or state?) of an Event Structure?

Richard






0 Kudos
Message 1 of 17
(3,457 Views)

Without scripting I don't think so.

 

With scripting, I don't know.

 

I'm a bundle of help today. Smiley Very Happy

0 Kudos
Message 2 of 17
(3,444 Views)

Normally a program would not stay in an event case for long enough for the phrase "current frame" to have much meaning.  What are you trying to do?

 

Lynn

0 Kudos
Message 3 of 17
(3,436 Views)

I'm assuming you're talking about an edit-time feature.

 

In older versions there wasn't. I don't remember seeing anything about 2010 adding such a property, but it's worth checking out, since it was requested. If you search the LV APIs group, you can find some older discussions on this.


___________________
Try to take over the world!
0 Kudos
Message 4 of 17
(3,435 Views)

@johnsold wrote:

Normally a program would not stay in an event case for long enough for the phrase "current frame" to have much meaning.  What are you trying to do?

 

Lynn


Like tst assumed, it's for edit time use. Some events take a few seconds, and the progress would be nice to watch on the FP like you'd typically do with a state machine, and with dynamic events (as opposed to just user events), it would be nice to see where the structure is going.

 

I have tried something with scripting as shown, but it's not much help. There's no property "Current Frame" or similar. Visible Frame (as shown) doesn't do it.

 

22883iD5031411E919744D

Richard






0 Kudos
Message 5 of 17
(3,426 Views)

The simple solution is to just put a string constant in each frame of the event structure that has the name of that event typed in it, and wire it out through a tunnel to a string indicator.

Message 6 of 17
(3,415 Views)

 


@broken Arrow wrote:

Like tst assumed, it's for edit time use.

 

When I said edit-time, I meant a situation in which the VI is NOT running. Such access can be useful when creating various editing tools.

 

Your case is run-time, and I would agree with the others that using a string is better (not to mention not using the event structure as a state machine, but that's another discussion).


___________________
Try to take over the world!
0 Kudos
Message 7 of 17
(3,409 Views)

@Ravens Fan wrote:

The simple solution is to just put a string constant in each frame...


Ahow about my New Idea?   This would be simpler and more robust.

Richard






0 Kudos
Message 8 of 17
(3,390 Views)

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.  If you look over at the BD, one frame is showing, but the VI could be executing a different frame at that time.

 

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.

0 Kudos
Message 9 of 17
(3,385 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 17
(3,376 Views)