Do you have any examples of the constructs needed
to access the PassThruAPI functions using C or C++, using Visual Studio 2019?
Also, what is the proper project setup to be able to find the .dll without necessarily having to store it in
the directory where .exe file is.
I can copy the PCAN basic C++_MFC examples and get it to run using the PCAN basic .dll.
Do I have to extract the basics out of those examples and figure out how to create the PassThrough version?
I have a copy of the SAE J2534 specifications (both 2004 and 2015 versions).
SAE J2534_1_2004 code template
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: SAE J2534_1_2004 code template
Hello,
We do not offer examples for the PassThru-API due to the fact that our API is mainly intended to enable communication with our hardware with already existing software.
You can aquire the necessary information in our documentation for the PassThru-API, which you can read here:
https://www.peak-system.com/produktcd/P ... an_eng.pdf
You can also refer to your SAE J2534 specifications for further information.
Best Regards
Marvin
We do not offer examples for the PassThru-API due to the fact that our API is mainly intended to enable communication with our hardware with already existing software.
You can aquire the necessary information in our documentation for the PassThru-API, which you can read here:
https://www.peak-system.com/produktcd/P ... an_eng.pdf
You can also refer to your SAE J2534 specifications for further information.
You dont need to configure this, if you use the setup of the PassThru-API the necessary files will be accessible to your project.Also, what is the proper project setup to be able to find the .dll without necessarily having to store it in
the directory where .exe file is.
You could use the PCANBasic-Example as a basis for a PassThru-API application, yes.Do I have to extract the basics out of those examples and figure out how to create the PassThrough version?
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: SAE J2534_1_2004 code template
I have tried to follow your Pass-Thru API document, and the J2534 _1 2004 standard document; However,
I still get linker errors.
Below are two different ways I tried to declare the function prototypes,
and 3 different ways that tried to implement the PassThruOpen function.
I still get linker errors.
I use the PCANPT32.dll from:
C:\Program Files (x86)\PEAK-System\PCAN-PassThru API\64, and Visual Studio 2019
//Example 1 function prototype
/// Example 2 function prototye
//3 different attempts to call open function
I still get linker errors.
Below are two different ways I tried to declare the function prototypes,
and 3 different ways that tried to implement the PassThruOpen function.
I still get linker errors.
I use the PCANPT32.dll from:
C:\Program Files (x86)\PEAK-System\PCAN-PassThru API\64, and Visual Studio 2019
Below are 2 different trials of function prototype declarations and 3 different trials to implement the function call:LINK1120 1 unresolved externals
LNK2019 unresolved external symbol "unsigned long __cdecl PassThruOpen(void *,unsigned long *)" (?PassThruOpen@@YAKPEAXPEAK@Z) referenced in function main project3 D:\PCAN\PCAN programs\C_programs\project3\project3\test_code.obj 1
//Example 1 function prototype
Code: Select all
extern "C" long WINAPI PassThruOpen
(
void *pName,
unsigned long *pDeviceID
);
Code: Select all
TPCANStatus __stdcall PassThruOpen
(
void* pName,
unsigned long *pDeviceID
);
Code: Select all
OpenResponse = PassThruOpen( NULL, &deviceID);
//OpenResponse = PassThruOpen(&pName, &deviceID);
//OpenResponse = PassThruOpen("J2534-2:PEAK 0x51", &deviceID);
Last edited by K.Wagner on Fri 8. Nov 2019, 08:53, edited 1 time in total.
Reason: Code formatting for better reading
Reason: Code formatting for better reading
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: SAE J2534_1_2004 code template
You need to add the *.lib to your project to get the DLL linked to your code - or use LoadLibrary(..) and then for every function GetProcAdress(...) see Microsoft Documentation how to use standard DLLs in own Projects.
see https://learn.microsoft.com/en-us/windo ... ic-linking
see https://learn.microsoft.com/en-us/windo ... ic-linking
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: SAE J2534_1_2004 code template
Thanks for the information.
I found the following link very useful. For using the Peak DLL you can obviously fast forward past the
section on creating the DLL.
https://docs.microsoft.com/en-us/cpp/bu ... ew=vs-2019

I found the following link very useful. For using the Peak DLL you can obviously fast forward past the
section on creating the DLL.
https://docs.microsoft.com/en-us/cpp/bu ... ew=vs-2019
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: SAE J2534_1_2004 code template
Your link is more for people who want to create a own DLL - my link is for people who want to use a already developped DLL in a C/C++ environment. As i wrote in C/C++ you also could simply add the LIB (created with your development environment using the DLL) to your project and use the static linking of a DLL.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------