From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Nested Actor To Handel Parallel Tasks

So I have an actor that is responsible for a time critical high frequency DAQ task (Pulling data from a spectrometer), this actor has its own GUI where users can start and stop acquisition etc. From this actor I want to launch a nested actor that will be responsible for taking the acquired data and displaying it, doing some computations and saving to disk. The problem I am having is that if I set the new nested actor to inheret from the parent class that contains the DAQ task, then I have to have the parent implementation of this in the actor core of the nested actor, when really I just want the nested actor to act as all other actor cores and just handel messages as they arrive, not launch a duplicate of the actor core contatining the DAQ task.

Esentially I want the nested actor to have access to the parent class information that contains the DAQ task but to act as all other actor cores do, with the message handlong loop taking messages and processing them.

Any Ideas?

Thanks.

0 Kudos
Message 1 of 2
(3,560 Views)

If want to have two actor class with same data structure but different actor core implementation you shoud use third actor (something like abstract actor) as parrent class from which these two other actors class inherirts.  But you will still need copy data from task of parent actor into task of nested actor if u want communicate with same device.  You should avoid to use same task in two different actors unless you know what you are doing.

Message 2 of 2
(3,060 Views)