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
127e43c3
Commit
127e43c3
authored
Mar 06, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d33a082b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
hash_sender.py
hash_sender.py
+10
-2
No files found.
hash_sender.py
View file @
127e43c3
from
asyncua
import
Client
from
asyncua
import
Client
import
asyncio
import
asyncio
import
socket
import
socket
from
time
import
sleep
ENDPOINT
=
'opc.tcp://2.2.2.7:53530/OPCUA/SimulationServer'
ENDPOINT
=
'opc.tcp://2.2.2.7:53530/OPCUA/SimulationServer'
NAMESPACE
=
'http://www.prosysopc.com/OPCUA/SimulationServer/'
NAMESPACE
=
'http://www.prosysopc.com/OPCUA/SimulationServer/'
...
@@ -16,14 +17,21 @@ async def get_send_hash():
...
@@ -16,14 +17,21 @@ async def get_send_hash():
root_objects
=
await
root
.
get_children
()
root_objects
=
await
root
.
get_children
()
nm_no
=
await
client
.
get_namespace_index
(
"http://www.prosysopc.com/OPCUA/SimulationNodes/"
)
nm_no
=
await
client
.
get_namespace_index
(
"http://www.prosysopc.com/OPCUA/SimulationNodes/"
)
while
True
:
while
True
:
sleep
(
1
)
main_obj
=
[]
main_obj
=
[]
hierarchy
=
{}
Objects
=
await
root_objects
[
0
]
.
get_children
()
Objects
=
await
root_objects
[
0
]
.
get_children
()
for
sub_obj
in
Objects
:
for
sub_obj
in
Objects
:
if
(
sub_obj
.
nodeid
.
NamespaceIndex
==
nm_no
):
if
(
sub_obj
.
nodeid
.
NamespaceIndex
==
nm_no
):
display_name
=
await
sub_obj
.
read_display_name
()
identifier_type
=
sub_obj
.
nodeid
.
NodeIdType
.
_name_
ch
=
await
sub_obj
.
get_children
()
ch
=
await
sub_obj
.
get_children
()
main_obj
=
main_obj
+
ch
main_obj
=
main_obj
+
ch
UDPClientSocket
.
sendto
(
str
.
encode
(
str
(
hash
(
str
(
main_obj
)))),
serverAddressPort
)
hierarchy
[
display_name
.
Text
]
=
{}
print
(
hash
(
str
(
main_obj
)))
hierarchy
[
display_name
.
Text
][
"name"
]
=
identifier_type
hierarchy
[
display_name
.
Text
][
"obj"
]
=
main_obj
UDPClientSocket
.
sendto
(
str
.
encode
(
str
(
hash
(
str
(
main_obj
)))
+
"&"
+
str
(
hierarchy
)),
serverAddressPort
)
print
(
str
(
hash
(
str
(
main_obj
)))
+
"&"
+
str
(
hierarchy
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
asyncio
.
run
(
get_send_hash
())
asyncio
.
run
(
get_send_hash
())
\ No newline at end of file
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