Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sdk:scripts:opcua-search [2015/07/07 08:57] (current)
moll created
Line 1: Line 1:
 +====== SDK Script opcua-search.are ======
 +<code c opcua-search.are>​
 +
 +/* DESC: This script will search for Nodes similar to the given String.
 + * Copyright (C) 2012 NetModule AG
 + */
 +
 +void usage () {
 +    printf("​usage:​ opcua-search.are <​opcuaserver>​ <​searchingString>​\n"​);​
 +    exit(1);
 +}
 +
 +if (argc != 2) {
 +    usage();
 +}
 +
 +opcuaserver = argv[1];
 +searchingString = argv[2];
 +
 +
 +client_0 = nb_opcua_connect(opcuaserver);​
 +if(client_0 >= 0) {
 + ret = nb_opcua_search(client_0,​ searchingString);​
 + if(ret == -1) {
 + printf("​could not search for %s\n", searchingString);​
 + } else {
 + printf("​succesfully connected and searched for %s\n", searchingString);​
 + printf("​the result is:​\n"​);​
 + dump(ret);​
 + }
 + nb_opcua_disconnect(client_0);​
 +} else {
 + printf("​could not connect to server %s\n", opcuaserver);​
 +}
 +
 +exit(0);
 +
 +</​code>​