BlockIO output set to zero when multiple blocks are used

3 Ansichten (letzte 30 Tage)
Aaron Troll
Aaron Troll am 7 Mai 2024
Kommentiert: Alex am 19 Dez. 2024
There seems to be simulatin issues when using multiple Blocks form IO Device Builder app. Some outputs seem to always be zero in some cases.
I could narrow down the error a little bit but as far as I know the error occurs:
  • when using multiple blocks (of one or different sensors)
  • on blocks that have more than one output
  • on the outputs that are the furthest down (lower right corner) on the block regardless on when the output is changed in the code
  • delay() in the code does not fix the issue
  • other code blocks that are executed in between the BlockIO dont fix the issue
  • Commenting out the other blocks and just simulating one BlockIO individually fixes the issue
  • Using one Output per Block fixes the issue.
Is there something I am doing wrong? I would like to avoid having to create 6 blocks just to read IMU data.
  1 Kommentar
Alex
Alex am 19 Dez. 2024
I am finding I have a similar problem. I made a Device IO block to read CAN messages over SPI without the interrupt (the built-in blocks all use the interrupt)and another to write to a DAC via I2C.
All of my read data from all of the output ports of my CAN read block work, but only the first DAC write works (it’s a 4 channel DAC, I am writing to the first 2). I haven’t tried making multiple DAC writes - are you duplicating the setup functions for multiple instances of your sensor reads?
Just wanted to share that this is not just a one-off.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

MULI
MULI am 6 Dez. 2024
I understand you are facing issues with Simulink blocks generated by the IO Device Builder app, where multiple blocks or outputs result in some signals being stuck at zero. This could be due to:
  • Simulink executes blocks sequentially, and incorrect order can cause outputs to remain zero.
  • Multiple blocks with multi-output sensors might interfere with each other if not properly synchronized.
You can try the following approach to resolve this issue:
By following these steps, you can resolve the issue effectively.

Kategorien

Mehr zu Simulation finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by