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
nexedi
osie
Commits
2104da9b
Commit
2104da9b
authored
Oct 06, 2021
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable callbacks to relays.
parent
5e958566
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
6 deletions
+28
-6
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+28
-6
No files found.
coupler/opc-ua-server/server.c
View file @
2104da9b
...
...
@@ -120,7 +120,7 @@ static void addVariable(UA_Server *server) {
}
/* Connec
to
to variables to physical relays
/* Connec
t
to variables to physical relays
*
*/
static
void
beforeReadTime
(
UA_Server
*
server
,
...
...
@@ -149,11 +149,33 @@ static void afterWriteTime(UA_Server *server,
}
static
void
addValueCallbackToCurrentTimeVariable
(
UA_Server
*
server
)
{
UA_NodeId
currentNodeId
=
UA_NODEID_STRING
(
1
,
"relay0"
);
UA_ValueCallback
callback
;
callback
.
onRead
=
beforeReadTime
;
callback
.
onWrite
=
afterWriteTime
;
UA_Server_setVariableNode_valueCallback
(
server
,
currentNodeId
,
callback
);
// relay 0
UA_NodeId
currentNodeId0
=
UA_NODEID_STRING
(
1
,
"relay0"
);
UA_ValueCallback
callback0
;
callback0
.
onRead
=
beforeReadTime
;
callback0
.
onWrite
=
afterWriteTime
;
UA_Server_setVariableNode_valueCallback
(
server
,
currentNodeId0
,
callback0
);
// relay 1
UA_NodeId
currentNodeId1
=
UA_NODEID_STRING
(
1
,
"relay1"
);
UA_ValueCallback
callback1
;
callback1
.
onRead
=
beforeReadTime
;
callback1
.
onWrite
=
afterWriteTime
;
UA_Server_setVariableNode_valueCallback
(
server
,
currentNodeId1
,
callback1
);
// relay 2
UA_NodeId
currentNodeId2
=
UA_NODEID_STRING
(
1
,
"relay2"
);
UA_ValueCallback
callback2
;
callback2
.
onRead
=
beforeReadTime
;
callback2
.
onWrite
=
afterWriteTime
;
UA_Server_setVariableNode_valueCallback
(
server
,
currentNodeId2
,
callback2
);
// relay 3
UA_NodeId
currentNodeId3
=
UA_NODEID_STRING
(
1
,
"relay3"
);
UA_ValueCallback
callback3
;
callback3
.
onRead
=
beforeReadTime
;
callback3
.
onWrite
=
afterWriteTime
;
UA_Server_setVariableNode_valueCallback
(
server
,
currentNodeId3
,
callback3
);
}
...
...
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