LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send abstract message - actor framework

Hello all,

 

i just learning AF, and i need to send abstract message from nested to caller.

It is easy to do when i have for example only one value as message.

But trouble for me is when i need to send a cluster with many indicators.

Then in event loop of caller i have big amount of unbundled indicators.

What i am searching for is more elegant solution, to get only one output - cluster, and not this.

milan87_0-1647867375784.png

 

If someone can advise how to proceed?

 

Thanks.

0 Kudos
Message 1 of 10
(2,542 Views)

@milan87 wrote:

If someone can advise how to proceed?


For starters, give a kudo to these ideas: 

Provide Access to Full Event Data in Event Structures - NI Community.

Allow-Dynamically-Registered-User-Events-to-preserve-...

 

Can't help you with AF though.

0 Kudos
Message 2 of 10
(2,523 Views)

Yeah unfortunately this isn't an Actor Framework problem, it's a User Events one.

 

Try bundling the cluster into another cluster and see if that'll work.

0 Kudos
Message 3 of 10
(2,513 Views)

@milan87 wrote:

Hello all,

 

i just learning AF, and i need to send abstract message from nested to caller.

It is easy to do when i have for example only one value as message.

But trouble for me is when i need to send a cluster with many indicators.

Then in event loop of caller i have big amount of unbundled indicators.

What i am searching for is more elegant solution, to get only one output - cluster, and not this.

milan87_0-1647867375784.png

 

If someone can advise how to proceed?

 

Thanks.


That is not an Actor Framework abstract message. That is a user event. An AF abstract message works just like a regular AF message.The main difference with the abstract message is that the Send is in the Nested Actor and the Do is in the Caller Actor. You have to tell the Nested Actor what message to use in the Caller Actor when you launch using the vi that's created when you build the Abstract message.

0 Kudos
Message 4 of 10
(2,503 Views)

Hello All,

 

thanks for fast reply.
I'm aware that this is event structure problem...
That's why i trying to find solutions how to pass cluster from nested actor to caller actor.

To use abstract message somehow, to pass reference, or what to do?

I tried to pass reference of cluster via abstract message, abut this obviously doesn't work, because reference doesn't change value...

0 Kudos
Message 5 of 10
(2,467 Views)

@milan87 wrote:

Hello All,

 

thanks for fast reply.
I'm aware that this is event structure problem...
That's why i trying to find solutions how to pass cluster from nested actor to caller actor.

To use abstract message somehow, to pass reference, or what to do?

I tried to pass reference of cluster via abstract message, abut this obviously doesn't work, because reference doesn't change value...


Put the cluster in a cluster, and the event structure will return a cluster, not the individual elements.

 

Or, like AQ mentioned in the idea, use a class as a container.

 

I'm not sure if that is what you're after. Please clarify what you're looking for if it isn't.

0 Kudos
Message 6 of 10
(2,448 Views)

@milan87 wrote:

Hello All,

 

thanks for fast reply.
I'm aware that this is event structure problem...
That's why i trying to find solutions how to pass cluster from nested actor to caller actor.

To use abstract message somehow, to pass reference, or what to do?

I tried to pass reference of cluster via abstract message, abut this obviously doesn't work, because reference doesn't change value...


Use an abstract message to pass the data from the nested actor to the calling actor. In the calling actor you have options. You can pass the message to the helper loop from the method via a user event (like what I think that you're trying to do) and use a cluster in a cluster (or perhaps a variant) or you could use a value property node inside the method to write the data. Note that for the second method you need to have a reference to the control in the class private data and initialize it prior to receiving data. 

0 Kudos
Message 7 of 10
(2,439 Views)

Thanks all for the help.

I used cluster in a cluster, and seams that this is most elegant solution.

milan87_0-1648043041186.jpeg

 

Abstract message is created and  sent to a caller.

milan87_1-1648043056084.jpeg

In caller, event is generated when abstract message is received.

milan87_2-1648043080716.jpeg

Also message is connected to 'launch nested actor' and passed to enqueuer.

In 'do' VI looks everything ok, at least from my side...

But i have constantly error 1448, and program collapse.

Any idea what could be?

 

thanks

 

0 Kudos
Message 8 of 10
(2,399 Views)

Hi All,

 

i found what was the issue.

Error 1448 was thrown, because i accidentally use 'read self encueuer' instead 'read caller enqueuer', while sending abstract message.

 

Thanks.

0 Kudos
Message 9 of 10
(2,392 Views)

@milan87 wrote:

Hi All,

 

i found what was the issue.

Error 1448 was thrown, because i accidentally use 'read self encueuer' instead 'read caller enqueuer', while sending abstract message.

 

Thanks.


Glad to hear you solved that issue as well 😂.

0 Kudos
Message 10 of 10
(2,382 Views)