Using the vsmCgRuntimeCommand

This function runs the simulation using the specified input signals.

int vsmCgRuntimeCommand(

                IN SIM_STATE * hSim,

                IN int cmd,

                IN double inSig[],

                OUT double outSig[]

                INOUT double * targetTime);

 

Command values

RTE_RUN_TO_TIME  Runs the Embedmodel until *targetTime is reached. InSig contains a vector of double precision inputs to the simulation. Note that the order of the inputs is the top-down order of the original compound block connectors. On return, outSig contains the calculated output values.

Return values for RTE_RUN_TO_TIME

VSM_SIM_MATH_ERR  Indicates that a math error has occurred.

VSM_SIM_END_TIME_EXCEEDED  Indicates that *targetTime is past the current Embed end time.

VSM_SIM_USER_STOP  Indicates that a user has pressed the stop button or that the stop block has been actuated.

VSM_ERR_FILE_ACCESS  A map or import file could not be opened.

RTE_SET_EXIT_CONDITION  Takes the string in inSig and sets it as a C expression to be evaluated at each time step for early simulation termination.

RTE_SET_TIME  Moves Embed time forward to *targetTime. Note that blocks do not calculate during this call.

RTE_GET_TASK_TIME  Fills *targetTime with the current Embed time.

RTE_GET_TIME_STEP  Returns the current Embed time step.

RTE_GET_NEXT_TIME  Returns the next time at which Embed calculates new values.