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
b4efccbe
Commit
b4efccbe
authored
Mar 02, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
92af4aaf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
opcua_receiver.py
opcua_receiver.py
+1
-4
opcua_subscriber/opcua_subscribe.py
opcua_subscriber/opcua_subscribe.py
+6
-4
No files found.
opcua_receiver.py
View file @
b4efccbe
...
...
@@ -33,7 +33,4 @@ while (True):
message
=
bytesAddressPair
[
0
]
datatype
,
value
,
ns
,
nodeid
=
message
.
decode
()
.
split
(
"&"
)
print
(
nodeid
)
if
(
datatype
==
"<class 'float'>"
):
opua
.
write_opcua_value
(
sock
,
int
(
ns
),
int
(
nodeid
),
11
)
if
(
datatype
==
"<class 'int'>"
):
opua
.
write_opcua_value
(
sock
,
int
(
ns
),
int
(
nodeid
),
6
)
\ No newline at end of file
opua
.
write_opcua_value
(
sock
,
int
(
ns
),
int
(
nodeid
),
value
,
datatype
)
opcua_subscriber/opcua_subscribe.py
View file @
b4efccbe
...
...
@@ -12,6 +12,7 @@ class opcua_pack():
self
.
Security_Token_Id
=
1
self
.
identifier_string
=
""
self
.
int_chunk_seq
=
5
self
.
float_chunk_seq
=
4
def
helf
(
self
,
address
):
...
...
@@ -449,7 +450,8 @@ class opcua_pack():
print
(
sock
.
recv
(
1024
))
return
sock
def
write_opcua_value
(
self
,
sock
,
ns
,
nodeid
,
val
):
print
(
self
.
SecureChannelId
,
self
.
TokenId
,
self
.
identifier_string
,
self
.
int_chunk_seq
,
ns
,
nodeid
,
val
,
"<class 'int'>"
)
sock
.
sendall
(
self
.
write_request
(
self
.
SecureChannelId
,
self
.
TokenId
,
self
.
identifier_string
,
self
.
int_chunk_seq
,
ns
,
nodeid
,
val
,
"<class 'int'>"
))
print
(
sock
.
recv
(
1024
))
def
write_opcua_value
(
self
,
sock
,
ns
,
nodeid
,
val
,
datatype
):
if
(
datatype
==
"<class 'float'>"
)
sock
.
sendall
(
self
.
write_request
(
self
.
SecureChannelId
,
self
.
TokenId
,
self
.
identifier_string
,
self
.
int_chunk_seq
,
ns
,
nodeid
,
val
,
datatype
))
else
:
sock
.
sendall
(
self
.
write_request
(
self
.
SecureChannelId
,
self
.
TokenId
,
self
.
identifier_string
,
self
.
float_chunk_seq
,
ns
,
nodeid
,
val
,
datatype
))
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