opcua 0.18 → 0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -17
- data/cert/cert.h +52 -52
- data/cert/cert_key.h +101 -101
- data/example/bug5.rb +1 -1
- data/example/client_get_float.rb +12 -0
- data/example/server_browse.rb +6 -0
- data/example/server_xml.rb +85 -0
- data/example/test +22 -0
- data/example/test.mpf +85 -0
- data/example/test1 +12 -0
- data/example/tester.mpf +85 -0
- data/example/turm.rb +13 -0
- data/ext/opcua/helpers/values.c +30 -2
- data/opcua.gemspec +1 -1
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e658783e674985e51fa8746d8816e236358b5cc489c7b43c358f508979ae2505
|
4
|
+
data.tar.gz: 117cf84b0c098589de29493100120b04bbfe3e92faf3c5845f5966eb17a919db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0546d8df45474fe1981be5ea5b01bc0dcb1dfcb6890fe62b32fa455c0cff3b27e236b6f8bb77ffb59108d9d63a1314069dc9eb97293e8c54475360c98b3e3c1
|
7
|
+
data.tar.gz: b682cc246d4080fae51c6adc19dff2924c9583c264a847d83b228276b8bc271d08a116ca375a87377eda58fce42100f74033f3afeb44ea6b0402ca630d8a7e42
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# OPC-UA Ruby Bindings (open62541)
|
2
2
|
|
3
|
-
The development of OPC UA applications takes currently a lot of effort. This is caused by the large possibilities of the OPC UA specification. With this
|
3
|
+
The development of OPC UA applications takes currently a lot of effort. This is caused by the large possibilities of the OPC UA specification. With this implementation we want to define some conventions, which shoud make the technology more useable.
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
@@ -33,7 +33,7 @@ Copyright (C) 2019-* Jürgen "eTM" Mangler
|
|
33
33
|
|
34
34
|
```sh
|
35
35
|
# Debian/Ubuntu
|
36
|
-
apt install build-essential cmake-curses-gui libmbedtls-dev libxml2-dev libxslt-dev libz-dev libssl-dev libicu-dev
|
36
|
+
apt install build-essential cmake-curses-gui libmbedtls-dev libxml2-dev libxslt-dev libz-dev libssl-dev libicu-dev
|
37
37
|
# Fedora/Redhat
|
38
38
|
dnf install @buildsys-build @development-tools cmake libxml2-devel libxslt-devel zlib-devel libicu-devel mbedtls-devel
|
39
39
|
```
|
@@ -43,22 +43,18 @@ Dependency: https://github.com/open62541/open62541 > 0.4 (master branch as of 20
|
|
43
43
|
```sh
|
44
44
|
git clone https://github.com/open62541/open62541.git
|
45
45
|
cd open62541
|
46
|
-
mkdir build
|
47
|
-
|
48
|
-
cmake ..
|
49
|
-
ccmake ..
|
50
|
-
# Configuration, see picture below
|
46
|
+
mkdir build && cd build
|
47
|
+
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=ON -DUA_ENABLE_ENCRYPTION=ON -DUA_ENABLE_ENCRYPTION_MBEDTLS=ON ..
|
51
48
|
make
|
52
49
|
sudo make install
|
53
50
|
gem install opcua
|
54
51
|
```
|
55
52
|
|
56
|
-
![ccmake Config](config.png)
|
57
|
-
|
58
53
|
If the installation works correctly, but examples are still complaining about missing lib62541.so, try this:
|
59
54
|
|
60
55
|
```sh
|
61
|
-
sudo echo "/usr/local/lib"
|
56
|
+
sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf # add to libs path
|
57
|
+
sudo echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf # add to libs path
|
62
58
|
sudo ldconfig # update libs
|
63
59
|
sudo ldconfig -p | grep libopen62541 # check if its there
|
64
60
|
```
|
@@ -75,7 +71,7 @@ The server has following functions:
|
|
75
71
|
* Find nodes in the adress space
|
76
72
|
* Loop for getting real life data
|
77
73
|
|
78
|
-
Every server application uses the
|
74
|
+
Every server application uses the Daemonite gem, which allows to run the server as service.
|
79
75
|
```ruby
|
80
76
|
Daemonite.new do
|
81
77
|
on startup do |opts|
|
@@ -101,7 +97,7 @@ server.add_namespace "https://yourdomain/testserver"
|
|
101
97
|
```
|
102
98
|
|
103
99
|
|
104
|
-
#### Create ObjectTypes
|
100
|
+
#### Create ObjectTypes
|
105
101
|
|
106
102
|
Basically all new created types are subtypes of the _BaseObjectType_. With ```server.types.add_object_type(:TestObjectType)``` a new type is defined in the information model. All nodes of the new created type are defined in the ```tap{}``` region.
|
107
103
|
|
@@ -137,7 +133,7 @@ With ```.add_object(:TestObject)``` a new object named _TestObject_ is added. Th
|
|
137
133
|
|
138
134
|
##### Add Method
|
139
135
|
|
140
|
-
Methods are added with the ```.add_method(:TestMethod)``` function. Per default the method has no input and output arguments. By adding additional arguments you can define input arguments. The code for defining a method with input arguments looks like
|
136
|
+
Methods are added with the ```.add_method(:TestMethod)``` function. Per default the method has no input and output arguments. By adding additional arguments you can define input arguments. The code for defining a method with input arguments looks like
|
141
137
|
```ruby
|
142
138
|
t.add_method :TestMethod, inputarg1: OPCUA::TYPES::STRING, inputarg2: OPCUA::TYPES::DATETIME do |node, inputarg1, inputarg2|
|
143
139
|
#do some stuff here
|
@@ -148,7 +144,7 @@ in the ```do...end```section you write the code which should be executed by call
|
|
148
144
|
|
149
145
|
#### Manifest Objects
|
150
146
|
|
151
|
-
ObjectTypes can be instiantiated with the ```.manifest``` method.
|
147
|
+
ObjectTypes can be instiantiated with the ```.manifest``` method.
|
152
148
|
|
153
149
|
```ruby
|
154
150
|
testobject =server.objects.manifest(:TestObjectType, to)
|
@@ -164,7 +160,7 @@ testobject.delete!
|
|
164
160
|
|
165
161
|
#### Find Nodes in the Addressspace
|
166
162
|
|
167
|
-
To get a specific node you should use the ```.find``` method.
|
163
|
+
To get a specific node you should use the ```.find``` method.
|
168
164
|
```ruby
|
169
165
|
tv = to.find :TestVariable
|
170
166
|
```
|
@@ -195,7 +191,7 @@ You can assign vlaues without definig a datatype. The correct _DataType_ will be
|
|
195
191
|
#### Loop for getting Real Life Data
|
196
192
|
The server loop looks like follows:
|
197
193
|
```ruby
|
198
|
-
run do
|
194
|
+
run do
|
199
195
|
sleep server.run
|
200
196
|
to.value = 'Testvariable1'
|
201
197
|
p to.value
|
@@ -204,7 +200,7 @@ The server loop looks like follows:
|
|
204
200
|
end
|
205
201
|
```
|
206
202
|
|
207
|
-
The loop starts with ```sleep server.run```. This is recommended by the open62541 developer. With the ```.value``` function you can write or get the value of a node.
|
203
|
+
The loop starts with ```sleep server.run```. This is recommended by the open62541 developer. With the ```.value``` function you can write or get the value of a node.
|
208
204
|
|
209
205
|
### Client
|
210
206
|
TBD. See examples subdirectory.
|
data/cert/cert.h
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
unsigned char cert_der[] = {
|
2
2
|
0x30, 0x82, 0x03, 0x18, 0x30, 0x82, 0x02, 0x00, 0xa0, 0x03, 0x02, 0x01,
|
3
|
-
0x02, 0x02, 0x14,
|
4
|
-
|
3
|
+
0x02, 0x02, 0x14, 0x3e, 0xa5, 0xc9, 0x94, 0x89, 0x4f, 0x15, 0xee, 0x1b,
|
4
|
+
0x82, 0x04, 0xec, 0x09, 0x7e, 0xb7, 0x7a, 0xc7, 0x26, 0x3d, 0x2a, 0x30,
|
5
5
|
0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b,
|
6
6
|
0x05, 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
|
7
7
|
0x03, 0x0c, 0x0a, 0x72, 0x75, 0x62, 0x79, 0x2d, 0x6f, 0x70, 0x63, 0x75,
|
8
|
-
0x61, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x30,
|
9
|
-
|
10
|
-
|
8
|
+
0x61, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x36, 0x33, 0x30, 0x31,
|
9
|
+
0x34, 0x32, 0x31, 0x33, 0x34, 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36,
|
10
|
+
0x32, 0x30, 0x31, 0x34, 0x32, 0x31, 0x33, 0x34, 0x5a, 0x30, 0x15, 0x31,
|
11
11
|
0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0a, 0x72, 0x75,
|
12
12
|
0x62, 0x79, 0x2d, 0x6f, 0x70, 0x63, 0x75, 0x61, 0x30, 0x82, 0x01, 0x22,
|
13
13
|
0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
|
14
14
|
0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a,
|
15
|
-
0x02, 0x82, 0x01, 0x01, 0x00,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
0x62, 0x30,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
15
|
+
0x02, 0x82, 0x01, 0x01, 0x00, 0xbd, 0x8e, 0xc3, 0x44, 0xf2, 0x43, 0x2c,
|
16
|
+
0xcc, 0x2e, 0xa2, 0x22, 0xd2, 0x31, 0x6e, 0x38, 0x85, 0x53, 0x53, 0x5d,
|
17
|
+
0x55, 0x68, 0x39, 0x0e, 0xe6, 0x4c, 0x7d, 0xe5, 0xd0, 0x52, 0x92, 0x31,
|
18
|
+
0x1b, 0xb4, 0x4f, 0xde, 0xd7, 0xba, 0x52, 0xbb, 0xdb, 0x27, 0xf7, 0x12,
|
19
|
+
0x1f, 0xef, 0x86, 0x2c, 0x41, 0x98, 0xa1, 0xca, 0xd2, 0xfd, 0x01, 0x0a,
|
20
|
+
0xc7, 0x98, 0x71, 0x4b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x14, 0xa3, 0x1c, 0xdb, 0x5c, 0x25, 0x20, 0xf1, 0xa4, 0x9e,
|
35
|
+
0xd2, 0x40, 0x0b, 0x91, 0x84, 0x54, 0xb9, 0x55, 0x59, 0x49, 0x92, 0x5e,
|
36
|
+
0x3c, 0xeb, 0x55, 0x25, 0x66, 0x4a, 0xae, 0x6d, 0x89, 0x02, 0x03, 0x01,
|
37
37
|
0x00, 0x01, 0xa3, 0x60, 0x30, 0x5e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d,
|
38
|
-
0x0e, 0x04, 0x16, 0x04, 0x14,
|
39
|
-
|
40
|
-
|
38
|
+
0x0e, 0x04, 0x16, 0x04, 0x14, 0x69, 0xb6, 0x74, 0x81, 0xb7, 0x88, 0x44,
|
39
|
+
0x9f, 0x6e, 0xb3, 0xd6, 0x1f, 0x3c, 0x06, 0xe4, 0xbd, 0xe3, 0xbe, 0xbe,
|
40
|
+
0xe9, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
|
41
41
|
0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d,
|
42
42
|
0x11, 0x04, 0x15, 0x30, 0x13, 0x86, 0x11, 0x72, 0x75, 0x62, 0x79, 0x2d,
|
43
43
|
0x6f, 0x70, 0x63, 0x75, 0x61, 0x3a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
44
44
|
0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04,
|
45
45
|
0x03, 0x02, 0x05, 0xa0, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
|
46
46
|
0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|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 0x49, 0x30, 0xa2, 0xfa, 0xe7, 0x27, 0x6f, 0x6e, 0xe6, 0xbe, 0xa6,
|
60
|
+
0x9c, 0x28, 0x98, 0x34, 0x75, 0x27, 0x0b, 0x83, 0xdb, 0x93, 0xcc, 0x25,
|
61
|
+
0xa5, 0x6f, 0xa5, 0x0c, 0x56, 0xeb, 0xd5, 0x50, 0x8c, 0x76, 0x16, 0x6b,
|
62
|
+
0x44, 0xd5, 0x47, 0x35, 0x46, 0x4c, 0xb0, 0x9c, 0x8f, 0x7c, 0x21, 0x64,
|
63
|
+
0x57, 0x35, 0xba, 0x49, 0x8a, 0x1d, 0x12, 0x2c, 0x1d, 0xe0, 0xd8, 0x99,
|
64
|
+
0xc6, 0x36, 0xc1, 0x4f, 0x1a, 0x37, 0xd9, 0x6e, 0x95, 0xed, 0x94, 0x75,
|
65
|
+
0x3b, 0x3a, 0x21, 0x28, 0x28, 0xb3, 0x25, 0x5b, 0xb7, 0x5b, 0x00, 0x05,
|
66
|
+
0x72, 0xeb, 0x09, 0x43, 0x2a, 0x18, 0x17, 0x2b, 0x6d, 0x45, 0xe6, 0xaa,
|
67
|
+
0x90, 0xc8, 0x81, 0x61, 0x94, 0x8b, 0xd2, 0x72, 0xc0, 0x57, 0x0b, 0x29,
|
68
|
+
0x18, 0x5d, 0x3c, 0x81
|
69
69
|
};
|
70
70
|
unsigned int cert_der_len = 796;
|
data/cert/cert_key.h
CHANGED
@@ -1,103 +1,103 @@
|
|
1
1
|
unsigned char cert_key_der[] = {
|
2
|
-
0x30, 0x82, 0x04,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
0x00,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
2
|
+
0x30, 0x82, 0x04, 0xa3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
|
3
|
+
0xbd, 0x8e, 0xc3, 0x44, 0xf2, 0x43, 0x2c, 0xcc, 0x2e, 0xa2, 0x22, 0xd2,
|
4
|
+
0x31, 0x6e, 0x38, 0x85, 0x53, 0x53, 0x5d, 0x55, 0x68, 0x39, 0x0e, 0xe6,
|
5
|
+
0x4c, 0x7d, 0xe5, 0xd0, 0x52, 0x92, 0x31, 0x1b, 0xb4, 0x4f, 0xde, 0xd7,
|
6
|
+
0xba, 0x52, 0xbb, 0xdb, 0x27, 0xf7, 0x12, 0x1f, 0xef, 0x86, 0x2c, 0x41,
|
7
|
+
0x98, 0xa1, 0xca, 0xd2, 0xfd, 0x01, 0x0a, 0xc7, 0x98, 0x71, 0x4b, 0xa7,
|
8
|
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, 0x00, 0xb7, 0x06, 0xa2, 0xda, 0xe6,
|
91
|
+
0xb6, 0x9e, 0x24, 0x32, 0x2d, 0x45, 0x98, 0x95, 0xf6, 0x77, 0x7a, 0x5f,
|
92
|
+
0xc1, 0x2c, 0x3e, 0x9f, 0x98, 0x0a, 0x3d, 0xdb, 0x16, 0x4e, 0x80, 0x5c,
|
93
|
+
0xa5, 0x74, 0x0b, 0xee, 0x43, 0xda, 0xfd, 0x60, 0xff, 0x37, 0x7b, 0xe9,
|
94
|
+
0xe4, 0x0b, 0xe1, 0x3e, 0xc0, 0xf5, 0x74, 0xa7, 0x6a, 0x85, 0xcf, 0x53,
|
95
|
+
0x15, 0x8e, 0xc6, 0x57, 0xdc, 0xfd, 0xf3, 0x15, 0xd6, 0x4a, 0xbf, 0x67,
|
96
|
+
0xf6, 0x03, 0x75, 0x91, 0x83, 0x84, 0x62, 0xf7, 0x39, 0x21, 0x72, 0xa4,
|
97
|
+
0x82, 0x98, 0x84, 0x1f, 0x2a, 0x45, 0x34, 0x5e, 0xf1, 0x6f, 0x79, 0x5c,
|
98
|
+
0xc9, 0x70, 0x2c, 0xb4, 0x15, 0xe4, 0x62, 0xec, 0x93, 0xf7, 0x71, 0xe6,
|
99
|
+
0xfe, 0x54, 0xe9, 0xef, 0xd6, 0xe3, 0x0b, 0x2b, 0xc1, 0x31, 0x24, 0xe1,
|
100
|
+
0x17, 0x0b, 0x9c, 0xa4, 0x54, 0x2b, 0xa6, 0x78, 0x70, 0x0b, 0x1e, 0x62,
|
101
|
+
0x6e, 0x01, 0x48
|
102
102
|
};
|
103
|
-
unsigned int cert_key_der_len =
|
103
|
+
unsigned int cert_key_der_len = 1191;
|
data/example/bug5.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require_relative '../lib/opcua/client'
|
3
|
+
|
4
|
+
client = OPCUA::Client.new("opc.tcp://128.130.57.76:4840")
|
5
|
+
client.subscription_interval = 100 # default 500
|
6
|
+
|
7
|
+
if (node = client.get 1, 'DISPLAY_VOLTAGE') # get node from nodeid
|
8
|
+
p node
|
9
|
+
p node.value
|
10
|
+
else
|
11
|
+
p 'invalid nodeid'
|
12
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require_relative '../lib/opcua/server'
|
3
|
+
|
4
|
+
Daemonite.new do
|
5
|
+
on startup do |opts|
|
6
|
+
srv = opts['server'] = OPCUA::Server.new
|
7
|
+
srv.import_UA # FIX
|
8
|
+
srv.import_nodeset File::read('nodeset1.xml')
|
9
|
+
srv.import_nodeset File::read('nodeset1.xml')
|
10
|
+
srv.import_nodeset File::read('nodeset1.xml')
|
11
|
+
DI = srv.imports['http://xxxxx/DI']
|
12
|
+
AID = srv.imports['http://xxxxx/AutoID']
|
13
|
+
|
14
|
+
srv.objects
|
15
|
+
|
16
|
+
# ab 106 im nodesets.rb
|
17
|
+
x = srv.data_types.add(qualifiedname,referencetype=UA::HasSubtype,nodeid=rand())
|
18
|
+
x.displayname['en-US'] = 'rrr'
|
19
|
+
x.displayname['de'] = 'rrr'
|
20
|
+
x.displayname.delete('de')
|
21
|
+
|
22
|
+
srv.data_types.bla.blurg.add(wieheissts')
|
23
|
+
srv.data_types.bla.blurg.push(wieheissts')
|
24
|
+
srv.data_types.bla.blurg.<<('wieheissts')
|
25
|
+
x = srv.data_types.bla.find name: 'bla', type: SUBXXXX
|
26
|
+
[x] = srv.data_types.bla.find_all name: 'bla', type: SUBXXXX
|
27
|
+
[x] = srv.data_types.bla.select name: 'bla', type: SUBXXXX
|
28
|
+
srv.data_types.bla.parent
|
29
|
+
|
30
|
+
# srv.event_types
|
31
|
+
# srv.interfaces_types
|
32
|
+
|
33
|
+
srv.reference_types.add(qualifiedname,symmetric,referencetype,nodeid)
|
34
|
+
srv.reference_types.add_symmetric(qualifiedname,referencetype,nodeid)
|
35
|
+
|
36
|
+
srv.variable_types
|
37
|
+
srv.object_types
|
38
|
+
|
39
|
+
p server.add_namespace "https://centurio.work/kelch"
|
40
|
+
p server.active_namespace
|
41
|
+
server.active_namespace = 0
|
42
|
+
p server.active_namespace
|
43
|
+
p server.namespaces
|
44
|
+
|
45
|
+
|
46
|
+
tools = opts['server'].objects.manifest(:KalimatC34, pt).find(:Tools)
|
47
|
+
|
48
|
+
t1 = tools.manifest(:Tool1,tt)
|
49
|
+
t2 = tools.manifest(:Tool2,tt)
|
50
|
+
t3 = tools.manifest(:Tool3,tt)
|
51
|
+
|
52
|
+
opts[:tn] = t1.find(:ToolNumber)
|
53
|
+
opts[:tn].description = 'test test'
|
54
|
+
opts[:tn].value = [0,1]
|
55
|
+
p opts[:tn].description
|
56
|
+
p opts[:tn].to_s
|
57
|
+
p opts[:tn].name
|
58
|
+
|
59
|
+
measurments_t1 = t1.find(:Measurements)
|
60
|
+
measurments_t1.manifest(:M1,mt)
|
61
|
+
m2 = measurments_t1.manifest(:M2,mt)
|
62
|
+
rescue => e
|
63
|
+
puts e.message
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
counter = 0
|
68
|
+
run do |opts|
|
69
|
+
GC.start
|
70
|
+
sleep opts['server'].run
|
71
|
+
# if counter % 100 == 0
|
72
|
+
# opts[:tn].value = [counter, counter]
|
73
|
+
# # opts[:tn].value = 1
|
74
|
+
# p opts[:tn].value
|
75
|
+
# end
|
76
|
+
# counter += 1
|
77
|
+
rescue => e
|
78
|
+
puts e.message
|
79
|
+
end
|
80
|
+
|
81
|
+
on exit do
|
82
|
+
# we could disconnect here, but OPCUA::Server does not have an explicit disconnect
|
83
|
+
puts 'bye.'
|
84
|
+
end
|
85
|
+
end.loop!
|
data/example/test
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class Types
|
2
|
+
NAME = [ :TYPES ]
|
3
|
+
def self::defined?
|
4
|
+
end
|
5
|
+
|
6
|
+
def self::const_missing(name)
|
7
|
+
kelf = self
|
8
|
+
c = Class.new(Types) do
|
9
|
+
const_set :NAME, kelf::NAME << name
|
10
|
+
end
|
11
|
+
c
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
1.upto 5000000 do |i|
|
17
|
+
a = Types::B::C::D
|
18
|
+
a::NAME
|
19
|
+
if i % 1000 == 0
|
20
|
+
GC::start
|
21
|
+
end
|
22
|
+
end
|
data/example/test.mpf
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
F_HEAD(1120403455,25,0.2,,120,1,1,8.5,-8.2,390,200,0.4,4000,6000,71,0,43663,,60,,20,6,6,100,100,100,1,205.5,,8650751,16015,2,0,6,120,0,,-100,-80,6,100,100,100,10,10,0,0,,200,50,720);*RO*
|
2
|
+
MSG("JUERGEN43")
|
3
|
+
$MAS_SPINDLE_PARAMETER[1,AX6]=31.5
|
4
|
+
F_ROUGH("SCHRUPPER-A-L","",1,0.1,3,250,2,0,54273,5,25,90,0.5,90,-0.8,90,0,90,-0.8,90,0,90,0,0,0,0,0.8,0,0.1,0,90,90,0,0,0);*RO*
|
5
|
+
F_TS("FRAESER-10-AXHS",,1,1000,1,2,5,,,0,0,0,0);*RO*
|
6
|
+
F_DRILL("FRAESER-10-AXHS","",1,200,1,3500,1,0,40,0.5,90,-2.2,90,50,85,3,5,0,17,0,100);*RO*
|
7
|
+
F_CON("HS_BOHR",4,"E_LAB_A_HS_BOHR","E_LAB_E_HS_BOHR");*RO*
|
8
|
+
F_ROU_Z("BOHRSTANGE-10/12L","",1,0.12,3,200,2,0,0,,,,"202006301043360",,,,"202006301043361",321321,0.05,10,0.2,1.5,2,0.2,0.05,0.1,0,0,0,1,10,90,0.1,90,110,,,10,,,,2,2,,,,,0,,,,0,0,0,1,1,0,0.08);*RO*
|
9
|
+
F_CON("HS",4,"E_LAB_A_HS","E_LAB_E_HS");*RO*
|
10
|
+
F_ROU_Z("SCHRUPPER-A-L","",1,0.15,3,250,2,0,0,,,,"202006301047382",,,,"202006301047383",321111,0.1,10,0.2,2,2,4.711,0.2,0.1,0,0,0,1,25,90,0.1,90,110,,,10,,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
11
|
+
F_ROU_Z("SCHLICHTER-A-L","",1,0.15,3,250,2,10,0,,,,"202006301051164","202006301047383",,,"202006301051165",311111,0.05,0.2,0.07,1,6,4.711,0.1,0.1,0,0.2,0,1,0,91,0,91,31,,1,,-41.5,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
12
|
+
F_ROU_Z("EINSTI_2N-LR-HS","",1,0.1,3,200,2,12,0,,,,"2020063011000810","202006301051165",,,"2020063011000811",301111,0.08,0.1,0.1,0.8,6,0.2,1,0.1,0,0,0,1,0,91,0,91,30,,-8,,-5,,,2,2,1,30,,,0,,,,0,0,0,1,1,0);*RO*
|
13
|
+
F_ROU_Z("EINSTI_2N-LR-HS","",1,0.1,3,200,2,12,0,,,,"2020063011011512","2020063011000811",,,"2020063011011513",301211,0.08,0.1,0.1,1,6,0.2,0.5,0.1,0,0,0,1,0,91,0,91,31,,-41.1,,-46.9,,,2,2,1,30,,,0,,,,0,0,0,1,1,0);*RO*
|
14
|
+
F_ROU_Z("SCHLICHTER-A-L","",1,0.471,3,250,2,0,0,,,,"2020063011091716",,,,"2020063011091717",311211,0.1,10,0.2,1.5,2,0.2,0.2,0.1,0,0,0,1,25,90,0.1,90,31,,1,,-41.8,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
15
|
+
F_ROU_Z("SCHLICHTER-A-L","",1,0.471,3,250,2,0,0,,,,"2020063011113318",,,,"2020063011113319",311211,0.1,10,0.2,1.5,2,0.2,0.2,0.1,0,0,0,1,25,90,0.1,90,23,21,-46,,-53,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
16
|
+
F_TS("EINSTICH-ABSTICH3",,1,,0,1,5,,,0,0,0,0);*RO*
|
17
|
+
F_SUB_SP(11004,3,50,0,-29,1,90,1500,2000,2,-50,0,720,100,-50,,2,,0);*RO*
|
18
|
+
F_PARTOF("EINSTICH-ABSTICH3","",1,0.08,3,200,2,0,22,-50.1,1,90,0,90,0,1500,0.04,0.2,0,4000,0,0,0,1);*RO*
|
19
|
+
F_ROUGH("SCHLICHTER-A-R","",1,0.08,3,250,2,0,46082,5,22,90,0.2,90,-1,90,0,90,-1,90,0,90,0,0,0,0.4,0.2,0.1,0,1,90,90,0,0,0);*RO*
|
20
|
+
F_TS("SCHRUPPER-A-R",,1,,0,1,5,,,0,0,0,0);*RO*
|
21
|
+
M9
|
22
|
+
G0 D0 G53 X431.4;X431.4
|
23
|
+
G53 D0 Z601.5 C2=0;Z601.5
|
24
|
+
;M2=25 M9 ;M2=71
|
25
|
+
G04 F1
|
26
|
+
ENDE:M30
|
27
|
+
F_END(0,1,0);*RO*
|
28
|
+
M30 ;#SM;*RO*
|
29
|
+
E_LAB_A_HS: ;#SM Z:2
|
30
|
+
;#7__DlgK contour definition begin - Don't change!;*GP*;*RO*;*HD*
|
31
|
+
G18 G90 DIAM90;*GP*
|
32
|
+
G0 Z0 X16 ;*GP*
|
33
|
+
G1 X22 RND=.4 ;*GP*
|
34
|
+
Z-5.2 RND=.4 ;*GP*
|
35
|
+
G2 Z-24.8 K=AC(-15) I=AC(67.998) RND=.4 ;*GP*
|
36
|
+
G1 Z-30.67 RND=.4 ;*GP*
|
37
|
+
Z-35 X17 RND=.8 ;*GP*
|
38
|
+
Z-39.33 X22 RND=.4 ;*GP*
|
39
|
+
Z-41.5 RND=.04 ;*GP*
|
40
|
+
X16 RND=.4 ;*GP*
|
41
|
+
Z-46.5 RND=.4 ;*GP*
|
42
|
+
X22 RND=.4 ;*GP*
|
43
|
+
Z-53.3 ;*GP*
|
44
|
+
X25 ;*GP*
|
45
|
+
;CON,V64,2,0.0000,12,12,MST:3,2,AX:Z,X,K,I,TRANS:0;*GP*;*RO*;*HD*
|
46
|
+
;S,EX:0,EY:16,ASE:90;*GP*;*RO*;*HD*
|
47
|
+
;R,RROUND:0;*GP*;*RO*;*HD*
|
48
|
+
;LU,EY:22;*GP*;*RO*;*HD*
|
49
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
50
|
+
;LL,EX:-5.2;*GP*;*RO*;*HD*
|
51
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
52
|
+
;ACW,DIA:0/235,EX:-24.8,EY:22,RAD:25;*GP*;*RO*;*HD*
|
53
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
54
|
+
;LL,EX:-30.67;*GP*;*RO*;*HD*
|
55
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
56
|
+
;LA,EX:-35,EY:17;*GP*;*RO*;*HD*
|
57
|
+
;R,RROUND:.8;*GP*;*RO*;*HD*
|
58
|
+
;LA,EX:-39.33,EY:22;*GP*;*RO*;*HD*
|
59
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
60
|
+
;LL,EX:-41.5;*GP*;*RO*;*HD*
|
61
|
+
;R,RROUND:.04;*GP*;*RO*;*HD*
|
62
|
+
;LD,EY:16;*GP*;*RO*;*HD*
|
63
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
64
|
+
;LL,EX:-46.5;*GP*;*RO*;*HD*
|
65
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
66
|
+
;LU,EY:22;*GP*;*RO*;*HD*
|
67
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
68
|
+
;LL,EX:-53.3;*GP*;*RO*;*HD*
|
69
|
+
;LU,EY:25;*GP*;*RO*;*HD*
|
70
|
+
;#End contour definition end - Don't change!;*GP*;*RO*;*HD*
|
71
|
+
E_LAB_E_HS:
|
72
|
+
E_LAB_A_HS_BOHR: ;#SM Z:2
|
73
|
+
;#7__DlgK contour definition begin - Don't change!;*GP*;*RO*;*HD*
|
74
|
+
G18 G90 DIAM90;*GP*
|
75
|
+
G0 Z0 X17.8 ;*GP*
|
76
|
+
G1 X17 RND=.4 ;*GP*
|
77
|
+
Z-2 ;*GP*
|
78
|
+
X9 ;*GP*
|
79
|
+
;CON,V64,2,0.0000,2,2,MST:3,2,AX:Z,X,K,I,TRANS:0;*GP*;*RO*;*HD*
|
80
|
+
;S,EX:0,EY:17,ASE:270;*GP*;*RO*;*HD*
|
81
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
82
|
+
;LL,EX:-2;*GP*;*RO*;*HD*
|
83
|
+
;LD,EY:9;*GP*;*RO*;*HD*
|
84
|
+
;#End contour definition end - Don't change!;*GP*;*RO*;*HD*
|
85
|
+
E_LAB_E_HS_BOHR:
|
data/example/test1
ADDED
data/example/tester.mpf
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
F_HEAD(1120403455,25,0.2,,120,1,1,8.5,-8.2,390,200,0.4,4000,6000,71,0,43663,,60,,20,6,6,100,100,100,1,205.5,,8650751,16015,2,0,6,120,0,,-100,-80,6,100,100,100,10,10,0,0,,200,50,720);*RO*
|
2
|
+
MSG("JUERGEN1")
|
3
|
+
$MAS_SPINDLE_PARAMETER[1,AX6]=31.5
|
4
|
+
F_ROUGH("SCHRUPPER-A-L","",1,0.1,3,250,2,0,54273,5,25,90,0.5,90,-0.8,90,0,90,-0.8,90,0,90,0,0,0,0,0.8,0,0.1,0,90,90,0,0,0);*RO*
|
5
|
+
F_TS("FRAESER-10-AXHS",,1,1000,1,2,5,,,0,0,0,0);*RO*
|
6
|
+
F_DRILL("FRAESER-10-AXHS","",1,200,1,3500,1,0,40,0.5,90,-2.2,90,50,85,3,5,0,17,0,100);*RO*
|
7
|
+
F_CON("HS_BOHR",4,"E_LAB_A_HS_BOHR","E_LAB_E_HS_BOHR");*RO*
|
8
|
+
F_ROU_Z("BOHRSTANGE-10/12L","",1,0.12,3,200,2,0,0,,,,"202006301043360",,,,"202006301043361",321321,0.05,10,0.2,1.5,2,0.2,0.05,0.1,0,0,0,1,10,90,0.1,90,110,,,10,,,,2,2,,,,,0,,,,0,0,0,1,1,0,0.08);*RO*
|
9
|
+
F_CON("HS",4,"E_LAB_A_HS","E_LAB_E_HS");*RO*
|
10
|
+
F_ROU_Z("SCHRUPPER-A-L","",1,0.15,3,250,2,0,0,,,,"202006301047382",,,,"202006301047383",321111,0.1,10,0.2,2,2,4.711,0.2,0.1,0,0,0,1,25,90,0.1,90,110,,,10,,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
11
|
+
F_ROU_Z("SCHLICHTER-A-L","",1,0.15,3,250,2,10,0,,,,"202006301051164","202006301047383",,,"202006301051165",311111,0.05,0.2,0.07,1,6,4.711,0.1,0.1,0,0.2,0,1,0,91,0,91,31,,1,,-41.5,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
12
|
+
F_ROU_Z("EINSTI_2N-LR-HS","",1,0.1,3,200,2,12,0,,,,"2020063011000810","202006301051165",,,"2020063011000811",301111,0.08,0.1,0.1,0.8,6,0.2,1,0.1,0,0,0,1,0,91,0,91,30,,-8,,-5,,,2,2,1,30,,,0,,,,0,0,0,1,1,0);*RO*
|
13
|
+
F_ROU_Z("EINSTI_2N-LR-HS","",1,0.1,3,200,2,12,0,,,,"2020063011011512","2020063011000811",,,"2020063011011513",301211,0.08,0.1,0.1,1,6,0.2,0.5,0.1,0,0,0,1,0,91,0,91,31,,-41.1,,-46.9,,,2,2,1,30,,,0,,,,0,0,0,1,1,0);*RO*
|
14
|
+
F_ROU_Z("SCHLICHTER-A-L","",1,0.471,3,250,2,0,0,,,,"2020063011091716",,,,"2020063011091717",311211,0.1,10,0.2,1.5,2,0.2,0.2,0.1,0,0,0,1,25,90,0.1,90,31,,1,,-41.8,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
15
|
+
F_ROU_Z("SCHLICHTER-A-L","",1,0.471,3,250,2,0,0,,,,"2020063011113318",,,,"2020063011113319",311211,0.1,10,0.2,1.5,2,0.2,0.2,0.1,0,0,0,1,25,90,0.1,90,23,21,-46,,-53,,,2,2,,,,,0,,,,0,0,0,1,1,0);*RO*
|
16
|
+
F_TS("EINSTICH-ABSTICH3",,1,,0,1,5,,,0,0,0,0);*RO*
|
17
|
+
F_SUB_SP(11004,3,50,0,-29,1,90,1500,2000,2,-50,0,720,100,-50,,2,,0);*RO*
|
18
|
+
F_PARTOF("EINSTICH-ABSTICH3","",1,0.08,3,200,2,0,22,-50.1,1,90,0,90,0,1500,0.04,0.2,0,4000,0,0,0,1);*RO*
|
19
|
+
F_ROUGH("SCHLICHTER-A-R","",1,0.08,3,250,2,0,46082,5,22,90,0.2,90,-1,90,0,90,-1,90,0,90,0,0,0,0.4,0.2,0.1,0,1,90,90,0,0,0);*RO*
|
20
|
+
F_TS("SCHRUPPER-A-R",,1,,0,1,5,,,0,0,0,0);*RO*
|
21
|
+
M9
|
22
|
+
G0 D0 G53 X431.4;X431.4
|
23
|
+
G53 D0 Z601.5 C2=0;Z601.5
|
24
|
+
;M2=25 M9 ;M2=71
|
25
|
+
G04 F1
|
26
|
+
ENDE:M30
|
27
|
+
F_END(0,1,0);*RO*
|
28
|
+
M30 ;#SM;*RO*
|
29
|
+
E_LAB_A_HS: ;#SM Z:2
|
30
|
+
;#7__DlgK contour definition begin - Don't change!;*GP*;*RO*;*HD*
|
31
|
+
G18 G90 DIAM90;*GP*
|
32
|
+
G0 Z0 X16 ;*GP*
|
33
|
+
G1 X22 RND=.4 ;*GP*
|
34
|
+
Z-5.2 RND=.4 ;*GP*
|
35
|
+
G2 Z-24.8 K=AC(-15) I=AC(67.998) RND=.4 ;*GP*
|
36
|
+
G1 Z-30.67 RND=.4 ;*GP*
|
37
|
+
Z-35 X17 RND=.8 ;*GP*
|
38
|
+
Z-39.33 X22 RND=.4 ;*GP*
|
39
|
+
Z-41.5 RND=.04 ;*GP*
|
40
|
+
X16 RND=.4 ;*GP*
|
41
|
+
Z-46.5 RND=.4 ;*GP*
|
42
|
+
X22 RND=.4 ;*GP*
|
43
|
+
Z-53.3 ;*GP*
|
44
|
+
X25 ;*GP*
|
45
|
+
;CON,V64,2,0.0000,12,12,MST:3,2,AX:Z,X,K,I,TRANS:0;*GP*;*RO*;*HD*
|
46
|
+
;S,EX:0,EY:16,ASE:90;*GP*;*RO*;*HD*
|
47
|
+
;R,RROUND:0;*GP*;*RO*;*HD*
|
48
|
+
;LU,EY:22;*GP*;*RO*;*HD*
|
49
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
50
|
+
;LL,EX:-5.2;*GP*;*RO*;*HD*
|
51
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
52
|
+
;ACW,DIA:0/235,EX:-24.8,EY:22,RAD:25;*GP*;*RO*;*HD*
|
53
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
54
|
+
;LL,EX:-30.67;*GP*;*RO*;*HD*
|
55
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
56
|
+
;LA,EX:-35,EY:17;*GP*;*RO*;*HD*
|
57
|
+
;R,RROUND:.8;*GP*;*RO*;*HD*
|
58
|
+
;LA,EX:-39.33,EY:22;*GP*;*RO*;*HD*
|
59
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
60
|
+
;LL,EX:-41.5;*GP*;*RO*;*HD*
|
61
|
+
;R,RROUND:.04;*GP*;*RO*;*HD*
|
62
|
+
;LD,EY:16;*GP*;*RO*;*HD*
|
63
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
64
|
+
;LL,EX:-46.5;*GP*;*RO*;*HD*
|
65
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
66
|
+
;LU,EY:22;*GP*;*RO*;*HD*
|
67
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
68
|
+
;LL,EX:-53.3;*GP*;*RO*;*HD*
|
69
|
+
;LU,EY:25;*GP*;*RO*;*HD*
|
70
|
+
;#End contour definition end - Don't change!;*GP*;*RO*;*HD*
|
71
|
+
E_LAB_E_HS:
|
72
|
+
E_LAB_A_HS_BOHR: ;#SM Z:2
|
73
|
+
;#7__DlgK contour definition begin - Don't change!;*GP*;*RO*;*HD*
|
74
|
+
G18 G90 DIAM90;*GP*
|
75
|
+
G0 Z0 X17.8 ;*GP*
|
76
|
+
G1 X17 RND=.4 ;*GP*
|
77
|
+
Z-2 ;*GP*
|
78
|
+
X9 ;*GP*
|
79
|
+
;CON,V64,2,0.0000,2,2,MST:3,2,AX:Z,X,K,I,TRANS:0;*GP*;*RO*;*HD*
|
80
|
+
;S,EX:0,EY:17,ASE:270;*GP*;*RO*;*HD*
|
81
|
+
;R,RROUND:.4;*GP*;*RO*;*HD*
|
82
|
+
;LL,EX:-2;*GP*;*RO*;*HD*
|
83
|
+
;LD,EY:9;*GP*;*RO*;*HD*
|
84
|
+
;#End contour definition end - Don't change!;*GP*;*RO*;*HD*
|
85
|
+
E_LAB_E_HS_BOHR:
|
data/example/turm.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require_relative '../lib/opcua/client'
|
3
|
+
#require 'opcua/client'
|
4
|
+
|
5
|
+
### username & pass in url (e.g. siemens)
|
6
|
+
client = OPCUA::Client.new("opc.tcp://OpcUaClient:SUNRISE1@localhost:4840")
|
7
|
+
|
8
|
+
#node = client.get 2, '/Methods/CopyFileToServer'
|
9
|
+
#prog = File.read('test.mpf')
|
10
|
+
#p node.call 'Sinumerik/FileSystem/Work Pieces/CDP/TURM_PSC.MPF', prog, true
|
11
|
+
|
12
|
+
node = client.get 2, '/Methods/CopyFileFromServer '
|
13
|
+
puts node.call 'Sinumerik/FileSystem/Work Pieces/CDP/TURM_PSC.MPF'
|
data/ext/opcua/helpers/values.c
CHANGED
@@ -154,8 +154,14 @@ bool value_to_variant(VALUE value, UA_Variant *variant, UA_UInt32 proposal) { //
|
|
154
154
|
case T_SYMBOL:
|
155
155
|
{
|
156
156
|
VALUE str = rb_obj_as_string(value);
|
157
|
-
|
158
|
-
|
157
|
+
if (proposal == UA_TYPES_STRING) {
|
158
|
+
UA_String tmp = UA_STRING(StringValuePtr(str));
|
159
|
+
UA_Variant_setScalarCopy(variant, &tmp, &UA_TYPES[UA_TYPES_STRING]);
|
160
|
+
} else if (proposal == UA_TYPES_BYTESTRING) {
|
161
|
+
printf("rrrrr\n");
|
162
|
+
UA_ByteString tmp = UA_BYTESTRING(StringValuePtr(str));
|
163
|
+
UA_Variant_setScalarCopy(variant, &tmp, &UA_TYPES[UA_TYPES_BYTESTRING]);
|
164
|
+
}
|
159
165
|
done = true;
|
160
166
|
break;
|
161
167
|
}
|
@@ -175,6 +181,7 @@ void Init_types(VALUE mOPCUA) {/*{{{*/
|
|
175
181
|
mTYPES = rb_define_module_under(mOPCUA,"TYPES");
|
176
182
|
rb_define_const(mTYPES, "DATETIME", INT2NUM(UA_TYPES_DATETIME ));
|
177
183
|
rb_define_const(mTYPES, "BOOLEAN", INT2NUM(UA_TYPES_BOOLEAN ));
|
184
|
+
rb_define_const(mTYPES, "FLOAT", INT2NUM(UA_TYPES_FLOAT ));
|
178
185
|
rb_define_const(mTYPES, "DOUBLE", INT2NUM(UA_TYPES_DOUBLE ));
|
179
186
|
rb_define_const(mTYPES, "INT32", INT2NUM(UA_TYPES_INT32 ));
|
180
187
|
rb_define_const(mTYPES, "INT16", INT2NUM(UA_TYPES_INT16 ));
|
@@ -189,6 +196,9 @@ static VALUE UA_TYPES_DATETIME_to_value(UA_DateTime data) { //{{{
|
|
189
196
|
static VALUE UA_TYPES_BOOLEAN_to_value(UA_Boolean data) { //{{{
|
190
197
|
return data ? Qtrue : Qfalse;
|
191
198
|
} //}}}
|
199
|
+
static VALUE UA_TYPES_FLOAT_to_value(UA_Float data) { //{{{
|
200
|
+
return DBL2NUM((double)data);
|
201
|
+
} //}}}
|
192
202
|
static VALUE UA_TYPES_DOUBLE_to_value(UA_Double data) { //{{{
|
193
203
|
return DBL2NUM(data);
|
194
204
|
} //}}}
|
@@ -213,6 +223,9 @@ static VALUE UA_TYPES_UINT16_to_value(UA_UInt16 data) { //{{{
|
|
213
223
|
static VALUE UA_TYPES_STRING_to_value(UA_String data) { //{{{
|
214
224
|
return rb_str_export_locale(rb_str_new((char *)(data.data),data.length));
|
215
225
|
} //}}}
|
226
|
+
static VALUE UA_TYPES_BYTESTRING_to_value(UA_ByteString data) { //{{{
|
227
|
+
return rb_str_export_locale(rb_str_new((char *)(data.data),data.length));
|
228
|
+
} //}}}
|
216
229
|
|
217
230
|
VALUE extract_value(UA_Variant value) { //{{{
|
218
231
|
VALUE ret = rb_ary_new2(2);
|
@@ -228,6 +241,9 @@ VALUE extract_value(UA_Variant value) { //{{{
|
|
228
241
|
} else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_BOOLEAN])) {
|
229
242
|
rb_ary_store(ret,0,UA_TYPES_BOOLEAN_to_value(*(UA_Boolean *)value.data));
|
230
243
|
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Boolean")));
|
244
|
+
} else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_FLOAT])) {
|
245
|
+
rb_ary_store(ret,0,UA_TYPES_FLOAT_to_value(*(UA_Float *)value.data));
|
246
|
+
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Float")));
|
231
247
|
} else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_DOUBLE])) {
|
232
248
|
rb_ary_store(ret,0,UA_TYPES_DOUBLE_to_value(*(UA_Double *)value.data));
|
233
249
|
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Double")));
|
@@ -252,6 +268,11 @@ VALUE extract_value(UA_Variant value) { //{{{
|
|
252
268
|
} else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_STRING])) {
|
253
269
|
rb_ary_store(ret,0,UA_TYPES_STRING_to_value(*(UA_String *)value.data));
|
254
270
|
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.String")));
|
271
|
+
} else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_BYTESTRING])) {
|
272
|
+
rb_ary_store(ret,0,UA_TYPES_BYTESTRING_to_value(*(UA_ByteString *)value.data));
|
273
|
+
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.String")));
|
274
|
+
} else {
|
275
|
+
//printf("Unknown Datatype\n");
|
255
276
|
}
|
256
277
|
} else if (value.arrayDimensionsSize == 1 || (value.arrayDimensionsSize == 0 && value.arrayLength > 0)) {
|
257
278
|
if (UA_Variant_hasArrayType(&value, &UA_TYPES[UA_TYPES_DATETIME])) {
|
@@ -268,6 +289,13 @@ VALUE extract_value(UA_Variant value) { //{{{
|
|
268
289
|
for (int i=0; i < value.arrayLength; i++) {
|
269
290
|
rb_ary_push(res,UA_TYPES_BOOLEAN_to_value(((UA_Boolean *)value.data)[i]));
|
270
291
|
}
|
292
|
+
} else if (UA_Variant_hasArrayType(&value, &UA_TYPES[UA_TYPES_FLOAT])) {
|
293
|
+
VALUE res = rb_ary_new();
|
294
|
+
rb_ary_store(ret,0,res);
|
295
|
+
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Float")));
|
296
|
+
for (int i=0; i < value.arrayLength; i++) {
|
297
|
+
rb_ary_push(res,UA_TYPES_FLOAT_to_value(((UA_Float *)value.data)[i]));
|
298
|
+
}
|
271
299
|
} else if (UA_Variant_hasArrayType(&value, &UA_TYPES[UA_TYPES_DOUBLE])) {
|
272
300
|
VALUE res = rb_ary_new();
|
273
301
|
rb_ary_store(ret,0,res);
|
data/opcua.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "opcua"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.19"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0"
|
6
6
|
s.summary = "Preliminary release of opcua (open62541) ruby bindings. C performance, Ruby elegance, simplicity, and productivity."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opcua
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.19'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: tools
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: daemonite
|
@@ -63,8 +63,8 @@ description: see https://github.com/etm/opcua-smart
|
|
63
63
|
email: juergen.mangler@gmail.com
|
64
64
|
executables: []
|
65
65
|
extensions:
|
66
|
-
- ext/opcua/server/extconf.rb
|
67
66
|
- ext/opcua/client/extconf.rb
|
67
|
+
- ext/opcua/server/extconf.rb
|
68
68
|
extra_rdoc_files:
|
69
69
|
- README.md
|
70
70
|
files:
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- cert/cert.h
|
75
75
|
- cert/cert_key.h
|
76
76
|
- example/bug5.rb
|
77
|
+
- example/client_get_float.rb
|
77
78
|
- example/client_get_sync.rb
|
78
79
|
- example/client_get_value.rb
|
79
80
|
- example/client_method.rb
|
@@ -81,9 +82,16 @@ files:
|
|
81
82
|
- example/client_subscription.rb
|
82
83
|
- example/kelch.KMT
|
83
84
|
- example/server.rb
|
85
|
+
- example/server_browse.rb
|
84
86
|
- example/server_deep.rb
|
85
87
|
- example/server_values.rb
|
88
|
+
- example/server_xml.rb
|
89
|
+
- example/test
|
90
|
+
- example/test.mpf
|
86
91
|
- example/test.rb
|
92
|
+
- example/test1
|
93
|
+
- example/tester.mpf
|
94
|
+
- example/turm.rb
|
87
95
|
- ext/opcua/client/client.c
|
88
96
|
- ext/opcua/client/client.h
|
89
97
|
- ext/opcua/client/extconf.rb
|