How to enable variable output signal size?

1 visualización (últimos 30 días)
Leonardus Yudha Septian Sutanto
Leonardus Yudha Septian Sutanto el 9 de Abr. de 2021
Comentada: Jan Houska el 16 de Abr. de 2021
Hello everyone,
I am trying to simulate a radar sensor for a collision detection. Here I am using LinePickSensor with 5 lines.
The two plates move back and forth along the middle line following sine functions.
From the block VR Source, I need to get pickedPoint as output.
The pickedPoint output has a dimension of 5x3 at the beginning, since all of the lines are in contact with the bigger plate. However, once the plate has moved too far away from the cylinder, the 4 inclined lines lose contact with the plate and only the middle line penetrates the bodies. Therefore, the output signal dimension changes into 1x3 and there is an error report:
An error occurred while running the simulation and the simulation was terminated
Caused by:
  • Error reported by S-function 'vrsfunc' in 'LinePickSensor_test/VR Source': Signal dimension 1 of output port 2 has changed from 5 to 1. Please consider enabling variable output signal size.
How to enable variable output signal size? Is it possible to set the values into 0 if there is no output?

Respuesta aceptada

Jan Houska
Jan Houska el 13 de Abr. de 2021
Hi Leonardus,
there is a checkbox labeled Allow variable-size output signals in the VR Source block dialog. This must be selected (enabled) if your signal changes its size during simulation, as is the case with the LinePickSensor. Please verify if you have this checkbox selected.
Good Luck, Jan
  2 comentarios
Leonardus Yudha Septian Sutanto
Leonardus Yudha Septian Sutanto el 14 de Abr. de 2021
Hi Jan,
Thanks for your answer. I have just selected the checkbox but there is another error:
Simulink cannot propagate the variable-size mode from the 'Output Port 2' of 'LinePickSensor_test/VR Source' to the 'Input Port 1' of 'LinePickSensor_test/Multiport Selector'. This input port expects a fixed-size mode. Examine the configuration of 'LinePickSensor_test/Multiport Selector' for one of the following scenarios: 1) the block does not support variable-size signals; 2) the block supports variable-size signals but needs to be configured for them.
It seems that the Multiport Selector, which I connected with the Collision_Sensor.pickedPoint Output Port doesn't support variable-size signals.
Best Regards,
Yudha
Jan Houska
Jan Houska el 16 de Abr. de 2021
Hi Yudha,
not all blocks support variable-size signals, you must use a block that does. Please see https://www.mathworks.com/help/simulink/ug/variable-size-signal-basics.html for more information.
Good Luck, Jan

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Model Editing en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by