11-26-2008 01:58 PM
Hello, I am having trouble getting data from a MicroLogix 1100 through RSLinx into Labwindows using the Datasocket toolkit.
I have used the toolkit to connect through RSLinx to AB PLCs that support creating tags on the PLC. The MicroLogix 1100 does not seem to support the creation of tags and my application cannot get data through the RSLinx OPC server.
A connection is established and I get a handle returned for the connection. When I request what the data type is it returns a type of 0 which is not valid. When I try to get data from the handle, I get the error message 80020003 - Member not found.
Can anyone help?
Thanks,
Ed.
12-01-2008 06:04 PM
Hello Ed,
Are you expecting a Boolean? This KnowledgeBase indicates some issues with RSLinx and Boolean data types.
If that's not the case, have you tried using the CVI datasocket examples?
12-01-2008 06:16 PM
Hi David,
Thanks for the response.
We have tried each different type of register. We have also tried using the 'OPC Client Demo' sample that comes with the datasocket toolkit. There are not a lot of function in the toolkit, my DLL which works on several other PLCs simply requests the datatype for the connection and then requests data from the connection in the datatype that matches.
DS_GetDataType(ptr->handle,&ptr->type,NULL,NULL);
No error is returned, but the data type returned is 0, valid values start at 100.
Then my callback routinue for for updated data requests data depending on the type
case CAVT_LONG:
DS_GetDataValue (gptr->handle, CAVT_LONG, &gptr->l_value, sizeof(long), NULL, NULL);
if ( ln_debug ) fprintf( DebugFile, "\n%.3f Got LONG value for index %i : %i", Timer(), myitem.index, gptr->l_value );
break;
case CAVT_FLOAT:
DS_GetDataValue (gptr->handle, CAVT_FLOAT, &gptr->f_value, sizeof(float), NULL, NULL);
if ( ln_debug ) fprintf( DebugFile, "\n%.3f Got FLOAT value for index %i : %f", Timer(), myitem.index, gptr->f_value );
break;
case CAVT_DOUBLE:
DS_GetDataValue (gptr->handle, CAVT_DOUBLE, &gptr->d_value, sizeof(double), NULL, NULL);
if ( ln_debug ) fprintf( DebugFile, "\n%.3f Got DOUBLE value for index %i : %f", Timer(), myitem.index, gptr->d_value );
break;
12-01-2008 06:19 PM
Sorry, didn't quite finish my last message.
I guess the concern is that the toolkit requires the OPC server to report a datatype before it can retrieve data. I don't know if this is dependant upon the 1100 PLC or RSLinx Classis OPC server that is installed.
Thanks for any help!
Regards,
Ed.
12-16-2008 02:20 AM
Hello Ed,
The CVI help for both of those functions mentions the case when the function returns a Variant which we can then cast, are you seeing this behavior at all?
It appears as if we are limited to reading a datasocket object of a known type (or variant).