LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

passing a variable type to a function

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

 

0 Kudos
Message 1 of 2
(4,183 Views)