How can I access the value of an enum, given as a parameter in an s-function

3 views (last 30 days)
I'm writing an s-function in C.
I need a parameter, which is an enum. So in the window "Function Block Parameters: S-Function" the input field "S-Function parameters" is filled with "MyEnumDataClass.Member_2"
In the mdlOutputs function I need the value of the parameter (here I expect the value 2).
The call MyEnumDataClass u2 = (MyEnumDataClass) mxGetScalar(ssGetSFcnParam(S, 0)); doesn't work - I get a zero.
mxIsClass(ssGetSFcnParam(S, 0), "MyEnumDataClass") returns true.
How can I access the value?

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!