Ansys Scade - how to set values of inputs and/or convert pointers

I'm trying to convert some C code into an Ansys Scade model.
I have a number of C functions that set values of their inputs (by means of pointers). I’d like to implement these functions in Scade, the question being how exactly to do that.
If I have it right there are no global variables in Scade. So to do this I can’t think of any other way than to set the value in question as an output, and then use that output wherever it is subsequently needed.
The function in question is along the lines of:
//C code void initMyList( UCHAR *NPtr, UCHAR *myListPtr) { *NPtr = 0; memset(myListPtr, 0, ListLength); }
Where ListLength is a global constant which of course Scade has no problem with.
The trouble is setting the values of the inputs NPtr and myListPtr .
If I set those in a node or function operator and use them as outputs then I’ll have to figure out any other place they are used and when , which in this case may be quite an undertaking.
Is there any other way to approach this, such as some way to use global variables in Scade?
Answers
-
Hello @jeremy_rutman Thank you for your question! Hopefully someone from the @SCADE Expertise Group will be able to assist.
0 -
Hello,
The concept of global variables as defined in the C standard, does not exist in the Scade language.
It is not possible to design the exact same function in Scade.
One possible alternative is to keep this piece of code outside the Scade model directly in your integration code.
Another possible alterative to investigate is to use sensor in your model. Sensors are global inputs of the model that can be set outside the Scade model using C code. You can then use sensors in any place of the model as constants.Hope this helps,
Benjamin Descorps
0