Actor Framework Discussions

Showing results for 
Search instead for 
Did you mean: 

Actor Framework and the CVT

Hello all,

I just wanted to grab some of your thoughts on using the current value table (CVT) API with the Actor Framework.  I have recognized my need for something similar to the CVT to maintain synchrnoization of current control setting between a server and multiple clients (I will not be using the LNA).  Unfortunately, the CVT is essentially a functional global that can be accessed across multiple actors thus breaking the intended use of the Actor Framework.  I like the idea of each actor communicating via queues, but I also don't want to totally refactor the CVT so that I have one actor in charge of maintaining the state.  Anyone have any thoughts on this?

Cheers, Matt

0 Kudos
Message 1 of 5

Option a) Put one actor on each machine in charge of all CVT interaction and let it send out messages to the rest of the system as needed.

Option b) Have each entry in the table be used by one and only one actor (per communicating machine) and just be disciplined in not letting anyone else read/write that entry.

0 Kudos
Message 2 of 5

Option a) is what I do.  I have my own network connectivity approach (not LNA), and the CVT is sent over this connection.  One Actor at each end point is responsible for maintaining the CVT at its end point, and every other actor talks to this actor for the data contained in the CVT.

0 Kudos
Message 3 of 5

So, after all of this time I thought that I would update this and let everyone know what I was doing.  I ended up implementing a simpler CVT format that was owned by the controller in charge.  I store all data using variant attributes (as in the more complete version of the CVT).  The one difference is that I am not interested in retrieving the exact value in the LV environment and therefore don't necessarily need methods that allow me to retrieve the value in the table in a non-variant form.  Rather, since this intended to track state across a network that is utilizing web services, I simply have a method to serialize the data in the variant to JSON for transmission.  So in the end, there are essentially two VIs associated with the CVT - Insert CVT Data and CVT to JSON.  For my purposes, this was considerably simpler and cleaner, allowing the Controller to dictate when, where and how data is written to the CVT.

Let me know if any of you would like to see the actual code.  The insert function is quite simple.  The serialize function is a little more complex given that it is a serialization problem, but still understandable (it uses some OpenG VIs for determining the stored types).

Cheers, Matt

0 Kudos
Message 4 of 5

Hi Cirrusio,


I know it's been  almost 5 years since this post, but I am undertaking a project that would require a mechanism like the one you're describing in your post. Would you still be willing to share your code with your implementation of the CVT and the actor controlling it ?


Many Thanks,



0 Kudos
Message 5 of 5