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"
Step 3: Add a new tab to toolbox named "Gelecek Software"
Right Click on Toolbox, and click on Add Tab
Step 4: Add Gelecek Software Components to new toolbox tab
Right click on Gelecek Software tab, click on Choose Items.
Choose Toolbox Items form appears, click on Browse...
Go to Gelecek Software\Gelecek OPC Client Components folder
Choose GelecekCommon.dll file.
Click on OK to confirm.
Step 5: Repeat step 4 for other Dll files
You will see all components on toolbox
Step 6: Drag and drop 2 gNumericBoxes from Toolbox to Form1
Nag screen appears. This means you use demo version of our software.
You will see this nag screen frequently, until you buy a license.
Now make gOPC property settings for both of gNumericBoxes.
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.
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.
Step 7: Run project and check OPC connection
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.
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
- 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.
Step 8: Compile(Build) project
Compile project and see there is no error.
Check output path of project.
Open project properties, then open Build tab.
Check output path:
Open this output folder and run MyFirstProject.exe by double clicking on it.
This is the second test.
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.
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.