Skip to Main Content Skip to Search
Product Documentation

ssGetPWorkValue - Get a pointer from a block's pointer work vector

Syntax

void *ssGetPWorkValue(SimStruct *S, int_T idx)

Arguments

S

SimStruct representing an S-Function block.

idx

Index of the pointer returned by this function.

Returns

The (void *) element of the PWork vector at the index idx.

Description

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.

Languages

C, C++

Example

The following statement

void* v = ssGetPWorkValue(S, 0);

is equivalent to

void** wv = ssGetPWork(S);
void* v = wv[0];

See Also

ssGetNumPWork, ssGetPWork, ssSetPWorkValue

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS