Conditional RTE Write of structure in AUTOSAR Generated Code

19 ビュー (過去 30 日間)
Ludvik
Ludvik 2025 年 3 月 11 日
コメント済み: Liang Zong 2025 年 6 月 18 日
I would like to generate code with the "Rte_Write" call inside an "if" statement, but output should be structure datatype. Problem is Autosar generator will not allow me to use virtual port in this case and RTE Write is always located on end of main runnable, not in if statement.
Error:When model 'COMH_Mini' has function-call root-level Inport blocks, or is set up to export functions, the input signal to the root-level Outport block 'COMH_Mini/COMH_sigGroup_CAN_H2CU_33_CINV100msNo01_COMH_sigGroup_CAN_H2CU_33_CINV100msNo01' cannot be a virtual bus. Consider replacing this Outport block with an Out Bus Element block, or making the input signal a nonvirtual bus.
  3 件のコメント
Ludvik
Ludvik 2025 年 3 月 21 日
hello, I did. Thats's why I have created this section. With autosar.tlc port containing structure cannot be set to virtual.
Liang Zong
Liang Zong 2025 年 6 月 18 日
i have the same issue(error: block with an Out Bus Element block, or making the input signal a nonvirtual bus)
1.when the out-port datatype is uint8/16/single/.., the "Rte_Write" appear successfully inside an "if" statement after i follow steps in https:/mathworks.com/matlabcentral/answers/2110141-conditional-rte-write-in-autosar-generated-code? . but when the out-port datatype is a bus(struct), the "Rte_Write" allways appear on end of main runnable.
2.my matlab version is 2022b

サインインしてコメントする。

回答 (1 件)

qi
qi 2025 年 3 月 16 日
I have the same issue, bus RTE write is always located on end of main runnable.

製品

Community Treasure Hunt

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

Start Hunting!

Translated by