PLIN - Simple API Example
Posted: 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.
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.