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
d33a082b
You need to sign in or sign up before continuing.
Commit
d33a082b
authored
Mar 06, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
52102e5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
13 deletions
+62
-13
.idea/workspace.xml
.idea/workspace.xml
+21
-13
hash_receiver.py
hash_receiver.py
+12
-0
hash_sender.py
hash_sender.py
+29
-0
No files found.
.idea/workspace.xml
View file @
d33a082b
...
...
@@ -20,6 +20,14 @@
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
<component
name=
"GitSEFilterConfiguration"
>
<file-type-list>
<filtered-out-file-type
name=
"LOCAL_BRANCH"
/>
<filtered-out-file-type
name=
"REMOTE_BRANCH"
/>
<filtered-out-file-type
name=
"TAG"
/>
<filtered-out-file-type
name=
"COMMIT_BY_MESSAGE"
/>
</file-type-list>
</component>
<component
name=
"MarkdownSettingsMigration"
>
<option
name=
"stateVersion"
value=
"1"
/>
</component>
...
...
@@ -31,7 +39,7 @@
<component
name=
"PropertiesComponent"
>
<property
name=
"RunOnceActivity.OpenProjectViewOnStart"
value=
"true"
/>
<property
name=
"RunOnceActivity.ShowReadmeOnStart"
value=
"true"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$
/../test-conversion-pritocol
"
/>
</component>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
...
...
@@ -41,7 +49,7 @@
<recent
name=
"D:\opcua-cloning"
/>
</key>
</component>
<component
name=
"RunManager"
selected=
"Python.
asyncua_server (1)
"
>
<component
name=
"RunManager"
selected=
"Python.
hash_sender
"
>
<configuration
name=
"asyncua_server (1)"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"opcua-cloning"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
...
...
@@ -84,7 +92,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
</configuration>
<configuration
name=
"
main"
type=
"PythonConfigurationType"
factoryName=
"Python
"
nameIsGenerated=
"true"
>
<configuration
name=
"
hash_sender"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true
"
nameIsGenerated=
"true"
>
<module
name=
"opcua-cloning"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
...
@@ -96,7 +104,7 @@
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
main
.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
hash_sender
.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
@@ -105,7 +113,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
</configuration>
<configuration
name=
"
opcua-transmitter (1)"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true
"
nameIsGenerated=
"true"
>
<configuration
name=
"
main"
type=
"PythonConfigurationType"
factoryName=
"Python
"
nameIsGenerated=
"true"
>
<module
name=
"opcua-cloning"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
...
@@ -117,7 +125,7 @@
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
opcua-transmitter
.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
main
.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
@@ -126,7 +134,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
</configuration>
<configuration
name=
"opcua
_receiver
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"opcua
-transmitter (1)
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"opcua-cloning"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
...
@@ -138,7 +146,7 @@
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/opcua
_receiv
er.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/opcua
-transmitt
er.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
@@ -147,7 +155,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
</configuration>
<configuration
name=
"
test
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"
opcua_receiver
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"opcua-cloning"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
...
@@ -159,7 +167,7 @@
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
test
.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
opcua_receiver
.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
@@ -170,11 +178,11 @@
</configuration>
<recent_temporary>
<list>
<item
itemvalue=
"Python.asyncua_server (1)"
/>
<item
itemvalue=
"Python.asyncua_server"
/>
<item
itemvalue=
"Python.hash_sender"
/>
<item
itemvalue=
"Python.opcua-transmitter (1)"
/>
<item
itemvalue=
"Python.opcua_receiver"
/>
<item
itemvalue=
"Python.test"
/>
<item
itemvalue=
"Python.asyncua_server (1)"
/>
<item
itemvalue=
"Python.asyncua_server"
/>
</list>
</recent_temporary>
</component>
...
...
hash_receiver.py
0 → 100644
View file @
d33a082b
import
socket
localIP
=
"2.2.2.5"
localPort
=
20002
bufferSize
=
1024
UDPServerSocket
=
socket
.
socket
(
family
=
socket
.
AF_INET
,
type
=
socket
.
SOCK_DGRAM
)
UDPServerSocket
.
bind
((
localIP
,
localPort
))
while
(
True
):
bytesAddressPair
=
UDPServerSocket
.
recvfrom
(
bufferSize
)
message
=
bytesAddressPair
[
0
]
print
(
message
)
\ No newline at end of file
hash_sender.py
0 → 100644
View file @
d33a082b
from
asyncua
import
Client
import
asyncio
import
socket
ENDPOINT
=
'opc.tcp://2.2.2.7:53530/OPCUA/SimulationServer'
NAMESPACE
=
'http://www.prosysopc.com/OPCUA/SimulationServer/'
msgFromClient
=
"Hello UDP Server"
bytesToSend
=
str
.
encode
(
msgFromClient
)
serverAddressPort
=
(
"2.2.2.5"
,
20002
)
bufferSize
=
1024
UDPClientSocket
=
socket
.
socket
(
family
=
socket
.
AF_INET
,
type
=
socket
.
SOCK_DGRAM
)
async
def
get_send_hash
():
async
with
Client
(
url
=
ENDPOINT
)
as
client
:
root
=
client
.
get_root_node
()
root_objects
=
await
root
.
get_children
()
nm_no
=
await
client
.
get_namespace_index
(
"http://www.prosysopc.com/OPCUA/SimulationNodes/"
)
while
True
:
main_obj
=
[]
Objects
=
await
root_objects
[
0
]
.
get_children
()
for
sub_obj
in
Objects
:
if
(
sub_obj
.
nodeid
.
NamespaceIndex
==
nm_no
):
ch
=
await
sub_obj
.
get_children
()
main_obj
=
main_obj
+
ch
UDPClientSocket
.
sendto
(
str
.
encode
(
str
(
hash
(
str
(
main_obj
)))),
serverAddressPort
)
print
(
hash
(
str
(
main_obj
)))
if
__name__
==
'__main__'
:
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