- Argument Specification for Simulink Function Blocks - https://www.mathworks.com/help/simulink/ug/argument-specification-for-simulink-functions.html
- Function Caller- https://www.mathworks.com/help/simulink/slref/functioncaller.html
Why do I get Block error while updating model? Calling a simulink function with bus type as input argument.
3 次查看(过去 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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1602011/image.png)
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?
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!