Why do I get Block error while updating model? Calling a simulink function with bus type as input argument.

2 次查看(过去 30 天)
Hello All,
I get this following error while updating the model, Expression 'PacketHandle(1)' for block 'Scheduler/AddPackage/QueueClass1/If Action Subsystem/If Action Subsystem1/Function Caller' returns a Simulink.Bus object whose property values need to be evaluated. This object should be instantiated in a workspace and referenced by name in Simulink.
In this model a simulink function is defined with input argument of Bus Type: Packet Handle, when this function is called in modle using a function caller and updating the function caller block input argument as seen below
Although the input argument type is explicitly mentioned, I get an error while the model is updated
Expression 'PacketHandle(1)' for block 'Scheduler/AddPackage/QueueClass1/If Action Subsystem/If Action Subsystem1/Function Caller' returns a Simulink.Bus object whose property values need to be evaluated. This object should be instantiated in a workspace and referenced by name in Simulink.
Could anyone kindly provide any counter actions or suggestions to overcome this error?

回答(1 个)

Pavan Sahith
Pavan Sahith 2024-2-12
Hello Srikar,
I see that you've encountered a challenge with specifying the input argument for the 'function caller' block in Simulink, particularly when passing a bus object.
It appears that if 'PackHandle' represents your Bus Object, simply using the name of the Bus Object ('PackHandle') instead of PacketHandle(1), in the input argument specifications should be adequate. This approach is likely to resolve the error you're experiencing.
For a more detailed understanding of how to specify input arguments for Bus Data Types and the use of the 'function caller' block, you can refer to the following MathWorks Documentation:
Hope this will help

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by