Hello

Im trying to compile the following code but I get the error "left operand has incompatible type" because of the line:

test2_2_U->Out2= test2_2_U->Out3;

I have been looking through the forum but I couldnt find a hint what Im doing wrong. Any hint is appreciated.

Thanks Thomas

static BlockIO_test2_2 test2_2_B;      /* Observable signals */
static D_Work_test2_2 test2_2_DWork;   /* Observable states */
static ExternalInputs_test2_2 test2_2_U;/* External inputs */
static ExternalOutputs_test2_2 test2_2_Y;/* External outputs */

void rt_OneStep(RT_MODEL_test2_2 *test2_2_M)
{
 
 test2_2_step(&test2_2_B, &test2_2_DWork, &test2_2_U, &test2_2_Y);
 test2_2_Y->Out2=  test2_2_Y->Out3;

}

where test2_2_U is defined as:

66   typedef struct {
   67     real_T Out1_f;                       /* '<Root>/Out1' */
   68     real_T Out2;                         /* '<Root>/Out2' */
   69     real_T Out3;                         /* '<Root>/Out3' */
   70     real_T Out4;                         /* '<Root>/Out4' */
   71   } ExternalOutputs_test2_2;
   72

Edited 7 Years Ago by agentmusic: n/a

its defined as:

test2_2_Y->Out2 = 0.0;
  test2_2_Y->Out3 = 0.0;

Edited 7 Years Ago by agentmusic: n/a

You misunderstand. It's -- static ExternalInputs_test2_2 test2_2_U; For non-pointers you use the . operator. Not ->. Try replacing -> with .

You misunderstand. It's -- static ExternalInputs_test2_2 test2_2_U; For non-pointers you use the . operator. Not ->. Try replacing -> with .

Thanks so much! That helped

This article has been dead for over six months. Start a new discussion instead.