This article will introduce most popular OPC product: Kepware OPC
Server and its plug-ins.
1.
What’s OPC
OPC is short of OLE
for Process Control.
While OLE is
short of Object Linking and Embedding.
An example of
OLE is to insert an Excel table to Word.
Diagram 3.5-1: Function of OPC
From diagram
3.5-1, we can see that the key function of OPC is: to convert address of PLC
Data Block into Memory Tag, which can be read/write by MES via OPC client.
In best practice,
if PLC needs to talk to upper systems, normally it will store data into
specific interface Data Block, which can be used by upper system easily:
Tag |
Data
Type |
Address |
HB_FLAG |
Bool |
DB1010.DBX0.0 |
DATA_READY |
Bool |
DB1010.DBX0.1 |
STATON_NUMBER |
Int |
DB1010.DBD2 |
SN |
String[40] |
DB1010.STRING4 |
But these
address can not be accessed by MES directly.
After OPC
mapping, these PLC Tags are similar to any other memory variables, and OPC
server can read/write them directly.
And we can install
OPC client in MES server, so that we can read/write these Tags easily.
Till now
there’re 2 typical standard OPC protocols: OPC DA and OPC UA.
OPC DA is short
of OPC Data Access, it’s based on Microsoft’s DCOM technology, it has been used
for decades, it’s very popular, but it can only be installed in Windows
platform. Due to limitation of DCOM, OPC DA has big security concerns, and it’s
very complicated to configure settings.
OPC UA is short
of OPC Unified Architecture, it can be used in Windows platform, and can also
support Linux + Java environment, but it’s not used widely.
2.
DataLogger
DataLogger is a plug-in of Kepware, it can log OPC Tag’s values into
Database automatically.
For the request of PLC data collection, this plug-in can match such
request, it only needs some simple settings, doesn’t require any coding.
After data is logged into Database, we can write logic in Database
Procedures or Application Layer, to handle the data accordingly.
For example, we need to run PMC in a Welding Shop, to collect
equipment status data, then we can use OPC DA + DataLogger to collect data,
then we write a Trigger and a Stored Procedure to handle the data.
3.
ODBC Driver
DataLogger can
only write Database, cannot read data from it, so data can only transfer from
PLC to MES.
But in some
cases, PLC needs to read data from Database.
For example in
Welding Shop, we need to download Orders and sync time to PLC, then we can use
ODBC Driver to accomplish it.
ODBC Driver
configures Database as a special device, uses ODBC engine to connect to
Database and read/write data.
We can create 2
interface Table, one for storing Orders, one for time synchronization.
OPC server can
read these 2 Tables, and then write data to PLC via OPC DA.
4.
Advanced Tags
Advanced Tags is
a group of plug-ins, here we introduce the most popular one – Link Tag.
Link Tag can link
2 tags, so if 1st tag changes its value, then 2nd tag
will change automatically.
Here we
introduce 2 use cases.
Use case 1: PLC
communication. We do assembly in area A, and do checking in area B. If we
failed checking in area B, then Andon system needs to notify area A PLC. Considering
that the distance between 2 areas is quite long, and there’s not interaction
between 2 processes. So we don’t need to add any additional hardware such as
Coupler, instead we can use OPC DA + Link Tag to communicate.
Use case 2: PLC
updates data to MES. DataLogger can write Database with limitation: it can only
insert data. But ODBC Driver can update Table. So we can use OPC DA to monitor
PLC Tags, and with help of Link Tag and ODBC Driver, we can map them into data
which is stored in Database.
5.
IoT Gateway
IoT Gateway is
short of Internet of Things Gateway.
Kepware provides
4 types of IoT Gateway:
-
MQTT client
-
REST client
-
REST server
-
ThingWorx Gateway
The first 3
types are quite simple to configure and use.
MQTT is short of Message Queuing Telemetry Transport, is a specific
message queuing service used in long-distance and narrow-band network. For
example in Machining Shop, network signal is not quite stable, in that case we
can use MQTT to collect PLC data without upgrading network.
Rest is short of Representational State Transfer, is a widely used protocol
which transfer data in real time and stable.
REST client can monitor PLC tag, once it changes, then it will call
MES REST server, to push data to MES. For example as for vehicle travel record
of AVI system, we can use REST client to upload data in real time.
REST Server provides a listener, which expose PLC tags, and MES can
call commands via REST client. For example if MES needs to lock an Order, then
it can write data to PLC via REST client.
As for ThingWorx
Gateway, it should be configured with Thingworx platform together.
没有评论:
发表评论