The + operator only works on numeric arguments

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

The + operator only works on numeric arguments

1,913 次查看
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 回复数

1,839 次查看
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 项奖励
回复

1,850 次查看
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 项奖励
回复

1,881 次查看
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 项奖励
回复

1,897 次查看
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 项奖励
回复

1,865 次查看
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 项奖励
回复