04-21-2015 09:00 AM
greetings,
i'm addressing an Ethercat device using the Beckhoff Twincat ADS dotnet library, that is linked into my project as an instrument i created.
The function in question reads an analog input into the variable whos handle i pass to it (&valueHandle1) , but also requires the variable type, of the type System_Type.
err = TwinCAT_Ads_TcAdsClient_ReadAny_1 (tc_handle, Var_handle1, UINT16, &valueHandle1, &exception);
in C# the variable type is easily passed by e.g. typeof(Uint16)
but i'm having difficulty in Labwindows. i tried passing the variable type directly, without success.
This is the function proto:
int CVIFUNC TwinCAT_Ads_TcAdsClient_ReadAny_1(
TwinCAT_Ads_TcAdsClient __instance,
int variableHandle,
System_Type type,
CDotNetHandle * __returnValue,
CDotNetHandle * __exception);
and my code is attached below.
Any help will be appreciated
Thys
04-22-2015 02:36 PM