This shows you the differences between two versions of the page.
sdk:scripts:opcua-write [2015/07/07 06:58] – created moll | sdk:scripts:opcua-write [2022/09/05 12:12] (current) – schmitt | ||
---|---|---|---|
Line 2: | Line 2: | ||
<code c opcua-write.are> | <code c opcua-write.are> | ||
- | /* DESC: This script will write a new Value to a Node at a OPC-UA-Server. | + | /* DESC: This script will write a new value to a node at a OPC-UA |
- | * Copyright (C) 2012 NetModule AG | + | * Copyright (C) 2015 NetModule AG, Switzerland |
*/ | */ | ||
- | void usage () { | + | void usage () |
- | printf(" | + | { |
+ | printf(" | ||
exit(1); | exit(1); | ||
} | } | ||
Line 15: | Line 16: | ||
} | } | ||
- | opcuaserver | + | server |
- | nodeIndex | + | port = (int) argv[2]; |
- | nodeId | + | nindex |
- | newValue | + | nid = (int) argv[4]; |
+ | value = argv[5]; | ||
- | client_0 | + | url = sprintf(" |
- | if(client_0 >= 0) { | + | |
- | ret = nb_opcua_write(client_0, nodeIndex, nodeId, newValue); | + | client |
- | if(ret < 0) { | + | if (client < 0) { |
- | printf(" | + | printf(" |
- | } else { | + | exit(0); |
- | printf(" | + | } |
- | } | + | |
- | nb_opcua_disconnect(client_0); | + | ret = nb_opcua_write(client, nindex, nid, value); |
+ | |||
+ | if (ret < 0) { | ||
+ | printf(" | ||
} else { | } else { | ||
- | printf(" | + | |
} | } | ||
+ | |||
+ | nb_opcua_disconnect(client); | ||
exit(0); | exit(0); | ||
+ | |||
</ | </ | ||