LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need help calling external .dll in LabView

I'm working with limited documentation on the .dll that I need to call. I'm specifically stuck at the ISD_GetData line. I've pasted the sample code provided by the support documentation below. My questi on is: what should I be passing from LabView to the "ISD_GetData (handle, &Data);" function for the &Data variable?


void main()
{
ISD_TRACKER_HANDLE handle;
ISD_TRACKER_INFO_TYPE tracker;
ISD_TRACKER_DATA_TYPE data;

handle = ISD_OpenTracker( NULL, 0, FALSE, FALSE );
if( handle > 0 )
printf( "\n Az El Rl X Y Z \n" );
else printf( "Tracker not found. Press any key to exit" );

while( !kbhit() )
{
if( handle > 0 )
{

ISD_GetData( handle, &data );

printf( "%7.2f %7.2f %7.2f %7.3f %7.3f %7.3f
",
data.Station[0].Orientation[0],
data.Station[0].Orientation[1],
data.Station[0].Orientation[2],
data.Station[0].Position[0],
data.Station[0].Position[1],
data.Station[0].Position[2] );

ISD_GetCommInfo( handle, &tracker );
printf( "%5.2fKbps %d Records/s \r", tracker.KBitsPerSec, tracker.RecordsPerSec );
}
Sleep( 6 );
}
ISD_CloseTracker( handle );
}
0 Kudos
Message 1 of 3
(2,523 Views)
Chew Toy;

To know what you should pass in the "data" variable, you need to know what is the structure of ISD_TRACKER_DATA_TYPE. That is probably defined in a header file, in some other source file or in the documentation.

From the code, all I can say is that ISD_TRACKER_DATA_TYPE look like some sort of cluster, but that's it. You need to look further.

Regards;
Enrique
www.visecurity.com
www.vartortech.com
0 Kudos
Message 2 of 3
(2,523 Views)
Hi,

You have to pass a pointer to a ISD_TRACKER_DATA_TYPE. This looks like a
cluster, so you could wire the exact cluster to the dll, and set the input
to "Adapt to type". From the code you send, there is no telling how big this
cluster should be (it seems to be an 2d array of clusters, actually).

For testing, you can also wire a 1d u8 array to it, fitting (or exceeding)
the size of ISD_TRACKER_DATA_TYPE. You get a 1d array back, which you have
to process (with byte swapping, etc.) when it is returned.

Regards,

Wiebe.


"Chew Toy" wrote in message
news:50650000000800000088F00000-1079395200000@exchange.ni.com...
> I'm working with limited documentation on the .dll that I need to
> call. I'm specifically stuck at the ISD_GetData line. I've paste
d
> the sample code provided by the support documentation below. My
> questi on is: what should I be passing from LabView to the
> "ISD_GetData (handle, &Data);" function for the &Data variable?
>
>
> void main()
> {
> ISD_TRACKER_HANDLE handle;
> ISD_TRACKER_INFO_TYPE tracker;
> ISD_TRACKER_DATA_TYPE data;
>
> handle = ISD_OpenTracker( NULL, 0, FALSE, FALSE );
> if( handle > 0 )
> printf( "\n Az El Rl X Y Z \n" );
> else printf( "Tracker not found. Press any key to exit" );
>
> while( !kbhit() )
> {
> if( handle > 0 )
> {
>
> ISD_GetData( handle, &data );
>
> printf( "%7.2f %7.2f %7.2f %7.3f %7.3f %7.3f ",
> data.Station[0].Orientation[0],
> data.Station[0].Orientation[1],
> data.Station[0].Orientation[2],
> data.Station[0].Position[0],
> data.Station[0].Position[1],
> data.Station[0].Position[2] );
>
> ISD_GetCommInfo( handle, &tracker );
> printf( "%5.2fKbps %d Records/s \r", tracker.KBitsPerSec,
> tracker.RecordsPerSec );
> }
> Sleep( 6 );
> }
> ISD_CloseTracker( handle );
> }
0 Kudos
Message 3 of 3
(2,523 Views)