Distributed Control & Automation Framework (DCAF)

cancel
Showing results for 
Search instead for 
Did you mean: 

Any good example only for using Tag Bus instead of CVT to share data among three processes?

Hello, 

 

I am using Actor Framework and would like to share data among multiple Actors.  For that purpose, I wonder Tag Bus is a way to go, since it is recommended as a replacement for traditional CVT.  Tag Bus has been installed on my environment and can see Tag and Data Dictionary , etc on function palette.  However, I cannot find an example to how to use them as a replacement for CVT.  Does anyone know any good example of sharing data among multiple processes by Tags, Data Table, Data Dictionary?  Also, does anyone know the best recommended methods to share latest values among Actors?  

Thank you.

 

0 Kudos
Message 1 of 5
(3,244 Views)

Tag bus is CVT on the wire. The main advantage it has is that is not a global variable so it allows you to provide scope to your tags. The best example of using it instead of CVT is DCAF. This framework was build using TagBus instead of CVT. https://github.com/LabVIEW-DCAF/Documentation

Best Regards

Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 2 of 5
(3,239 Views)

In an AF implementation, the Tag Bus could be used as class private data within the scope of a particular Actor to hold a data dictionary of various typed scalar data.  If you have only a single data type to support (or need to support lookups of complex structured data by name), consider using a Map data type instead (which did not exist in LabVIEW when Tag Bus or CVT was created).

 

Tag Bus is not really appropriate for sharing data between actors, rather it is designed to efficiently manage the data within elements of a particular process.

 

If you wanted to transfer data between Actors, you could do so via messages where a partial Tag Bus is the message payload, but this would really only make sense in a subset of applications.  You're typically better served by limiting the amount of data that needs to be shared between Actors to what is needed to fulfill a request message.

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 3 of 5
(3,235 Views)

You don't specify how your actors are arranged. 

If you have a tree of Actor A calling nested actors B and C - it is preferred for C to send a message to A that A then sends down to B. Don't be concerned about the overhead. (Unless you are sending a lot of high speed data).

 

I have added a few independent actors to non actor code base. ( mainly because I have issues with reliably killing processes which the AF solves). It does take some thought. 

I have created  messages for actors to register a user event for the caller. This seems to work well. And later when I needed to add another event it was quite easy.

 

0 Kudos
Message 4 of 5
(3,230 Views)

Hello, thanks a lot all for the advice.  

 

Sorry that details were not described in the first post.  Please let me share some more details.  

To make it simple, let's say, there is a main process and two child processes (Process A, Process B) at least.  (no Real-Time, everything runs on Windows.  Real-Time may be considered in future)

 

Process A asynchronously handles communication between PXI and external system (such as an engine test bench via XNET).  There are multiple communication states between PXI and the external system such as disconnected / connected / configuration received / safety button pressed / running / etc.   Process A notifies any changes of communication states to the main process by messages (such as Abstract Messages of Actor Framework).  Once Process A transfers into "running" state, it is supposed to do single-point IO between the external decive at a fixed interval such as 50 [msec]. (about 30 inputs in DBL, 10 outputs in DBL)

 

Process B asynchronously generates stimulus data to the external device, based on pre-configured "recipe". Process B also acquires response data from the external device, compares the values with pre-configured warning conditions, and notifies if any warning / emergency conditions occurs. This process runs at a fixed interval such as 50 [msec].

 

In this situation, I would like Process A to handle all communication with the external device as a stand-alone HW IF process. As mentioned above, Process A has two interface; messaging for state control/update, and sharing of IO data. For the messaging, yes, AF provides great methods. However, sharing IO data between processes may be implemented by simpler mothods other than messaging. At this point, I started wondering if CVT could be the candidate.

 

Hopefully these additional details make things clearer for you.  Please give me any additional advice if you come up with any based on these information, such as "that is something DCAF should perfectly fit", etc.  

 

Thank you all.

0 Kudos
Message 5 of 5
(3,202 Views)