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?
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.
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.
@mariuslucianand I tried your solution but when I went on running the PIL I got the attached error. I am using Simulink 2018b.
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".
The measured values looks like this:
Hope this helps,
Marius