This shows you the differences between two versions of the page.
Last revision | |||
— | sdk:scripts:opcua-read [2015/07/07 06:55] – created moll | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SDK Script opcua-read.are ====== | ||
+ | <code c opcua-read.are> | ||
+ | /* DESC: This script will read the Value from a Node at a OPC-UA-Server. | ||
+ | * Copyright (C) 2012 NetModule AG | ||
+ | */ | ||
+ | |||
+ | void usage () { | ||
+ | printf(" | ||
+ | exit(1); | ||
+ | } | ||
+ | |||
+ | if (argc != 4) { | ||
+ | usage(); | ||
+ | } | ||
+ | |||
+ | opcuaserver = argv[1]; | ||
+ | nodeIndex = (int) argv[2]; | ||
+ | nodeId = (int) argv[3]; | ||
+ | |||
+ | client_0 = nb_opcua_connect(opcuaserver); | ||
+ | if(client_0 >= 0) { | ||
+ | ret = nb_opcua_read(client_0, | ||
+ | if(ret < 0) { | ||
+ | printf(" | ||
+ | } else { | ||
+ | printf(" | ||
+ | } | ||
+ | nb_opcua_disconnect(client_0); | ||
+ | } else { | ||
+ | printf(" | ||
+ | } | ||
+ | |||
+ | exit(0); | ||
+ | |||
+ | </ | ||