MATLAB Answers


How can I speed up simulation of my PEAK USB CAN simulink Library on Raspberry Pi in External Mode?

Asked by srikanth balla on 4 Sep 2018
Latest activity Edited by srikanth balla on 1 Nov 2018
I have implemented PEAK USB CAN simulink Library which will work on raspberry pi in External Model. The Library contains PCAN Initialization and PCAN Read simulink blocks which will work as hardware support packages. when i run the simulation on Raspberry Pi to read CAN data from PCAN Channels(PCAN_USBBUS1 to 6). There is a delay in simulation. CAN data is updating after some time. i observed 2 to 3 min delay. The simulink Library depends on PCANBASIC library which is installed on raspberry pi.
How can i speed up the simulation?

  1 Comment

I have changed the sampling time in C-Mex Code. Now the Library is working fine for Normal mode but in external mode it is giving 6sec delay

Sign in to comment.

1 Answer

Answer by srikanth balla on 12 Sep 2018



As I observed, PCAN Library works without delay in Normal mode but in External mode it is giving 6 seconds delay to update CAN data. how to speed up the CAN data update on raspberry External Mode?
i have enabled Detect Overrun in model configuration parameters.
The following message is captured in log file of model
"Overrun detected: The sample time for the rate 0 is too short."
after some time of execution PCAN Library is not receiving CAN messages.

Sign in to comment.