Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-cloning
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yogesh.m
opcua-cloning
Commits
bb698f06
Commit
bb698f06
authored
Mar 06, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
05e93a91
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
7 deletions
+11
-7
.idea/misc.xml
.idea/misc.xml
+1
-1
.idea/opcua-cloning.iml
.idea/opcua-cloning.iml
+1
-1
.idea/workspace.xml
.idea/workspace.xml
+2
-2
__pycache__/asyncua_server.cpython-39.pyc
__pycache__/asyncua_server.cpython-39.pyc
+0
-0
asyncua_server.py
asyncua_server.py
+7
-1
opcua_receiver.py
opcua_receiver.py
+0
-1
opcua_subscriber/__pycache__/opcua_subscribe.cpython-39.pyc
opcua_subscriber/__pycache__/opcua_subscribe.cpython-39.pyc
+0
-0
opcua_subscriber/opcua_subscribe.py
opcua_subscriber/opcua_subscribe.py
+0
-1
No files found.
.idea/misc.xml
View file @
bb698f06
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.9"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.9
(pythonProject)
"
project-jdk-type=
"Python SDK"
/>
</project>
</project>
\ No newline at end of file
.idea/opcua-cloning.iml
View file @
bb698f06
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
/>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.9"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.9
(pythonProject)
"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</component>
</module>
</module>
\ No newline at end of file
.idea/workspace.xml
View file @
bb698f06
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<recent
name=
"D:\opcua-cloning"
/>
<recent
name=
"D:\opcua-cloning"
/>
</key>
</key>
</component>
</component>
<component
name=
"RunManager"
selected=
"Python.opcua
-transmitter (1)
"
>
<component
name=
"RunManager"
selected=
"Python.opcua
_receiver
"
>
<configuration
name=
"asyncua_server (1)"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"asyncua_server (1)"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"opcua-cloning"
/>
<module
name=
"opcua-cloning"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
...
@@ -178,9 +178,9 @@
...
@@ -178,9 +178,9 @@
</configuration>
</configuration>
<recent_temporary>
<recent_temporary>
<list>
<list>
<item
itemvalue=
"Python.opcua_receiver"
/>
<item
itemvalue=
"Python.opcua-transmitter (1)"
/>
<item
itemvalue=
"Python.opcua-transmitter (1)"
/>
<item
itemvalue=
"Python.hash_sender"
/>
<item
itemvalue=
"Python.hash_sender"
/>
<item
itemvalue=
"Python.opcua_receiver"
/>
<item
itemvalue=
"Python.asyncua_server (1)"
/>
<item
itemvalue=
"Python.asyncua_server (1)"
/>
<item
itemvalue=
"Python.asyncua_server"
/>
<item
itemvalue=
"Python.asyncua_server"
/>
</list>
</list>
...
...
__pycache__/asyncua_server.cpython-39.pyc
View file @
bb698f06
No preview for this file type
asyncua_server.py
View file @
bb698f06
import
asyncio
import
asyncio
import
pickle
from
asyncua
import
ua
,
Server
from
asyncua
import
ua
,
Server
import
socket
import
socket
import
threading
import
threading
...
@@ -48,10 +49,15 @@ class asyncua_server():
...
@@ -48,10 +49,15 @@ class asyncua_server():
asr
=
asyncua_server
()
asr
=
asyncua_server
()
def
hash_receive
():
def
hash_receive
():
prev_hash
=
0
while
(
True
):
while
(
True
):
bytesAddressPair
=
UDPServerSocket
.
recvfrom
(
bufferSize
)
bytesAddressPair
=
UDPServerSocket
.
recvfrom
(
bufferSize
)
message
=
bytesAddressPair
[
0
]
message
=
bytesAddressPair
[
0
]
print
(
message
)
hierarchy
=
pickle
.
loads
(
message
)
print
(
hierarchy
[
"hash"
])
if
(
prev_hash
!=
hierarchy
[
"hash"
]):
print
(
"changed"
)
prev_hash
=
hierarchy
[
"hash"
]
def
st
():
def
st
():
t1
=
threading
.
Thread
(
target
=
hash_receive
)
t1
=
threading
.
Thread
(
target
=
hash_receive
)
...
...
opcua_receiver.py
View file @
bb698f06
...
@@ -34,5 +34,4 @@ while (True):
...
@@ -34,5 +34,4 @@ while (True):
bytesAddressPair
=
UDPServerSocket
.
recvfrom
(
bufferSize
)
bytesAddressPair
=
UDPServerSocket
.
recvfrom
(
bufferSize
)
message
=
bytesAddressPair
[
0
]
message
=
bytesAddressPair
[
0
]
datatype
,
value
,
ns
,
nodeid
=
message
.
decode
()
.
split
(
"&"
)
datatype
,
value
,
ns
,
nodeid
=
message
.
decode
()
.
split
(
"&"
)
print
(
nodeid
)
opua
.
write_opcua_value
(
sock
,
ns
,
nodeid
,
value
,
datatype
)
opua
.
write_opcua_value
(
sock
,
ns
,
nodeid
,
value
,
datatype
)
opcua_subscriber/__pycache__/opcua_subscribe.cpython-39.pyc
View file @
bb698f06
No preview for this file type
opcua_subscriber/opcua_subscribe.py
View file @
bb698f06
...
@@ -459,4 +459,3 @@ class opcua_pack():
...
@@ -459,4 +459,3 @@ class opcua_pack():
else
:
else
:
sock
.
sendall
(
self
.
write_request
(
self
.
SecureChannelId
,
self
.
TokenId
,
self
.
identifier_string
,
self
.
cs
,
int
(
ns
),
int
(
nodeid
),
float
(
val
),
datatype
))
sock
.
sendall
(
self
.
write_request
(
self
.
SecureChannelId
,
self
.
TokenId
,
self
.
identifier_string
,
self
.
cs
,
int
(
ns
),
int
(
nodeid
),
float
(
val
),
datatype
))
self
.
cs
=
self
.
cs
+
1
self
.
cs
=
self
.
cs
+
1
print
(
sock
.
recv
(
1024
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment