Thursday, August 25, 2011

SCCT - Tutorial for LabVIEW (STEP 1)

Hi,
Today we introduce SCCT for LabVIEW. you can get your evaluation copy at
http://www.toolsforsmartminds.com/products/SCCT.php

With this step by step tutorial we are going to see how to add SCCT features to an existing app.
We use a simple PID app created to control a pressure into a pipe.

Basic application is composed by only one VI, shown below:

VI panel is shown here:

We don't care for the moment about control theory, so we don't spend words on PID tuning, but we focus on SCCT library.

Now we want to monitor our application from remote locations, with a notebook, a tablet or a smart phone.
every platform requires a simple monitor application created with a specific programming language. For instance, if you want to monitor your app from a mobile with Android, you have to create a simple program in Java using SCCT for Java. Now we want to monitor our app from a PC so we are going to use SCCT for LabVIEW both for server side and client side.
Let's start from server side.
We want to publish PID output as well as PID target and process variable.
Take a look to the following diagram:


We added 3 VIs:
StartPublisher which starts publishing service as a background task into your application. it's a separated VI that takes care of sending and receiving data on the specified port.
PublishData which makes your data available to subscribers. notice that data must be organized into a 2D array where every row contains samples from a specific channel.
StopPublisher which closes background task and clears memory.
That's all!!
it's very simple, isn't it?

If you deploy this application, it handles multiple connections at the time with different devices, platforms and applications created in Java, VB, LabVIEW, ANSI C, and More.

Notice that we have described our system to incoming subscribers with a cluster which contains some details regarding our analog channels. this info are used by clients to properly present your data.

Now we take a look to the subscriber we want to create:
below you see its panel and diagram:




Notice that we use the same port for both server and client and the same API-Key "tutorial".
client diagram contains 4 SCCT VIs only:
openConnection which start a background task to handle incoming data.
transferStatus which says to the server "please you can start push data for me"
getAnalogData which returns analogData whenever ther are fresh data
closeCommunication which close background task and clears memory.

So in five minutes we added communication capabilities to an existing application.

I hope you enjoyed this tutorial.

No comments:

Post a Comment