Accessing work vectors / simstruc from custom code
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a level-2 c s-function and it uses PWork vectors for storing data structures.
For some reason I have a separate c code that is inlined to the Simulink model's generated code via the Simulink Coder's Custom Code blocks. This other code runs in a separate task and mutually exclusively to the s-function.
Now in this code I would like to access and manipulate the exact same data structure that is used by the s-function.
Can I do this? If yes, how?
If I include the simstruc.h into my other code, it can in theory call the ssGetPWork(SimStruct *S) method, but my problem is this SimStruct *S parameter. It is passed to the s-function like this in the generated model-code:
SimStruct *rts = <modelname>_M->childSfunctions[0];
sfcnOutputs(rts, 0);
I can put this into my other code, but I would like to do it so, that i do not have to know the name of the model. Thanks for any idea!
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!