PLIN - Simple API Example

The free LIN software API (Application Programming Interface) for Windows® (only for usage with the PCAN-USB Pro CAN/LIN interface)
Post Reply
agregor
Posts: 2
Joined: Tue 9. Jul 2024, 09:36

PLIN - Simple API Example

Post by agregor » Tue 9. Jul 2024, 09:49

Hi all,

I'm first time user of the PLIN USB LIN interface and I'm trying to do a simple communication with my product. (I have worked with NI-XNET in the past but it was some time ago) I have some general knowledge on LIN but I'm strugling to get the communication working with the API DLL. I first tried the comunication from the PLIN View PRO and it is working without an issue the steps what I took there:

1. Load the LDF file with the Open function.
2. Set up the node as Master
3. Created a new Schedule
4. Configured the Schedule as Not Repeating
5. Added a new Entry
6. Configured the ID 11h and set the Delay to 10
7. Connected to the HW as Master with 19200baud rate
8. Started the Schedule and I receive response from my target device correctly.

Unfortunately I'm not able to reproduce a similiar behaviur with the API. These are the steps I triy to follow from my code:
LIN - Register Client
LIN_ConnectClient
LIN_InitializeHardware
LIN_SetClientFilter(0xFFFFFFFFFFFFFFFF)
LIN_SetFrameEntry(FrameID: 17, Length 2, Direction Subscriber(2), ChecksumType Enhanced(2), Flags IgnoreInitial(2), InitialData 1D 8Elemetn Array with zeros)

The Set Frame Entry returns error code 4 which is invalid checksum, I do not get what is the issue. I have the exact same seetings in the PLIN Viewer Pro and there it is not a problem.

Thank you for your help in advance.

M.Maidhof
Support
Support
Posts: 1748
Joined: Wed 22. Sep 2010, 14:00

Re: PLIN - Simple API Example

Post by M.Maidhof » Tue 9. Jul 2024, 10:40

Hi,

unfortunately with the given code snipped, we are not able to help (many details are not visible). Please have a look in the PLIN API manual, which will show you how to use the API for the different applications:

https://www.peak-system.com/produktcd/D ... PI_enu.pdf

Please also have a look in the code samples we provide with the PLIN-API for more details.

regards

Michael

agregor
Posts: 2
Joined: Tue 9. Jul 2024, 09:36

Re: PLIN - Simple API Example

Post by agregor » Tue 9. Jul 2024, 11:49

Hi Michael,

Thank you for getting back to me, I read the manual extensively and I have checked the example codes many times but these did not help me.
What do you need from me for further assistance?
You mentioned:
unfortunately with the given code snipped, we are not able to help (many details are not visible)
What do you mean by this? I provided the functions which I ues in the order how I exeecute them I also wrote the paramters what I use wheer it is necessarry.

Please give me more detailed description on the information what you need from me!

Thanks
Ambrus

M.Maidhof
Support
Support
Posts: 1748
Joined: Wed 22. Sep 2010, 14:00

Re: PLIN - Simple API Example

Post by M.Maidhof » Tue 9. Jul 2024, 12:10

Hi,

we need the full code to be able to help your with your API problem. Looks like you also sent an email to our support email address, so we will go on by email.

regards

Michael

Post Reply