The + operator only works on numeric arguments

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The + operator only works on numeric arguments

1,310 Views
Dina_ayoub
Contributor II

   I am using the input capture unit in the eTimer example (Simulink Model based) to output the frequency and duty cycle value of a FlexPWM signal, the model is successfully built and the outputs are correct, BUT when I try performing PIL I always get this error ("The + operator only works on numeric arguments") related to a .tlc file.
Does anyone know how to fix it?

5 Replies

1,236 Views
Gerhold
Contributor I

The & , ^ , | , << , >> and % operators only work on numbers. The arguments to the following operators both must be either Number or Real: < , <= , > , >= , - , * , / . This can also happen when using + as an unary operator. In addition, the FORMAT built-in function expects either a Number or Real argument.

 

jcp kiosk

0 Kudos

1,247 Views
Gerhold
Contributor I

The & , ^ , | , << , >> and % operators only work on numbers. The arguments to the following operators both must be either Number or Real: < , <= , > , >= , - , * , / . This can also happen when using + as an unary operator. In addition, the FORMAT built-in function expects either a Number or Real argument.

0 Kudos

1,278 Views
Dina_ayoub
Contributor II

@mariuslucianand  I tried your solution but when I went on running the PIL I got the attached  error. I am using Simulink 2018b.

0 Kudos

1,294 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Dina_ayoub 

Thanks to @paulvlase the fix is pretty simple.

You have to go to the capture subsystem, right click on it, select "Block Parameters" and under "Code generation" you have to select the Function packaging as  "Nonreusable function".

mariuslucianand_0-1612370517737.png

The measured values looks like this:

mariuslucianand_1-1612370548349.png

Hope this helps,

Marius

0 Kudos

1,262 Views
Dina_ayoub
Contributor II

  I tried your solution but when I went on running the PIL I got the attached  error. I am using Simulink 2018b, NXP_MBDToolbox_MPC57xx version 3.2.0

0 Kudos