本文整理汇总了C++中rtmSetErrorStatus函数的典型用法代码示例。如果您正苦于以下问题:C++ rtmSetErrorStatus函数的具体用法?C++ rtmSetErrorStatus怎么用?C++ rtmSetErrorStatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtmSetErrorStatus函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: udpRead_update
/* Model update function */
void udpRead_update(void)
{
/* Update for UnitDelay: '<S3>/FixPt Unit Delay2' incorporates:
* Constant: '<S3>/FixPt Constant'
*/
udpRead_DW.FixPtUnitDelay2_DSTATE = udpRead_P.FixPtConstant_Value;
/* Update for UnitDelay: '<S3>/FixPt Unit Delay1' */
udpRead_DW.FixPtUnitDelay1_DSTATE = udpRead_B.Xnew;
/* signal main to stop simulation */
{ /* Sample time: [0.001s, 0.0s] */
if ((rtmGetTFinal(udpRead_M)!=-1) &&
!((rtmGetTFinal(udpRead_M)-udpRead_M->Timing.taskTime0) >
udpRead_M->Timing.taskTime0 * (DBL_EPSILON))) {
rtmSetErrorStatus(udpRead_M, "Simulation finished");
}
if (rtmGetStopRequested(udpRead_M)) {
rtmSetErrorStatus(udpRead_M, "Simulation finished");
}
}
/* Update absolute time for base rate */
/* The "clockTick0" counts the number of times the code of this task has
* been executed. The absolute time is the multiplication of "clockTick0"
* and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
* overflow during the application lifespan selected.
*/
udpRead_M->Timing.taskTime0 =
(++udpRead_M->Timing.clockTick0) * udpRead_M->Timing.stepSize0;
}
示例2: Hammerstein_step
/* Model step function */
void Hammerstein_step(void)
{
/* DiscreteStateSpace: '<S1>/LinearModel' */
{
Hammerstein_B.LinearModel = Hammerstein_P.LinearModel_C*
Hammerstein_DWork.LinearModel_DSTATE;
}
/* Level2 S-Function Block: '<S1>/Pwlinear1' (sfunpwlinear) */
{
SimStruct *rts = Hammerstein_M->childSfunctions[0];
ssSetOutputPortSignal(rts, 0, &Hammerstein_Y.Out1);
sfcnOutputs(rts, 0);
}
/* Level2 S-Function Block: '<S1>/Pwlinear' (sfunpwlinear) */
{
SimStruct *rts = Hammerstein_M->childSfunctions[1];
sfcnOutputs(rts, 0);
}
/* Update for DiscreteStateSpace: '<S1>/LinearModel' */
{
Hammerstein_DWork.LinearModel_DSTATE = Hammerstein_B.Pwlinear +
Hammerstein_P.LinearModel_A*Hammerstein_DWork.LinearModel_DSTATE;
}
/* Matfile logging */
rt_UpdateTXYLogVars(Hammerstein_M->rtwLogInfo, (Hammerstein_M->Timing.t));
/* signal main to stop simulation */
{ /* Sample time: [0.06s, 0.0s] */
if ((rtmGetTFinal(Hammerstein_M)!=-1) &&
!((rtmGetTFinal(Hammerstein_M)-Hammerstein_M->Timing.t[0]) >
Hammerstein_M->Timing.t[0] * (DBL_EPSILON))) {
rtmSetErrorStatus(Hammerstein_M, "Simulation finished");
}
if (rtmGetStopRequested(Hammerstein_M)) {
rtmSetErrorStatus(Hammerstein_M, "Simulation finished");
}
}
/* Update absolute time for base rate */
/* The "clockTick0" counts the number of times the code of this task has
* been executed. The absolute time is the multiplication of "clockTick0"
* and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
* overflow during the application lifespan selected.
* Timer of this task consists of two 32 bit unsigned integers.
* The two integers represent the low bits Timing.clockTick0 and the high bits
* Timing.clockTickH0. When the low bit overflows to 0, the high bits increment.
*/
if (!(++Hammerstein_M->Timing.clockTick0)) {
++Hammerstein_M->Timing.clockTickH0;
}
Hammerstein_M->Timing.t[0] = Hammerstein_M->Timing.clockTick0 *
Hammerstein_M->Timing.stepSize0 + Hammerstein_M->Timing.clockTickH0 *
Hammerstein_M->Timing.stepSize0 * 4294967296.0;
}
示例3: main
int main(int argc, char **argv)
{
printf("**starting the model**\n");
fflush(stdout);
rtmSetErrorStatus(Model_M, 0);
rtExtModeParseArgs(argc, (const char_T **)argv, NULL);
/* Initialize model */
Model_initialize();
/* External mode */
rtSetTFinalForExtMode(&rtmGetTFinal(Model_M));
rtExtModeCheckInit(1);
{
boolean_T rtmStopReq = false;
rtExtModeWaitForStartPkt(Model_M->extModeInfo, 1, &rtmStopReq);
if (rtmStopReq) {
rtmSetStopRequested(Model_M, true);
}
}
rtERTExtModeStartMsg();
/* Call RTOS Initialization funcation */
prosRTOSInit(0.2, 0);
/* Wait for stop semaphore */
mw_osSemaphoreWaitEver(&stopSem);
return 0;
}
示例4: motorController_initialize
/* Model initialize function */
void motorController_initialize(boolean_T firstTime)
{
if (firstTime) {
/* registration code */
/* initialize error status */
rtmSetErrorStatus(motorController_M, (const char_T *)0);
/* data type work */
{
int_T i;
real_T *dwork_ptr = (real_T *) &motorController_DWork.SpeedReg_DSTATE;
for (i = 0; i < 2; i++) {
dwork_ptr[i] = 0.0;
}
}
/* external inputs */
motorController_U.delta_r_sp = 0.0;
motorController_U.delta_r_act = 0.0;
motorController_U.angular_rate = 0.0;
motorController_U.current = 0.0;
/* external outputs */
motorController_Y.voltage = 0.0;
}
}
示例5: baseRateTask
void baseRateTask(void *arg)
{
runModel = (rtmGetErrorStatus(Model_M) == (NULL)) && !rtmGetStopRequested
(Model_M);
while (runModel) {
mw_osSemaphoreWaitEver(&baserateTaskSem);
/* External mode */
{
boolean_T rtmStopReq = false;
rtExtModePauseIfNeeded(Model_M->extModeInfo, 1, &rtmStopReq);
if (rtmStopReq) {
rtmSetStopRequested(Model_M, true);
}
if (rtmGetStopRequested(Model_M) == true) {
rtmSetErrorStatus(Model_M, "Simulation finished");
break;
}
}
Model_step();
/* Get model outputs here */
rtExtModeCheckEndTrigger();
runModel = (rtmGetErrorStatus(Model_M) == (NULL)) && !rtmGetStopRequested
(Model_M);
}
runModel = 0;
terminateTask(arg);
taskDelete((void *)0);
}
示例6: model_jxz_initialize
/* Model initialize function */
void model_jxz_initialize(RT_MODEL_model_jxz *const model_jxz_M)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(model_jxz_M, (NULL));
}
示例7: floribot_accu_watchdog_initialize
/* Model initialize function */
void floribot_accu_watchdog_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(floribot_accu_watchdog_M, (NULL));
/* states (dwork) */
(void) memset((void *)&floribot_accu_watchdog_DW, 0,
sizeof(DW_floribot_accu_watchdog_T));
/* external inputs */
(void) memset((void *)&floribot_accu_watchdog_U, 0,
sizeof(ExtU_floribot_accu_watchdog_T));
/* external outputs */
floribot_accu_watchdog_Y.accu_low = FALSE;
/* InitializeConditions for Chart: '<Root>/Chart' */
floribot_accu_watchdog_DW.is_active_c1_floribot_accu_watc = 0U;
floribot_accu_watchdog_DW.is_c1_floribot_accu_watchdog =
floribot_acc_IN_NO_ACTIVE_CHILD;
/* InitializeConditions for Outport: '<Root>/accu_low' incorporates:
* InitializeConditions for Chart: '<Root>/Chart'
*/
floribot_accu_watchdog_Y.accu_low = FALSE;
}
示例8: c2000_profiler_initialize
/* Model initialize function */
void c2000_profiler_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(c2000_profiler_M, (NULL));
/* states (dwork) */
(void) memset((void *)&c2000_profiler_DWork, 0,
sizeof(D_Work_c2000_profiler));
/* external inputs */
(void) memset((void *)&c2000_profiler_U, 0,
sizeof(ExternalInputs_c2000_profiler));
/* external outputs */
(void) memset(&c2000_profiler_Y.Voltageoutputs[0], 0,
3U*sizeof(int32_T));
/* InitializeConditions for UnitDelay: '<S7>/Unit Delay' */
c2000_profiler_DWork.UnitDelay_DSTATE[0] =
c2000_profiler_P.UnitDelay_InitialCondition[0];
c2000_profiler_DWork.UnitDelay_DSTATE[1] =
c2000_profiler_P.UnitDelay_InitialCondition[1];
}
示例9: Delay0_initialize
/* Model initialize function */
void Delay0_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(Delay0_M, (NULL));
/* states (dwork) */
(void) memset((void *)&Delay0_DW, 0,
sizeof(DW_Delay0_T));
/* external inputs */
(void) memset((void *)&Delay0_U, 0,
sizeof(ExtU_Delay0_T));
/* external outputs */
(void) memset(&Delay0_Y.Out1[0], 0,
2048U*sizeof(real_T));
{
int32_T i;
int32_T buffIdx;
/* InitializeConditions for S-Function (sdspvdly2): '<S1>/Variable Fractional Delay' */
Delay0_DW.VariableFractionalDelay_BUFF_OF = 44100;
buffIdx = 0;
for (i = 0; i < 44101; i++) {
Delay0_DW.VariableFractionalDelay_BUFF[buffIdx] = 0.0;
buffIdx++;
}
/* End of InitializeConditions for S-Function (sdspvdly2): '<S1>/Variable Fractional Delay' */
}
}
示例10: CelpSimulink_update
/* Model update function */
static void CelpSimulink_update(int_T tid)
{
{
static char sErr[512];
void *device = CelpSimulink_DWork.ToAudioDevice_AudioDevice;
AudioDeviceLibrary *adl = (AudioDeviceLibrary*)
&CelpSimulink_DWork.ToAudioDevice_AudioDeviceLib[0];
sErr[0] = 0;
if (device)
adl->deviceUpdate(device, sErr, CelpSimulink_B.DeemphasisFilter, 1, 1);
if (*sErr) {
DestroyAudioDeviceLibrary(adl);
rtmSetErrorStatus(CelpSimulink_M, sErr);
rtmSetStopRequested(CelpSimulink_M, 1);
}
}
/* Update absolute time for base rate */
if (!(++CelpSimulink_M->Timing.clockTick0))
++CelpSimulink_M->Timing.clockTickH0;
CelpSimulink_M->Timing.t[0] = CelpSimulink_M->Timing.clockTick0 *
CelpSimulink_M->Timing.stepSize0 + CelpSimulink_M->Timing.clockTickH0 *
CelpSimulink_M->Timing.stepSize0 * 4294967296.0;
UNUSED_PARAMETER(tid);
}
示例11: rt_OneStep
void rt_OneStep(ExternalInputs_microwave_combin *input)
{
static boolean_T OverrunFlag = 0;
/* Disable interrupts here */
/* Check for overrun */
if (OverrunFlag) {
rtmSetErrorStatus(microwave_combined_M, "Overrun");
return;
}
OverrunFlag = TRUE;
/* Save FPU context here (if necessary) */
/* Re-enable timer or interrupt here */
/* Set model inputs here */
microwave_combined_U = *input;
/* Step the model */
microwave_combined_step();
/* Get model outputs here */
check_observers ();
/* Indicate task complete */
OverrunFlag = FALSE;
/* Disable interrupts here */
/* Restore FPU context here (if necessary) */
/* Enable interrupts here */
}
示例12: omni_interface_terminate
/* Model terminate function */
void omni_interface_terminate(void)
{
/* S-Function Block: omni_interface/HIL Initialize (hil_initialize_block) */
{
t_boolean is_switching;
t_int result;
hil_task_stop_all(omni_interface_DWork.HILInitialize_Card);
hil_task_delete_all(omni_interface_DWork.HILInitialize_Card);
is_switching = false;
if ((omni_interface_P.HILInitialize_POTerminate && !is_switching) ||
(omni_interface_P.HILInitialize_POExit && is_switching)) {
omni_interface_DWork.HILInitialize_POValues[0] =
omni_interface_P.HILInitialize_POFinal;
omni_interface_DWork.HILInitialize_POValues[1] =
omni_interface_P.HILInitialize_POFinal;
omni_interface_DWork.HILInitialize_POValues[2] =
omni_interface_P.HILInitialize_POFinal;
result = hil_write_pwm(omni_interface_DWork.HILInitialize_Card,
&omni_interface_P.HILInitialize_POChannels[0], 3U,
&omni_interface_DWork.HILInitialize_POValues[0]);
if (result < 0) {
msg_get_error_messageA(NULL, result, _rt_error_message, sizeof
(_rt_error_message));
rtmSetErrorStatus(omni_interface_M, _rt_error_message);
}
}
hil_close(omni_interface_DWork.HILInitialize_Card);
omni_interface_DWork.HILInitialize_Card = NULL;
}
/* S-Function Block: omni_interface/Stream Answer (stream_answer_block) */
{
if (omni_interface_DWork.StreamAnswer_Client != NULL) {
stream_close(omni_interface_DWork.StreamAnswer_Client);
omni_interface_DWork.StreamAnswer_Client = NULL;
}
if (omni_interface_DWork.StreamAnswer_Listener != NULL) {
stream_close(omni_interface_DWork.StreamAnswer_Listener);
omni_interface_DWork.StreamAnswer_Listener = NULL;
}
}
/* S-Function Block: omni_interface/Stream Answer1 (stream_answer_block) */
{
if (omni_interface_DWork.StreamAnswer1_Client != NULL) {
stream_close(omni_interface_DWork.StreamAnswer1_Client);
omni_interface_DWork.StreamAnswer1_Client = NULL;
}
if (omni_interface_DWork.StreamAnswer1_Listener != NULL) {
stream_close(omni_interface_DWork.StreamAnswer1_Listener);
omni_interface_DWork.StreamAnswer1_Listener = NULL;
}
}
/* External mode */
rtExtModeShutdown(1);
}
示例13: LookupTableDynamic_initialize
/* Model initialize function */
void LookupTableDynamic_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(LookupTableDynamic_M, (NULL));
/* block I/O */
/* exported global signals */
LookupTableDynamic_Constant_1[0] = 0.0;
LookupTableDynamic_Constant_1[1] = 0.0;
LookupTableDynamic_Constant_1[2] = 0.0;
LookupTableDynamic_Constant1_1[0] = 0.0;
LookupTableDynamic_Constant1_1[1] = 0.0;
LookupTableDynamic_Constant1_1[2] = 0.0;
LookupTableDynamic_LookupTableDynamic_1 = 0.0;
/* external inputs */
LookupTableDynamic_In1_1 = 0.0;
/* Start for Constant: '<Root>/Constant' */
LookupTableDynamic_Constant_1[0] = LookupTableDynamic_P.Constant_Value[0];
LookupTableDynamic_Constant_1[1] = LookupTableDynamic_P.Constant_Value[1];
LookupTableDynamic_Constant_1[2] = LookupTableDynamic_P.Constant_Value[2];
/* Start for Constant: '<Root>/Constant1' */
LookupTableDynamic_Constant1_1[0] = LookupTableDynamic_P.Constant1_Value[0];
LookupTableDynamic_Constant1_1[1] = LookupTableDynamic_P.Constant1_Value[1];
LookupTableDynamic_Constant1_1[2] = LookupTableDynamic_P.Constant1_Value[2];
}
示例14: Assignment_initialize
/* Model initialize function */
void Assignment_initialize(void)
{
/* Registration code */
/* initialize error status */
rtmSetErrorStatus(Assignment_M, (NULL));
/* block I/O */
/* exported global signals */
Assignment_Constant_1[0] = 0.0;
Assignment_Constant_1[1] = 0.0;
Assignment_Constant_1[2] = 0.0;
Assignment_Constant_1[3] = 0.0;
Assignment_Assignment_1[0] = 0.0;
Assignment_Assignment_1[1] = 0.0;
Assignment_Assignment_1[2] = 0.0;
Assignment_Assignment_1[3] = 0.0;
/* external inputs */
Assignment_In1_1 = 0.0;
/* ConstCode for Constant: '<Root>/Constant' */
Assignment_Constant_1[0] = 0.0;
Assignment_Constant_1[1] = 0.0;
Assignment_Constant_1[2] = 0.0;
Assignment_Constant_1[3] = 0.0;
}
示例15: Crane_terminate
/* Model terminate function */
void Crane_terminate(void)
{
/* S-Function Block: <S10>/Block#1 */
{
if (rt_mech_visited_Crane_63fd34a2 == 1) {
_rtMech_PWORK *mechWork = (_rtMech_PWORK *) Crane_DWork.Block1_PWORK;
if (mechWork->mechanism->destroyEngine != NULL) {
(mechWork->mechanism->destroyEngine)(mechWork->mechanism);
}
}
if ((--rt_mech_visited_Crane_63fd34a2) == 0 ) {
rt_mech_visited_loc_Crane_63fd34a2 = 0;
}
}
/* S-Function Block: Crane/Falcon (falcon_block) */
{
t_error result;
result = falcon_close(Crane_DWork.Falcon_Falcon);
if (result < 0) {
msg_get_error_messageA(NULL, result, _rt_error_message, sizeof
(_rt_error_message));
rtmSetErrorStatus(Crane_M, _rt_error_message);
return;
}
}
/* External mode */
rtExtModeShutdown(2);
}