First, I defined several bus signals in workspace, and I know these bus signals would be generated as structs in code generation.
For example, I defined a bus signal named PARA, then I added some bus elements like A, B, C to PARA. Eventually, in code generation, SIMULINK would generate
And then it would define
My question is, how can I use the pointer of struct PARA_T to be an argument of a function, and to be clear, this function is being generated by SIMULINK code generation through a subsystem.
For example, I created a subsystem and set his code generation page as reusable function and name LPF, and so on.
Then in the code generation process, I want this subsystem to be code generated as
void LPF (PARA *k)
K->C = K->A + K->B;
And then in the main.c
My current strategy is like this,
I defined some bus signals in workspace like Bus Motor, and then I used some Data Store Memory modules and set their Date Type as Bus Motor.
Finally I used Data Store Read modules to read these data in Bus signals ( which were structs in code generation. ).
But this whole thing doesn't work.
So, how should I build and set these modules, then I can get functions which their arguments are pointers of structs, in code generation, like I said before?