PLC5 CPT error

alan_505

Lifetime Supporting Member
Join Date
Feb 2007
Location
Melbourne,Victoria,Australia
Posts
1,045
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...
Replies
4
Views
1,464
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 =...
Replies
6
Views
1,911
Preface: Kinda long, so I made section titles Intro: I just want to see if anyone here has seen anything similar. A PLC5-40 series C enhanced...
Replies
3
Views
367
Hi, can anyone help me get a pdf file for this RSP files. They are from a PLC5. Thanks
Replies
5
Views
520
Back
Top Bottom