Page 1 of 1

Import OBDII Shared Library to LabVIEW

Posted: Thu 18. Dec 2014, 17:25
by srobertson
I've successfully imported the PCAN Basic, TP, UDP, CCP and XCP API's using the LabVIEW 2013 Import Shared Library tool. Everything went smoothly during the import process. I only had to occasionally include the PCAN Basic.h header to accompany some of the .dll's.

The problem I am having is when importing the OBDII API, LabVIEW reports the following problem...

------------------
The function cannot be imported into LabVIEW. This might be caused by one of the following problems:

The function is not declared in the header file but is exported in the library.

Check the header file to make sure it contains declarations of the function.

Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add preprocessor definitions. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
__cplusplus;
--------------------


All of the functions which have "Async" on the name and also OBDII_GetUnitScaling() and OBDII_ReadResponse().
I have searched the header files but can't find the necessary declarations.
Do you have any suggestions how to resolve this problem?
Many thanks,
Scott

Re: Import OBDII Shared Library to LabVIEW

Posted: Thu 18. Dec 2014, 17:53
by U.Wilhelm
We are sorry, but we do not have the knowledge how the LabVIEW 2013 Import Shared Library tool works in detail. Please contact the LabVIEW technical support. The DLLs are tested and work fine with C/C++/Pascal/VB.NET/C# etc. so it must be a restriction of LabVIEW 2013 Import Shared Library tool.

Re: Import OBDII Shared Library to LabVIEW

Posted: Fri 19. Dec 2014, 08:30
by K.Wagner
Hello,

just a tip: be sure that you have all libraries. Remember that OBDII needs the other 3 dlls, ISO-TP (PCAN-ISO-TP.dll), UDS (PCAN-UDS.dll), and PCAN-Basic (PCANBasic.dll). All these files are to be placed together in the system folder of Windows or in the application output folder:
APIs-Hierarchy
APIs-Hierarchy
Apis.jpg (45.33 KiB) Viewed 7499 times

Re: Import OBDII Shared Library to LabVIEW

Posted: Fri 19. Dec 2014, 17:30
by srobertson
Thanks for the tips. I've contacted National Instruments and they are working with me on this problem.
I overcame the first problem by inserting declarations in the obd2 header file for the functions which had a problem.
I basically copied the existing declarations and added "Async" to the function name where needed and this satisfied Labview to allow me to continue.

Now I just have to work out why the Labview shared library tool will is producing "Void" data types for all the functions in the ISO-TP, UDS and OBD 2 VIs. (The PCAN-Basic API was fine).

I'll come back and post the solution if and when we find it so that other Labview user on the forum can benefit.