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
Martin Manchev
osie
Commits
0e3272ff
Commit
0e3272ff
authored
Oct 06, 2021
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set relays' state based on value being set.
parent
2799f12f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+12
-11
No files found.
coupler/opc-ua-server/server.c
View file @
0e3272ff
...
...
@@ -89,17 +89,18 @@ static void afterWriteTime(UA_Server *server,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeId
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"The variable was updated"
);
setRelayState
(
0x0F
);
printf
(
"Relays ON.
\n
"
);
// wait 1s
sleep
(
1
);
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"The variable was updated"
);
// switch off all relays
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_INT32
])
{
UA_Int32
hrValue
=
*
(
UA_Int32
*
)
data
->
value
.
data
;
printf
(
"int32Value %u
\n
"
,
hrValue
);
if
(
hrValue
>
0
){
setRelayState
(
0x0F
);
}
else
{
setRelayState
(
0x00
);
}
}
}
static
void
addValueCallbackToCurrentTimeVariable
(
UA_Server
*
server
)
{
...
...
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