My First OPC Client Project

Top  Previous  Next

Here, it will be explained how to create and deploy a simple OPC client project with our components.

This tutorial is for non-experienced programmers.

 

Step 1: Download and install Gelecek OPC Client Components Installer

This package includes OPC Client Components Basic Package, OPC Classic Connector,

OPC UA Connector and some auxiliary software.

 

Step 2: Open Visual Studio, start a new project named "MyFirstProject"

my first project

 

Step 3: Add a new tab to toolbox named "Gelecek Software"

Right Click on Toolbox, and click on Add Tab

toolbox add tab

 

Step 4: Add Gelecek Software Components to new toolbox tab

 Right click on Gelecek Software tab, click on Choose Items.

toolbox choose items

 

Choose Toolbox Items form appears, click on Browse...

choose toolbox items 1

 

Go to Gelecek Software\Gelecek OPC Client Components folder

Choose GelecekCommon.dll file.

choose toolbox items2

 

Click on OK to confirm.

choose toolbox items3

 

Step 5: Repeat step 4 for other Dll files

GelecekOPCClassicConnector.dll

GelecekOPCUAConnector.dll

GelecekOPCClientComponentsBasicPackage.dll

 

You will see all components on toolbox

toolbox gelecek items

 

Step 6: Drag and drop 2 gNumericBoxes from Toolbox to Form1

 

put gnumericbox to form

Nag screen appears. This means you use demo version of our software.

You will see this nag screen frequently, until you buy a license.

nag screen

 

Now make gOPC property settings for both of gNumericBoxes.

gopc property

 

Use property editor. Choose Classic OPC DA Server as server type.

Click on [...] button to open Classic OPC Server list. Select OPCSample.OpcDaServer, click OK

This server is installed with our software.

opc editor 1opc editor 2

 

On property editor click on Browse button. You will see all OPC Items defined in server's namespace.

Choose "Static/Analog Types/Int" and click OK.

opc editor 3opc editor 4

 

 

Step 7: Run project and check OPC connection

run project

Click on first gNumericBox, touch keyboard appears. You see the red keyboard sign in gNumericBox,

This means that touch keyboard is connected to this control.

Note that you don't have to use touch keyboard. You can enter a new value with standard keyboard as well.

touch keyboard open

 

Write a new value (12 in this example) on touch keyboard, and click on Enter button of touch keyboard.

- New value is transferred to gNumericBox.

- "Write Result : OK" note appears on touch keyboard. This means that new value has been writen to OPC server

successfully.

- After a short time new value appears on second gNumericBox.

This means that you changed the value of opc item "Static/Analog Types/Int" through first gNumericBox,

and second gNumericBox displayed this new value.

 

touch keyboard enter value

 

Step 8: Compile(Build) project

Compile project and see there is no error.

compile project

 

Check output path of project.

Open project properties, then open Build tab.

Check output path:

output path

 

Open this output folder and run MyFirstProject.exe by double clicking on it.

This is the second test.

debug folder

 

Step 9: Deploy (Distribute) your project

Once you completed and tested your project, you may move it to another computer (runtime computer).

On runtime computer, you will need some prerequisite software installed.

- Operating system should be Windows.

- .NET framework should be installed.

Check your project's target framework. You can change this target framework as you want.

target framework

Your project's target framework should be installed on runtime computer.

Good news: Net Framework 3.5 is installed as a part of Windows 7,

Net Framework 4.5 is installed as a part of Windows 8.

 

If it is not installed, you can download it from Microsoft Website, it is a free software.

 

- OPC server you want to connect should be installed. In this example: OPCSample.OpcDaServer.

 

- OPC core components should be installed. This is because your project is an OPC Client project.

There are 2 versions: x64 for 64 bit operating systems, x86 for 32 bit operating systems.

Choose appropriate one.

This is a free software from OPC foundation, and can be downloaded from our web site.

This is also a part of our install package.

 

- As the last step, As the simplest deployment method, move whole Debug folder to runtime computer.

Run MyFirstProject.exe by double clicking on it.

Check OPC connections.

 

Note that you see demo software nag screen on runtime computer as well.

 

Step 10: Licensing

When you buy a license, install it to your development computer.

You do not need to install license to runtime computers.