From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inlineing Event Structure

Solved!
Go to solution

Hi everyone!

I try to inline several sub-vis for which i got rid of property nodes for example,

but i have one sub vi, that uses a event structure, but only with user events.

and it seems event structures are not inlineable.

 

i didn't find any specific documentation regarding inlining and event structures,

at least it is not listed as a no-go in the "VI Execution Speed" help page

 

I'd like to know the reasoning/cause for this,

or maybe if there is some way to do inlining of user-event-only event structures anyways.

 

regards and thx


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 1 of 13
(2,940 Views)
Message 2 of 13
(2,896 Views)

What an intriguing question!

 

If your sub-VI has only User-Defined Events, I wonder if you could get equivalent functionality with a Queue structure (which I just tested and found it can be in-lined) ...

 

Bob Schor

Message 3 of 13
(2,889 Views)

@Bob_Schor wrote:

 

If your sub-VI has only User-Defined Events, I wonder if you could get equivalent functionality with a Queue structure (which I just tested and found it can be in-lined) ...


But wouldn't you also get equivalent functionality with a VI that is not in-lined?

 

Typically, in-lining VI's makes sense when the overhead of calling a VI is large compared with it's execution time. In this case, the overhead seems very small.

 

0 Kudos
Message 4 of 13
(2,879 Views)

wiebe@CARYA wrote:

But why?


valid point Smiley Tongue .. at least for my vi with event structure .. because i thought i could do it


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 13
(2,862 Views)
Solution
Accepted by topic author jwscs

I've had a few cases where inlining an event structure could be useful.  It is a smaller reentrant VI that just registers for a reply and a quit user event, and then waits on one of them.  Since this is a smallish VI and could run often I could see some benefit from it but probably nothing very noticeable.  I think even if it is technically allowed to have an event structure with only user events, it might be hard for NI to enforce that, and is just easier to say no event structures at all in an inlined VI.

 

Oh another useful use for this might be with Malleable VIs.  These get inlined, and so won't work with an event structure, even if it is for user events only.

Message 6 of 13
(2,858 Views)

@Bob_Schor wrote:

What an intriguing question!

 

If your sub-VI has only User-Defined Events, I wonder if you could get equivalent functionality with a Queue structure (which I just tested and found it can be in-lined) ...

 

Bob Schor


yup, queues are inlineable and an alternative to event structure, but thats not what i was curious about 😉

(and i choose this abstraction, because i have several differing datatypes, and i didn't want to have to data-to-variant-to-data so much with one queue - or having multiple)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 13
(2,854 Views)

and just to be clear .. this question is purely academic,

in my actual case the vi is only executed once, so at least for this specific use-case there is no performance gain.

 

but as ho+vah+ noted .. there are some situations where it might be of use.

 

(@hooovahh does your regex find this?)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 8 of 13
(2,849 Views)

@Hooovahh wrote:

Oh another useful use for this might be with Malleable VIs.  These get inlined, and so won't work with an event structure, even if it is for user events only.


That is a valid point. For me, for now, Malleable VI's are a synonym for "asking for trouble". (Might be because I'm still stuck with LV2013 though).

 

Actually, it makes a great use case. A "Wait For (Any) User Event.vim" would be useful.

Message 9 of 13
(2,845 Views)

@jwscs wrote:

 

 but as ho+vah+ noted .. there are some situations where it might be of use.

 

(@hooovahh does your regex find this?)


It's not regex, just any post that has the following words:  hooovahh hoovahh hooovah hoovah, I also look for TDMS, TDM, XNode, LAVA and my first and last name.

 

But since I get notifications on threads I reply to I got this one anyway.

 

2013! Might as well have stone tablets (okay maybe not that bad).  I lived with 2011 development up until a couple of years ago and the biggest thing I missed being held back was conditional, and concatenating tunnels.

0 Kudos
Message 10 of 13
(2,822 Views)