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

Feb
01

Will Microsoft’s bid for Yahoo! have an affect on visual programming

by Tomi Maila, Feb 1, 2008 at 10:53 pm
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Today’s big news is that Microsoft made a $44.6bn takeover bid for Yahoo! And I thought Yahoo! was so 90′s.

If the deal goes ahead, will it have implications related the visual programming? We all know that NI is the leading developer of visual programming languages with its LabVIEW integrated programming language and development environment. However neither Microsoft nor Yahoo! have been completely quiet in this scene. Yahoo! has developed a domain specific visual programming environment Yahoo! Pipes for aggregating web feeds and other online information resources. Microsoft has developed a little similar tool, Mashup Creator, for their Popfly online web development environment. In addition Microsoft has a product called Microsoft Robotics Studio for robotics application development.

Even though the products of both Microsoft and Yahoo! are rather simple and restricted, they indicate that visual programming is slowly coming of age. However consolidation of services from the two companies doesn’t necessarily mean anything good for a minor field like visual programming. It’s very plausible that projects like Popfly and Pipes end up dead when giants like Microsoft and Yahoo integrate their organizations.

What do you think? Will Microsoft’s possible deal with Yahoo! have implications in the field of visual programming?

Print This Post Print This Post

Get Adobe Flash playerPlugin by wpburn.com wordpress themes