Opc-Ua Client Function - Hitachi CE50-10 Instruction Manual

Table of Contents

Advertisement

F.2 OPC-UA client function
We provide the following programs to use the CE50-10 as an OPC-UA client.
• Library: OSS Open62541
• Sample programs for operation verification: tutorial_server_variable.c (server program) and
client.c (client program)
(1) Compiling a program that uses the OPC-UA library
To compile a C program that uses Open62541, run the following command.
$ gcc C-program-file-name -lopen62541 -o program-name
(2) Verifying operation of the OPC-UA sample program
You can run the sample program to check communication between the client and the server via the OPCUA protocol.
The following describes how to run the sample program. [Enter] in command examples indicates pressing of the
Enter key on the keyboard.
1. Copy the sample program to any directory.
$ cp /usr/share/open62541/examples/{tutorial_server_variable.c,client.c} .
2. Compile the sample program.
$ gcc client.c -lopen62541 -o client
$ gcc tutorial_server_variable.c -lopen62541 -o server
3. Run the sample program.
$ ./server &
$ ./client
When OPC-UA communication is successful, the following appears.
Connection 5 | SecureChannel 2 | Session ab3211ff-db96-588f-bc5b-358373d79d49 | Act
ivateSession: Session activated
4. Terminate the client, and then terminate the server.
To terminate the client, Press the Ctrl and C keys at the same time.
To terminate the server, run the following command.
$ kill %1
This concludes operation verification of the OPC-UA sample program.
F. Option Functions for Application Programs
169

Advertisement

Table of Contents
loading

Table of Contents