Understanding of OPC UA

OPC UA has been in contact for some time, began only know that it will be in an important industry 4.0 communication protocol (IEC 62541). Out of curiosity, to find out. I see the main contents include: Open62541 library and uaExpert, uamodeler and other software tools. But also read a lot of articles on the OPC UA standard text and networks. But always felt foggy, dragon head, not the tail.

      As the saying goes, "do not know the truth, just because in this mountain." In learning new computer technologies, we tend to be Pitougainao of various terms, data structures, functions, protocols, model brought to the ditch. And forget to think what it is? It solves the problem? Why did you do this? These fundamental problem. Sometimes really do not understand, such a complicated thing is thought out? Large companies used to trick it?

     There is a morning, I suddenly epiphany, OPC UA is to achieve the objects described in a distributed system, what Node Yeah, variable Yeah, reference it, was simply trying to describe an object! OPC UA importance in industry is 4.0 through object-oriented technology, physical devices, sensors, motors described as an object, to form a digital model. Let different software that can control the equipment like the calling object.

     So, I feel slow, along the object-oriented thinking, to explore the nature of OPC UA.

Object-Oriented Programming

       An important part of software design is to abstract the physical world objects into digital models. One of the most important technology is the object-oriented programming techniques. For example, for a motor, we can be abstracted as the following class

class Motor {
a float Speed;
int direction;
a float Current;
a float Voltage;
a float temperature;
void Start ();
void STOP ();
}
         This class describes the basic characteristics of the motor, they include speed, direction of rotation, the working current, voltage and temperature. Wherein the method comprises the starting and stopping.

In the process, we can instantiate the class motor, and control of the parameters and parameter instance. E.g:

MOTOR1 Motor, MOTOR2;
motor1.speed = 1200;
motor.direction = CCW;
motor.start ();
Delay (10)
motor.stop ();
object-oriented programming is the most popular method of programming, OPP popular languages C ++. The greatest benefit of object-oriented programming is highlighted by the interface, shielding the details. Improve the modularity and reusability of software.

Distributed Object

And application class is defined in a program. If the object-oriented concepts to extend between programs, or what will happen between networks of different procedures? It really did.

   A distributed computing environment, program call each other between the first use of RPC (Remote Procedure Call) mode. But for the next more complex cases, a better way is to use a distributed object technology. The computer program can call any object in the network. This is also in line with the needs of practical applications, such as automatic control SCADA program starts the main motor (motorA) on the injection molding machine, it evolved into a target motorA calling injection molding machine controller start function. Therefore, the concept of object-oriented programming objects to the distributed system derived, generated the concept of distributed objects.

  Common techniques include a distributed object

Microsoft's COM / DCOM (Distributed Component Object Model )
national organizations OMG's CORBA (Common Object Request Broker Architecture)
 

OPC

Before understanding of OPC UA, we first understand some of its predecessor OPC protocol. This is more conducive to understand the nature and the origin of OPC UA.

OPC is based on Microsoft's DCOM technology for exchanging data between devices and software. This also means that OPC can only run on a window system needs to be configured before running Window's OPC COM / DCOM. In the run named line, type "DCOMCNFG" configuration can be seen in the window of the service component (I do not know the details). However, one thing you can do is that OPC is running windows can only operate on an industrial PC and PC. this is the best choice in the window of world domination era. If you want a PLC and PC software OPC communications, industrial computers required by Windows To be done..

 

New understanding of OPC UA

  Now, we come to understand the nature of re OPC UA it! OPC UA OPC is the successor to the standard, but later increased the UA, means "unified architecture" (Unified Architecture). Its main purpose is to get rid of windows! Platform-independent implementation and the OPC.

Evolution from the OPC to OPC UA, its purpose has not changed, is still distributed object technology in order to achieve a distributed control system, but it's way into a platform-independent. For open systems. This means that we can achieve the OPC server on a Arm / linux platform, or achieve Client program in the cloud linux platform.

opc ua code is sufficiently small, in fact OPC UA server side may be directly integrated into the PLC, sensors or small gateway.

Once you understand the nature of things, we can strategically advantageous position to understand many details. Now we take a look at many of the concepts of OPC UA.

1 Information Model (Information model)

OPC UA use object (Objects) system as represented by the basic data and process activities. Object contains variables, events and methods, which are connected to each other by a reference (reference). The object-oriented programming concepts and methods are very similar.

OPC UA information model is a network of nodes (Network of Node,), otherwise known as structured in FIG. (Graph), by a node (node) and reference (the References) composition, such a configuration diagram of the address space is called OPC UA. This graphical structure may describe a wide range of structured information (objects).

 

Nodes (nodes): a total of eight kinds of nodes (objects, object type, variable, variable type, views, methods, references, data type)

 

 

Maybe we can more easily through some examples of the ability to understand such a node diagram describes the object.

Node view (view node)

If we want to establish a model opc ua device, the device has an analog input and a digital output, two methods, namely readAnalog and ReadDigital. If you use this model to describe the C ++ classes, like the following.

Sensor {class
public:
Double Analog;
uint32_t Digital
Double readAnalog (int Port)
uint32_t readDigital (int Port)
}
If a node in the graph will be described first to distinguish between the different types of nodes

 

FIG respective nodes like the following

 

If you are familiar with C ++ object-oriented programming, C ++ classes and OPCUA of nodes in the graph may correspond to them, it is easier to understand how the OPC UA information model is built.

opc ua model design tools:
the OPC UA model described in XML file, XML can then be compiled into C ++ language by a compiler tool.

In order to facilitate the establishment of opc ua information model, requires the use of model editing software, they produce small-scale model of XML, and then compiled into C language program.

 

UaModeler is more popular, but this is a commercial software. Free software in python's opcua-modeler, can be found at the following address

https://github.com/FreeOpcUa/opcua-modeler

Compilation Tools

python ./nodeset_compiler.py --types-array = UA_TYPES --existing ../../deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml --xml myNS.xml myNS
use of object-oriented programming to look at the concept of OPC UA information model helps to understand many of the concepts of OPC UA. At least I like this.

This reminds me of the "mathematical language" in the definition of mathematics, mathematics is the study model of discipline, mathematics by natural and physical scaffolding built, when the natural and physical scaffolding evacuated, but people can not understand mathematics Palace how it built up.
---------------------
Author: Yaojiawan
Source: CSDN
Original: https: //blog.csdn.net/yaojiawan/article/details/88990351
copyright notice : This article is a blogger Yaojiawan original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/mooncher/p/11005197.html