You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/UserGuide/Master/Tree/API/Programming-OPC-UA_timecho.md
+40-59Lines changed: 40 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,55 +21,19 @@
21
21
22
22
# OPC UA Protocol
23
23
24
-
## 1. OPC UA
24
+
## 1. OPC UA Subscription Data
25
25
26
-
OPC UA is a technical specification used in the automation field for communication between different devices and systems, enabling cross platform, cross language, and cross network operations, providing a reliable and secure data exchange foundation for the Industrial Internet of Things. IoTDB supports OPC UA protocol, and IoTDB OPC Server supports both Client/Server and Pub/Sub communication modes.
26
+
This feature allows users to subscribe to data from IoTDB using the OPC UA protocol. The communication modes for subscription data support both Client/Server and Pub/Sub.
27
27
28
-
### 1.1 OPC UA Client/Server Mode
28
+
Note: This feature is not about collecting data from external OPC Servers and writing it into IoTDB.
29
29
30
-
-**Client/Server Mode**:In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
- OPC UA will organize the device information received from Sink into folders under the Objects folder according to a tree model.
40
-
41
-
- Each measurement point is recorded as a variable node and the latest value in the current database is recorded.
42
-
43
-
### 1.2 OPC UA Pub/Sub Mode
44
-
45
-
-**Pub/Sub Mode**: In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
| SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
62
-
| SourceNode | Data type of the measurement point | NodeId | Int32 |
63
-
| Message | Data | LocalizedText | 3.0 |
64
-
65
-
- Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
66
-
67
-
68
-
## 2. IoTDB OPC Server Startup method
32
+
## 2. OPC Service Startup Method
69
33
70
34
### 2.1 Syntax
71
35
72
-
The syntax for creating the Sink is as follows:
36
+
The syntax to start the OPC UA protocol:
73
37
74
38
75
39
```SQL
@@ -110,31 +74,29 @@ start pipe p1;
110
74
111
75
### 2.4 Usage Limitations
112
76
113
-
1. **DataRegion Requirement**: The OPC UA server will only start if there is a DataRegion in IoTDB. For an empty IoTDB, a data entry is necessary for the OPC UA server to become effective.
114
-
115
-
2. **Data Availability**: Clients subscribing to the server will not receive data written to IoTDB before their connection.
77
+
1. After starting the protocol, data needs to be written to establish a connection. Only data after the connection is established can be subscribed to.
78
+
2. Recommended forusein standalone mode. In distributed mode, each IoTDB DataNode acts as an independent OPC Server providing data and requires separate subscription.
116
79
117
-
3. **Multiple DataNodes may have scattered sending/conflict issues**:
80
+
## 3. Examples of Two Communication Modes
118
81
119
-
- For IoTDB clusters with multiple dataRegions and scattered across different DataNode IPs, data will be sent in a dispersed manner on the leaders of the dataRegions. The client needs to listen to the configuration ports of the DataNode IP separately.。
120
-
121
-
- Suggest using this OPC UA server under 1C1D.
122
-
123
-
4. **Does not support deleting data and modifying measurement point types:** In Client Server mode, OPC UA cannot delete data or change data type settings. In Pub Sub mode, if data is deleted, information cannot be pushed to the client.
82
+
### 3.1 Client / Server Mode
124
83
125
-
## 3. IoTDBOPC Server Example
84
+
In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
126
85
127
-
### 3.1 Client / Server Mode
86
+
* Features:
87
+
* OPC UA organizes device information received from the Sink into folders under the Objects folder according to a tree model.
88
+
* Each measurement point is recorded as a variable node, storing the latest value from the current database.
89
+
* OPC UA cannot delete data or change data type settings.
128
90
129
-
#### Preparation Work
91
+
#### 3.1.1 Preparation Work
130
92
131
93
1. Take UAExpert client as an example, download the UAExpert client: https://www.unified-automation.com/downloads/opc-ua-clients.html
132
94
133
95
2. Install UAExpert and fill in your own certificate information.
134
96
135
-
#### Quick Start
97
+
#### 3.1.2 Quick Start
136
98
137
-
1. Use the following SQL to create and start the OPC UA Sink in client-server mode. For detailed syntax, please refer to: [IoTDB OPC Server Syntax](#syntax)
99
+
1. Use the following SQL to create and start the OPC UA Sink in client-server mode. For detailed syntax, please refer to: [IoTDB OPC Server Syntax](./Programming-OPC-UA_timecho.md#_2-1-syntax)
138
100
139
101
```SQL
140
102
create pipe p1 with sink ('sink'='opc-ua-sink');
@@ -176,7 +138,26 @@ insert into root.test.db(time, s2) values(now(), 2)
176
138
177
139
### 3.2 Pub / Sub Mode
178
140
179
-
#### Preparation Work
141
+
In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
142
+
143
+
- Features:
144
+
145
+
- Each measurement point is wrapped as an Event Node in OPC UA.
146
+
147
+
- The relevant fields and their meanings are as follows:
| SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
153
+
| SourceNode | Data type of the measurement point | NodeId | Int32 |
154
+
| Message | Data | LocalizedText | 3.0 |
155
+
156
+
- Events are only sent to clients that are already listening;if a client is not connected, the Event will be ignored.
157
+
- If data is deleted, the information cannot be pushed to clients.
158
+
159
+
160
+
#### 3.2.1 Preparation Work
180
161
181
162
The code is located in the [opc-ua-sink package](https://github.com/apache/iotdb/tree/rc/2.0.1/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua)under the iotdb-example package.
182
163
@@ -187,7 +168,7 @@ The code includes:
187
168
- Client configuration and startup logic(ClientExampleRunner)
The metadata is automatically created and enabled here.
201
182
202
-
2. Use the following SQL to create and start the OPC UA Sink in Pub-Sub mode. For detailed syntax, please refer to: [IoTDB OPC Server Syntax](#syntax)
183
+
2. Use the following SQL to create and start the OPC UA Sink in Pub-Sub mode. For detailed syntax, please refer to: [IoTDB OPC Server Syntax](./Programming-OPC-UA_timecho.md#_2-1-syntax)
Copy file name to clipboardExpand all lines: src/UserGuide/V1.3.x/API/Programming-OPC-UA_timecho.md
+38-57Lines changed: 38 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,56 +18,19 @@
18
18
19
19
# OPC UA Protocol
20
20
21
-
## OPC UA
21
+
## OPC UA Subscription Data
22
22
23
-
OPC UA is a technical specification used in the automation field for communication between different devices and systems, enabling cross platform, cross language, and cross network operations, providing a reliable and secure data exchange foundation for the Industrial Internet of Things. IoTDB supports OPC UA protocol, and IoTDB OPC Server supports both Client/Server and Pub/Sub communication modes.
23
+
This feature allows users to subscribe to data from IoTDB using the OPC UA protocol. The communication modes for subscription data support both Client/Server and Pub/Sub.
24
24
25
-
### OPC UA Client/Server Mode
25
+
Note: This feature is not about collecting data from external OPC Servers and writing it into IoTDB.
26
26
27
-
-**Client/Server Mode**:In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
- OPC UA will organize the device information received from Sink into folders under the Objects folder according to a tree model.
38
-
39
-
- Each measurement point is recorded as a variable node and the latest value in the current database is recorded.
40
-
41
-
### OPC UA Pub/Sub Mode
42
-
43
-
-**Pub/Sub Mode**: In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
| SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
61
-
| SourceNode | Data type of the measurement point | NodeId | Int32 |
62
-
| Message | Data | LocalizedText | 3.0 |
63
-
64
-
- Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
65
-
66
-
## IoTDB OPC Server Startup method
29
+
## OPC Service Startup Method
67
30
68
31
### Syntax
69
32
70
-
The syntax for creating the Sink is as follows:
33
+
The syntax to start the OPC UA protocol:
71
34
72
35
```sql
73
36
create pipe p1
@@ -95,7 +58,7 @@ create pipe p1
95
58
| sink.user | User for OPC UA, specified in the configuration | String | Optional | root |
96
59
| sink.password | Password for OPC UA, specified in the configuration | String | Optional | root |
97
60
98
-
### 示例
61
+
### Example
99
62
100
63
```Bash
101
64
create pipe p1
@@ -107,21 +70,20 @@ start pipe p1;
107
70
108
71
### Usage Limitations
109
72
110
-
1.**DataRegion Requirement**: The OPC UA server will only start if there is a DataRegion in IoTDB. For an empty IoTDB, a data entry is necessary for the OPC UA server to become effective.
111
-
112
-
2.**Data Availability**: Clients subscribing to the server will not receive data written to IoTDB before their connection.
113
-
114
-
3.**Multiple DataNodes may have scattered sending/conflict issues**:
73
+
1. After starting the protocol, data needs to be written to establish a connection. Only data after the connection is established can be subscribed to.
74
+
2. Recommended for use in standalone mode. In distributed mode, each IoTDB DataNode acts as an independent OPC Server providing data and requires separate subscription.
115
75
116
-
- For IoTDB clusters with multiple dataRegions and scattered across different DataNode IPs, data will be sent in a dispersed manner on the leaders of the dataRegions. The client needs to listen to the configuration ports of the DataNode IP separately.。
117
76
118
-
- Suggest using this OPC UA server under 1C1D.
77
+
## Examples of Two Communication Modes
119
78
120
-
4.**Does not support deleting data and modifying measurement point types:** In Client Server mode, OPC UA cannot delete data or change data type settings. In Pub Sub mode, if data is deleted, information cannot be pushed to the client.
79
+
### Client / Server Mode
121
80
122
-
## IoTDBOPC Server Example
81
+
In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
123
82
124
-
### Client / Server Mode
83
+
* Features:
84
+
* OPC UA organizes device information received from the Sink into folders under the Objects folder according to a tree model.
85
+
* Each measurement point is recorded as a variable node, storing the latest value from the current database.
86
+
* OPC UA cannot delete data or change data type settings.
125
87
126
88
#### Preparation Work
127
89
@@ -181,11 +143,30 @@ start pipe p1;
181
143
182
144
:::
183
145
184
-
### Pub / Sub Mode
146
+
### Pub / Sub Mode
147
+
148
+
In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
149
+
150
+
- Features:
151
+
152
+
- Each measurement point is wrapped as an Event Node in OPC UA.
153
+
154
+
- The relevant fields and their meanings are as follows:
| SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
160
+
| SourceNode | Data type of the measurement point | NodeId | Int32 |
161
+
| Message | Data | LocalizedText | 3.0 |
162
+
163
+
- Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
164
+
- If data is deleted, the information cannot be pushed to clients.
165
+
185
166
186
167
#### Preparation Work
187
168
188
-
The code is located in the [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/rc/1.3.3/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua) under the iotdb-example package.
169
+
The code is located in the [opc-ua-sink](https://github.com/apache/iotdb/tree/rc/1.3.5/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua) under the iotdb-example package.
189
170
190
171
The code includes:
191
172
@@ -194,7 +175,7 @@ The code includes:
194
175
- Client configuration and startup logic(ClientExampleRunner)
0 commit comments