LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL import from "ANT" Software Development Kit

Dear LV-Experts!

I need a little help with an external library (DLL) of the ANT-SDK (http://www.thisisant.com) concerning some issues:

  1. What is the most recommended solution to use an imported function with another function as a parameter (callback function)?

    example from the header file: --> ANT_AssignResponseFunction

    typedef BOOL (*RESPONSE_FUNC)(UCHAR ucANTChannel, UCHAR ucResponseMsgID); //callback function pointer

    __declspec(dllexport) void ANT_AssignResponseFunction(RESPONSE_FUNC pfResonse, UCHAR* pucResponseBuffer); //exported function I would like to use in LV

  2. Why does the DLL Import Assistant in LV 8.5 stop during the import while in LV 8.20 it seems to work?

  3. Is it possible to manually define data types for imported DLL functions if the assistant won't recognize them correct?
Info: the DLL I want to use is already compiled and I don't have the source code (only header file, see SDK). Therefore I can only try possible solution that wouldn't need to change the source files.

Thanks in advance,

Best Greetings from Vienna

Philipp

P.S.: I have attached the SDK as a .zip file (only 77kB)
0 Kudos
Message 1 of 5
(4,798 Views)
Hello Philipp,

the dll import also works in Labview 8.5 but you have to change the header file a little. Instead of 'uchar' you have to write 'unsigned char' and so on.
Then it will work.
If the function you are calling returns a data type not listed, choose a return data type the same data size as the one returned by the function. For example, if the function returns a char data type, use an 8-bit unsigned integer. A call to a function in a DLL cannot return a pointer because there are no pointer types in LabVIEW. However, you can specify the return type as an integer that is the same size as the pointer. LabVIEW then treats the address as a simple integer, and you can pass it to future DLL calls.
Unfortunately there is no solution to import a function with another function as parameter.
But maybe this link will help you to find another solution:
http://zone.ni.com/reference/en-XX/help/371361D-01/lvcomm/reg_event_callback/

Regards
DianaS
0 Kudos
Message 2 of 5
(4,765 Views)

So, how did it work out?

 

We are also looking at using LabView for receiving data from ANT devices. Did you manage to adapt the header file and get ANT data into LabView?

0 Kudos
Message 3 of 5
(4,596 Views)

Does anyone have a reference design for using ANT devices in Labview.  I downloaded the German one and it doesn't work due to an "application error" or some such message that requires reinstallation.  Not sure what the issue is?  Anyone else have any issues reading ANT data in Labview? 

 

 

 

Regards,

 

 

Brian

0 Kudos
Message 4 of 5
(4,339 Views)

http://www.scribd.com/doc/20351918/Introduction-to-LabVIEW-8-in-6-Hours - Check this out if it can help you out..

Best,
Steve - Expert in Software Development
0 Kudos
Message 5 of 5
(3,672 Views)