Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
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
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
osie
Commits
e0fab94e
Commit
e0fab94e
authored
4 years ago
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Example of OPC UA server.
parent
0723d31a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
OPC-UA/opc-ua-server.py
OPC-UA/opc-ua-server.py
+26
-0
No files found.
OPC-UA/opc-ua-server.py
0 → 100644
View file @
e0fab94e
"""
Simple OPCUa server with one paremeter (temp).
"""
from
opcua
import
Server
from
random
import
randint
import
time
server
=
Server
()
url
=
"opc.tcp://localhost:4840"
server
.
set_endpoint
(
url
)
name
=
"OPCUA_SIMULATION_SERVER"
addspace
=
server
.
register_namespace
(
name
)
node
=
server
.
get_objects_node
()
Param
=
node
.
add_object
(
addspace
,
"Parameters"
)
Temp
=
Param
.
add_variable
(
addspace
,
"Temperature"
,
0
)
Temp
.
set_writable
()
server
.
start
()
print
(
"started at %s"
%
url
)
while
1
:
Temp
.
set_value
(
randint
(
10
,
50
))
time
.
sleep
(
10
)
This diff is collapsed.
Click to expand it.
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