Tutorial 3. Remote access to FreeSCADA channels
Written by Michael   
Monday, 24 August 2009

Sometime there is a need to distribute data from single “server” box with a number of devices connected to several clients without physical access to server. If so, then you might be interesting in remote access feature of FreeSCADA. It allows you to setup dedicated server, specify appropriate connections to devices using standard protocols (OPC, MODBUS) and retranslate these channels to several clients. Our internal protocol is HTTP based which technically allows you to access this data from other sub networks. For example retrieve data over Internet.

image001.png

Starting from version 2.0.0.8 FreeSCADA distribution includes CLServer module and appropriate communication plugin which will allow you to establish these connections. In general you need the following:

  • Create empty project and define connections to devices. It will be used by server.
  • Start server application and make sure that appropriate ports are opened for remote access.
  • Create project with visual stuff and connect it to the server.
  • Distribute project with visual schemas to clients.

For the first step open designer and create data channels you need. You can use any of available plugins.

MODBUS




OPC




In this example I will use Simulator data as a bit simpler thing to reproduce.
 




So, I defined several variables for the project and now it can be saved. Let’s call it “server-channels.fs2”

Next step is to start CLServer. It has several command line options:

Option Description
--help, -h, -? Displays help on available commands
-f, --project-file The server will get all information on communication channels from this file.
-p, --port Specifies TCP port for the server. Default value is 8080

Type the following in command line:
clserver.exe --project-file="d:\server-channels.fs2" --port=8081

If server started successfully you should see the following:
Command line FreeSCADA server  version 2.0
Copyright (c) FreeSCADA project

Initializing communication plugins... Done.
Server address http://localhost:8081/
Press <ENTER> to terminate

In some cases operation system doesn’t allow application to register new HTTP namespace for the server. If you see such error message, look for OS documentation of how to fix that. In general, if you start this server using Administrator account, everything should be fine.

So, the server is now running and we can proceed to next step and create new project with visual schema which displays data from our server. Start Designer and open “FreeSCADA remouting properties…” window and click on “Import” button. There we need to specify our server address and port number. After clicking “Connect” it should show a tree of server channels like on the picture.




That’s it. Now click “ok”. That will save our settings and make it available for visual schema.

For new schema I placed 3 textboxes with “variable N = “ labels.


Then associate these labels with channels using binding command.

On the binding window select “Text” property on the left list and “Bind to string type” option from combobox on the top. Then click “Create association”. It will create new binding, but it still empty. Double click on variable from right tree view to add new argument into the association and modify text template like on the picture (insert “{0}” into appropriate position).

Repeat this for next two labels. Then save the project and open in Runtime module. You will see how these variables are changing over time.



Last Updated ( Monday, 24 August 2009 )