Implementing J1939
Implementing J1939
Hi, I just recently started learning the PCAN related software and I had a question regarding implementing J1939 protocol in my code. I know that PCAN-Basic primarily deals with CAN and CAN FD but is there a way to implement J1939 protocol? I'm trying to make a C++ program that sends messages longer than 8 bytes for context.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Implementing J1939
You need a J1939 Software Stack. J1939 is a High Layer Protocol based on CAN 2.0b.
A free available API for J1939 (including sending of fragmented Data (>8 Data Bytes)) is the RP12010 API.
This API include the Support of CAN, SAE J1939, and ISO-TP (ISO 15765-2)
More Info about the PEAK-System RP12010 API could be found here
A free available API for J1939 (including sending of fragmented Data (>8 Data Bytes)) is the RP12010 API.
This API include the Support of CAN, SAE J1939, and ISO-TP (ISO 15765-2)
More Info about the PEAK-System RP12010 API could be found here
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Implementing J1939
Sorry, I have one more question, in regards to the sample code in the documentation about RP1210_ClientConnect, it doesn't work as it finds that pRP1210_ConnectClient is undefined. It says that it's assumed that all API functions are dynamically loaded but I'm not to sure what I'm doing wrong. I've downloaded all the necessary drivers as well as included the header file as well, do you know what would be the problem?
Re: Implementing J1939
Hello,
did you install the RP1210 libraries? Are you sure the function is declarated and loaded well?
did you install the RP1210 libraries? Are you sure the function is declarated and loaded well?
Code: Select all
HINSTANCE PCANRPDll = GetModuleHandle("PEAKRP32");
...
typedef short (__stdcall *pRP1210_ClientConnect) ( HWND, short, char *, long, long, short );
...
pRP1210_ClientConnect pConnect;
pConnect = (pRP1210_ClientConnect)GetProcAddress(PCANRPDll,"RP1210_ClientConnect");
Best regards,
Keneth
Keneth
Re: Implementing J1939
I have the 1210 API Libraries downloaded but now I'm getting the following errors
1. argument of type const char is incompatible with parameter of type LPCWSTR
2. this declaration has no storage class or type specifier
3. this declaration has no storage class or type specifier
4. identifier pRP1210_ConnectClient is undefined
5.class client_Connect has no member m_hWnd
These errors are from top down and left to right in order

1. argument of type const char is incompatible with parameter of type LPCWSTR
2. this declaration has no storage class or type specifier
3. this declaration has no storage class or type specifier
4. identifier pRP1210_ConnectClient is undefined
5.class client_Connect has no member m_hWnd
These errors are from top down and left to right in order

Re: Implementing J1939
Dear,
first, you are using the sample code I gave you for loading the dll dynamically 1:1 as I posted it. Please note in the code posted the "..." lines, which means, it is not all the code. You have to check the variables and error results to for asserting that you are loading the dll. This is outside of our support scope. For more information please check Using Run-Time Dynamic Linking from the Microsoft documentation.
Second, the errors you are seeing are related to the string literals you are uising in your code and the actual configured for your project (multichar vs. Unicode). This is also outside of our support scope. For more information please check String and Character Literals from the Microsoft documentation.
Other errors being shown are just follow compiler errors due to the descirbed above.
Please note that we do support on using the API. We do not offer support for general programming. Thanks for your understanding.
first, you are using the sample code I gave you for loading the dll dynamically 1:1 as I posted it. Please note in the code posted the "..." lines, which means, it is not all the code. You have to check the variables and error results to for asserting that you are loading the dll. This is outside of our support scope. For more information please check Using Run-Time Dynamic Linking from the Microsoft documentation.
Second, the errors you are seeing are related to the string literals you are uising in your code and the actual configured for your project (multichar vs. Unicode). This is also outside of our support scope. For more information please check String and Character Literals from the Microsoft documentation.
Other errors being shown are just follow compiler errors due to the descirbed above.
Please note that we do support on using the API. We do not offer support for general programming. Thanks for your understanding.
Best regards,
Keneth
Keneth