Simulink Desktop Real-Time Kernel error: Maximum supported number of timers exceeded?
Show older comments
Hi all,
I'm using the Simulink Desktop Real-Time toolbox in MATLAB 2024a Update 6.
I'm on Windows 10 with Hyper-V and High Precision Event Timer enabled.
I'm reading and writing quite a lot (100+) of CAN and CAN-FD frames using the Packet Input and Packet Output blocks.
I'm using both the 'Connected IO' and 'Run in Kernel' modes depending on my needs: 'Connected IO' allows more interactivity whereas 'Run in Kernel' guarantees real-time performance.
I used to use CAN FD Receive and CAN FD Transmit blocks from the Vehicle Network toolbox, which I prefered because they allowed me to receive and send multiple CAN(FD) frames with a single block. But unfortunately they're not compatible with the 'Run in Kernel' mode (see this answer).
My issue is that I have so many Packet Input and Packet Output blocks, that I get this error in 'Connected IO' mode :
Error reported by S-function 'sldrtsync':
Maximum supported number of timers exceeded.
- What is the maximum number of timers allowed?
- Is there a way to increase this number (in the toolbox options maybe?), or is it hard-coded in the real-time kernel?
- What would be the alternatives to send/receive many CAN(FD) frames in 'Connected IO' mode ?
Thank you
Accepted Answer
More Answers (5)
Seigan
on 3 Sep 2024
0 votes
Jan Houska
on 5 Sep 2024
0 votes
Hello Seigan,
just a comment to the Real-Time Sync block: if a Packet Output block (or other similar block) has a positive value of sample time, it synchronizes to real time the same way the Real-Time Sync block would, so if you have both these in your model, the the Real-Time Sync block is not needed. But deleting it would free just one timer which will not solve your situation anyway.
After some more investigations, there is probably no trivial solution to the problem. The Packet Output block indeed does not support bus arrays. I'm attaching a model that attempts to solve this limitation. The bus array is sent to a For Iterator subsystem that contains the Packet Output block and processes the individual CAN FD messages one-by-one. Because the block must have a sample time of -1, there is a zero-order hold before the subsystem that specifies the sample rate for the subsystem. And, because all the blocks have sample time of -1, the Real-Time Sync block is needed this time.
You can try to group your messages by their sample rate, combine them into bus arrays, and use the approach shown in the model for each of the message groups. Please let me know whether it works for you.
Good Luck, Jan
Seigan
on 19 Sep 2024
0 votes
Jan Houska
on 24 Sep 2024
0 votes
for Packet Input block, the issue is that you don't know the number of received messages in advance. Or do you? If yes, a similar construct may be possible.
Unfortunately, it is not technically feasible to support CAN FD Receive and CAN FD Transmit from the Vehicle Network Toolbox in Run in Kernel mode. However, enhancing the Packet Output block to support vectors on CAN_MESSAGE_BUS (and FD) buses may be possible.
Best Regards, Jan
Seigan
on 25 Sep 2024
0 votes
Categories
Find more on System Configuration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
