Why the message transmitted by the CAN network built by Vehicle network toolbox has big delays or missing

2 次查看(过去 30 天)
I use the " openExample('vnt/demoVNTSL_CANCommunicationExample')" to test the Vehicle network toolbox. However, I found that though i have disabled 'Transmit messages periodically', the output siganl shows a big delay compared to the input signal, and the time of delay is various. Besides, if I modified the number of messages received at each timestep to 1, it shows a constant delay compared to the input and the delay is very large. Could you please help me solve this problem?

回答(1 个)

Poorna
Poorna 2024-2-9
Hi Cong,
I see that you are observing delays in the received signal from the CAN receive block.
The output that you are observing is expected and the reason the received signal is delayed is related to the sample times of the “zero-order hold” block and the “CAN Receive” block.
A “zero-order hold” will discretize the input signal as per the sample time set. You must set it to appropriate values as per the requirements. On the other hand, the sample time of the "CAN Receive" block dictates the frequency at which the subsystem responsible for processing the received messages is activated.
If the sample time of the “CAN Receive” block is not small enough, then all of the transmitted messages will not be processed for us to get a smooth curve. To capture the messages as close as possible to the original one, you could try increasing the sample of the “zero-order hold” block or try decreasing the sample time of the “CAN Receive” block.
To know more about the above blocks, please refer to below documentation:

类别

Help CenterFile Exchange 中查找有关 Vehicle Network Toolbox 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by