Feb
29

Active VI Toolkit public alpha – Erlang style message passing concurrency toolkit for LabVIEW

by Tomi Maila, Feb 29, 2008 at 4:54 pm
1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.40 out of 5)
Loading ... Loading ...

Active VI Toolkit logo ExpressionFlow today announced a public alpha release of Active VI Toolkit, an Erlang style message passing library for development of concurrent LabVIEW applications. The toolkit provides easy-to-use LabVIEW language abstractions for writing concurrent applications based on message passing between parallelly executing VIs. ExpressionFlow Active VI Toolkit greatly simplifies the authoring of highly concurrenct LabVIEW applications.

Download now!

Background

A few months ago I compared the LabVIEW and Erlang concurrency models in my article Two Paths to Concurrency – Comparing Erlang and LabVIEW. Whereas Erlang concurrency model provides means to write highly concurrent highly scalable applications, LabVIEW dataflow model allows very easy ways to write concurrent applications taking advantage of a few processor cores.

Active VI Toolkit is a research project, whose aim is to find the best way to fit Erlang style concurrency model into LabVIEW so that LabVIEW developers can take advantage of both concurrency models depending on their needs. The main design goal in the development of the toolkit so far has been simplicity of use. To reach this design goal, the toolkit tries to utilize existing LabVIEW language aspects as well as possible; the intention is not to reinvent the wheel.

The Active VI Toolkit consists of two modules, the Active VI Toolkit module and a One-Time Store module. Active VI Toolkit module provides language abstractions for message passing whereas One-Time Store module provides language abstractions for returning values as response to received messages.

Active VI Toolkit basics

The Active VI Toolkit is based on a concept of parallely executing VIs (LabVIEW functions) called Active VIs. When a new Active VI instance is created, the connector pane connected controls are initialized in exactly the same way as in a normal subVI (function) call. When an Active VI instance is created, a new thread is spawned that will execute the Active VI. Or to be more precise, a new parallel VI is executed that will call the Active VI.

After the Active VI has been initialized and started, it can usually execute some internal initialization procedures and then start waiting for messages in a loop. The messages can be send to the Active VI with a Send Message to Active VI node. The messages are identified by label and type of some wire connected to type type input of the node. The messages are passed to Active VI as value change events of Active VI front panel controls and can received with a LabVIEW event structure.

When an Active VI needs to be stopped, it’s sent a special Close message with some timeout value using a Close Active VI node. If the Active VI cleanly closes within this timeout, the values of Active VI connector pane indicators are passed to the VI requesting the Active VI to close, otherwise the Active VI will be aborted.

The very basics of creating an Active VI, sending a simple message to an Active VI and Closing an Active VI can be seen in the figure below. The first node on the left creates a new Active VI instance from a strict static VI reference and initializes with string value expressionflow.com. The second node sends a message My Message of type I32 with value 7 to the Active VI. The third. node requests the Active VI to close with infinite timeout and returns the value of the error out indicator on the Active VI connector pane.

Creating, sending message to and closing an Active VI

Writing an Active VI itself is very simple. What is practically needed is some connector pane connected controls and indicators to pass initialization data and return values to and from the Active VI. In addition one needs some controls that define the supported messages and a event structure to handle the receiving of the messages. Usually one also wants to have a while loop to receive more than one message only. Nothing else is needed. A simple Active VI block diagram is illustrated in the figure below.

Basic Active VI block diagram

A basic library that ships with Active VI Toolkit is One-Time Store Toolkit. One-Time Store is a by-reference type that can store a single value of chosen type. It is very similar to a LabVIEW single element queue. However, once the value of the One-Time Store is set, it can never be modified again. In computer science terms One-Time Store is a dataflow variable. However I chose not to use this term as it might confuse LabVIEW users that usually think of dataflow in a little different way.

One-Time Stores can be used as place holders for asynchronous replies to sent messages. The figure below illustrates initializing an empty One-Time Store of string type and sending the One-Time Store reference to an Active VI within a message. After the message is sent, the sender can start waiting for a value of the One-Time Store to be set by the Active VI. In the figure the One-Time Store is immediately destroyed after the value is received. However this doesn’t need to be the case.

Using a One-Time Store as a place holder for a response from an Active VI

From Active VI point of view, replying to this message is simple. To respond to the sender only needs to set the One-Time Store value. Receiving the message in the above image and replying to it is illustrated in the image below.

Active VI responding to a message using a One-Time Store reference

Conclusions

In this post I covered the very basics of Active VI Toolkit. The Active VI toolkit is much more powerful a toolkit that is directly evident from this post. I left some aspects and properties of the toolkit out of this post and will discuss about them in my later posts. Also note that the Active VI toolkit is currently at alpha pre-release version targeted for mainly for concept testing and public discussion.

I’ll soon post follow-up articles on more advanced features of the Active VI toolkit. Meanwhile download the Active VI toolkit from and play around with it and provide us feedback. I especially appreciate feedback on the concept itself and how it could be made better.

Download now!

Print This Post Print This Post

Download Full Movie Online Bridget Jones's Diary download movie Perfect Parents download movie The Invisible download movie Once download movie Cypher download movie Night Skies download movie Spaceballs download movie Gotti download movie Little Murders download movie Nuns of saint archangel, the download movie Krull download movie Family business download movie Prague duet download movie Wake in fright download movie Robin hood download movie Are you being served download movie lg flare ringtones ringtones wallpaper free ringtones for you cell free ringtones 4 metro pcs Bridget Jones's Diary download movie Perfect Parents download movie The Invisible download movie Once download movie Cypher download movie Night Skies download movie Spaceballs download movie Gotti download movie Little Murders download movie Prometheus Triumphant: A Fugue in the Key of Flesh download movie The Grudge 3 download movie The Thirteenth Floor download movie Erik the Viking download movie V.I. Warshawski download movie Fire from Below download movie White Christmas download movie The Show download movie Get Rich or Die Tryin' download movie Coach Carter download movie Los bastardos download movie Dirty Pictures download movie Patriot Games download movie Very Young Girls download movie 'A' gai waak download movie Second in Command download movie Seeing Other People download movie The Hockey Champ download movie Ocean's Eleven download movie Gutterballs download movie The Five People You Meet in Heaven download movie Smiley Face download movie Invasion of the Body Snatchers download movie Finish Line download movie Double Agent download movie Rescue Dog download movie Anchorman: The Legend of Ron Burgundy download movie