#include #include "UA_PLC.h" UA_Client *client; u32 Connect(long *ConnectionHdl){ UA_Client *c = UA_Client_new(); UA_StatusCode flag = UA_ClientConfig_setDefault(UA_Client_getConfig(c)); UA_ClientConfig *config=UA_Client_getConfig(c); if (flag == UA_STATUSCODE_GOOD) { flag=UA_Client_connect(c, "opc.tcp://localhost:4840"); }else { UA_Client_delete(c); //memset(c,0,100); return flag; } client = c; *ConnectionHdl = (long *)c; printf("ConnectionHdl %lld \n",*ConnectionHdl); return flag; } u32 NamespaceGetIndexList(long ConnectionHdl,u16 NamespaceUrisCount,STRING *NamespaceUris,u16 *NamespaceIndexes){ UA_Client *c = (UA_Client*)ConnectionHdl; int i; u32 retval=0; if(NamespaceUrisCount>MAX_ELEMENTS_NAMESPACES){ retval=0xA0000002; return retval; } for(i=0;i