07-13-2012 11:05 AM
Hello,
I need help, I try to connect a software developped with LabWinows/CVI 9.0 to the opc server of National Instrument.
The tag is "opc://localhost/National Instruments.Variable Engine.1//./QGAPro/5_2" or "opc://localhost/National Instruments.Variable Engine.1//./QGAPro/5_4" for example.
But the program returns "Error: Can't add item to OPC Group. The item ID is not defined in the server address space or no longer exists in the server address space."
I can check the tag with client opc like :
How can I know where is the problem please?
Do you know where is the problem?
Thank you.
Bye. Karine.
07-17-2012 12:11 PM
Hi Karine,
There is very few information on this error, and I have never encountered it. Can I have further information on your problem:
1. What is the instruction that causes the error, are you trying to add new variable to the group on the server? (perhaps can you post a piece of code?)
2. Is there an error code associated to the error you encounter?
3. Have you ever succeeded in connecting to the OPC server with simplier example or without using group for the variable?
Thank you in advance,
Audrey_P
National Instruments France
07-18-2012 02:53 AM - edited 07-18-2012 03:02 AM
You can find below a piece of code.
I can connect to the server OPC with a client test, but I can't in my program.
char opc_target[] = { "opc://localhost/National Instruments.Variable Engine.1//./QGAPro/ " };
static DSEnum_Status status_inline = DSConst_Unconnected;
static DSHandle dsHandle[512] = { 0 };
static void ShowDataSocketError(HRESULT errorCode);
/* This is the callback function for the DataSocket */
void CVICALLBACK DSCallback (DSHandle dsHandle, int event, void *callbackData);
void fieldbus_init(void)
{
HRESULT hr = S_OK;
char chaine_temp[50];
int i, j;
opc_target[65] = '\0';
strcat(opc_target, "5_2");
hr = DS_Open (opc_target, DSConst_ReadAutoUpdate, DSCallback, NULL, &dsHandle[0]); //=> hr : « Opération réussie »
…
}
void DSCallback (DSHandle localDSHandle, int event, void *pUserData)
{
HRESULT hr = S_OK;
char message[1000];
switch (event) {
case DS_EVENT_DATAUPDATED:
break;
case DS_EVENT_STATUSUPDATED:
DS_GetStatus (localDSHandle, &status_inline);
hr = DS_GetLastMessage (localDSHandle, message, 1000); //=> message : « Can't add item to OPC Group. The item ID is not defined in the server address space or no longer exists in the server address space. »
break;
}
return;
}
I can't modify tags because this is another software that generates and which is developed by another company.
I have to read these tags to retrieve the associated values (values of a gas analyzer).
Can you help me with these informations please?
Thank you!
Karine