From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

User Events in the Actor Framework

Hi all,

I have started working with the Actor Framework. Right now I am still playing around with some examples. I have encountered a small problem I hope someone can explain to me:

In most tutorials you override the launch Init method and in it fill your actor with all the references it needs: Queues, Notifiers and what I am trying to do: User events. I now have the problem that when I connect the user event to the event structure and add the dynamic event it won't let me select the data from the event data node. Why is that?

In my understanding it's the same reference as if I'd have passed it directly. It can add the event correctly except for not letting me select the data. It works great, though, if I pass the event refernce from the create user event VI directly and even if I pass a constant to it.

Thanks for your help.



Remember Cunningham's Law
0 Kudos
Message 1 of 24
(6,906 Views)

That's odd, I'm doing this without a problem. Are you sure that your data is named? that is, the data you put in the create Event is a named constant? Otherwise it won't show the data.

create event.PNG

You might also try to put the data in a cluster (if it isn't already) and name the cluster and the event.

Good luck,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 2 of 24
(4,668 Views)

Hi,

guess you are referring to the Pre Launch Init?

So you have set up the dynamic User Event in Pre Launch Init, written the reference to the Actors private data and in the corresponding Actor Core.vi override you are accessing this reference.

Can you provide a screenshot of the Pre Launch Init and Actor Core?

Oli

0 Kudos
Message 3 of 24
(4,668 Views)

Thanks for the quick reply, here are two screenshots:

Pre Launch Init.PNG

Actor Core.PNG

The Range terminal in the event structure is a remainder from before, when I wired the reference directly to the event.

Nachricht geändert durch PeterFoerster: changed Screenshot of pre launch init.



Remember Cunningham's Law
0 Kudos
Message 4 of 24
(4,668 Views)

Try to use "Range" in a named cluster. See if that solves the problem.

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Message 5 of 24
(4,668 Views)

Why are you creating the UserEvent twice? This has nothing to do with your issue, but it confuses me a bit

Message 6 of 24
(4,668 Views)

dsavir: What strange magic is this? Now it works...

I still don't get two things:

1. Why does it work with a cluster? Direct wiring worked for the dbl only, yet when using the reference in the private data I need a cluster?

2. Where did the cluster itself go? I now can access the data within the cluster from the event, but not the cluster itelf... That could be a problem in some applications.

Oli: I normally don't create it twice, one is the thing I'm trying to do, the other the workaround when that didn't work.



Remember Cunningham's Law
0 Kudos
Message 7 of 24
(4,668 Views)

To second Danielle: it's no magic 😉

UserEvent.png

Remark:

I tend to put all my initialization stuff in my Actor Core.vi Override, since I can already send messages to its own queue.

Message 8 of 24
(4,668 Views)

I encountered the same issue the first time I tried events in actors (incidentally since then it works fine without the cluster - what LV version are you working with? I encountered it in LV 2012, now I'm with LV2014).

As for the cluster itself, I didn't actually think about it. Why should it be a problem in some applications?

Anyway, I'm glad that solved the problem!

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 9 of 24
(4,668 Views)

Oli, there is only one Danielle here

If you notice, the documentation specifically says that you can use an individual element with a label, which is what he tried to do to begin with. According to the documentation both should work, but in my experience the cluster always works while the individual element sometimes does not.

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 10 of 24
(4,668 Views)