PLC5 CPT error

I am using the following formula 1709550411241.png and I am getting error, Invalid Expression - too many closing parenthesis.
when i copy the formula to notepad or word I cannot see that my brackets don't match, so I cannot figure out why it will not compile.

Any and all help appreciated.

The formula is in TechNote BF19665, Digital filtering of an analog signal in code.
 
You have two errors.

The immediate one giving you the message is that you need a * between N17:98 and (N17:99-1), RSlogix 5 does not support implied multiplication in that fashion.

The second is that the operator for division is |, not /
 
Not sure what the result of the CPT is used for, but usually any math that involves division, your result would be better served using a float. Due to order of operations and the values of your integers, your CPT could exceed the limit of an Integer in the PLC5, and your result wouldn't be what you expect. If you need the final result as an integer, CPT to a real first, then convert that value to an INT.
 

Similar Topics

Hey guys, Wondering if any of you could tell me why this is not a valid expression in PLC5/40 ((N38:73 / N38:20) * 1440) / 100 Destination is...
4
Replies
2,163
Views
Can someone please explain why these 2 CPT instructions in a PLC5 would evaluate differently? F239:1 = (N49:13 * 3000.0) | 4095.0 F239:1 =...
6
Replies
2,691
Views
Hey everyone, I'm on a commissioning currently working on a project involving a PLC5/40C and I'm in need of access to RSLogix 5. I understand the...
12
Replies
701
Views
So ya our plant is weighing upgrading photoeyes on a conveyor system of about 30 motors to better distinguish product , very limited upgrade...
34
Replies
1,589
Views
Just did a conversion of a PB32 project to CCW using a PanelView800, setting up serial DF1 (only choice of processor was ML1400) after the project...
3
Replies
283
Views
Top