What is the difference between "Initial Function" and "InitValue"?
显示 更早的评论
I can define the Initial value of the output of my model using the “Initialize Function”. I have noticed that it is possible to assign a different “InitValue” to corresponding AUTOSAR Port.
So I use both methods:
METHOD 1:
I modify the “Initial value” by going in the “Initialize Function” and setting the value of the constant to block to “uint8(69)”. I then follow the procedure described in documentation which can be accessed by running the below command in the MATLAB R2018b command window:
web(fullfile(docroot, 'ecoder/autosar/configure-autosar-initialization-reset-or-terminate-runnables.html'))
Example image:

METHOD 2:
I modify the "InitValue" by going to the pane “Code > C/C++ Code > Configure AUTOSAR Dictionary …” then in “AUTOSAR > AtomicComponents > swcLUT > SenderPorts”, click on “Out1” and modify the field “InitValue”.
I have specified the value “69” in the “Initialize Function” and the value “96” for the “InitValue”.
Example images:

and the following:

Modified in AUTOSAR:

So,
There is no error while validating/building the model. As a result, I get a generated C file that uses the value “69” as initialization value in the runnable Init, and a generated arxml file that defines the “InitValue” of the port to “96” :

This seems a bit confusing, and I would like to know whether this is expected behaviour, and which is the method to use for initialization.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Messages 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!