Get a pointer from a block's pointer work vector
void *ssGetPWorkValue(SimStruct *S, int_T idx)
Use to access an element of the pointer work vector used by the block represented by S. The vector consists of elements of type void * and is of length ssGetNumPWork(S). Typically, this vector is initialized in mdlStart or mdlInitializeConditions, updated in mdlUpdate, and used in mdlOutputs. You can use this macro in the simulation loop, mdlInitializeConditions, or mdlStart routines. A return value of NULL indicates that no value was assigned into the idx element of the pointer work vector.
The following statement
void* v = ssGetPWorkValue(S, 0);
is equivalent to
void** wv = ssGetPWork(S); void* v = wv;