How to create a bus copy in code generation using embedded coder ?
5 views (last 30 days)
Show older comments
hello, for my application I need to copy value of a bus variable into another one, but I need it to be a real memory copy :
for example ETPU_bus is a bus we created in our model, we would like the variable to be copies into etpud_bus_data_core2, the same way a memcpy would do it
but in the generated code we get :
this would translate to passing down the adress of the struct elemnt to another ( knowing that ETPU_bus for example is a struct that has an array as an element )
any idea how to force the code to copy element by element ?
Thank you
0 Comments
Answers (1)
Ashok
on 29 Oct 2024
There are a couple of ways element-by-element copy of a bus signal can be achieved in code generation.
1. One option is to create a dummy atomic subsystem between the inport and outport, as illustrated below.
2. Alternatively, a 'Signal Conversion' block can be inserted between the two ports, with the 'Output' parameter set to 'Signal Copy'. Ensure the "Exclude this block from 'Block reduction' optimization" checkbox is selected.
More information about the ‘Signal Conversion’ block can be found here:
I believe this will assist you!
0 Comments
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!