Kvaser / pycanlib

The pycanlib package is a Python wrapper for Kvaser CANlib SDK.
https://pycanlib.readthedocs.io
MIT License
16 stars 4 forks source link

Unable to send LIN messages periodically with linlib library #2

Closed nitishn23 closed 1 year ago

nitishn23 commented 1 year ago

Hi i am using Linlib library with Kvaser LIN leaf professional interface i am trying to send the Lin frames periodically using this llib file but it did not work, is there any alternate way like using object buffers as in CANlib?

mh-kvaser commented 1 year ago

I'm not familiar with llib files. And there are unfortunately no object buffers in linlib. So you have to do it manually with master.writeMessage() (as a master) or updating the slave with slave.updateMessage()

Please feel free to contact Kvaser Support for further support.

nitishn23 commented 1 year ago

Thanks for the response, i try to get in touch with kvaser support

TroyVia commented 1 year ago

Were you able to resolve your issues by contacting the support staff at Kvaser?

As mh-kvaser stated above, the master node in the LIN system is responsible for scheduling all transmissions on the LIN bus. Our API does not provide any "built-in" scheduler. So, your Python application is responsible for generating the appropriate writeMessage() or requestMessage() call at the desired periodic rate. Your application is also responsible for allowing enough time for the frame to be completed before sending the next frame. This why the application code often is a call to trigger a message followed by an attempt to read that message. This ensures the last message is complete before attempting to send another one.

If you are still having issues, please reach out to support@kvaser.com.

nitishn23 commented 1 year ago

Hi Tory yes you have provided me the required information via email, i had an issue of timing resolution with which time.sleep takes few more milli seconds to actual. Probably i may have write my own looping structure to more precise delay was the suggestion .

Thank You