Compute Instruction Error

MasterBlaster

Lifetime Supporting Member
Join Date
Aug 2005
Location
Solano County, CA
Posts
216
What am I missing? Why will my CLX Processor not buy this formula?

=((448.83)*(3.33*(2-0.2*(Lagoon_Flow_Depth/12))*(Lagoon_Flow_Depth/12)^(3/2)))

I get the error "CPT Operand 1: Invalid expression or tag".

The only tag involved is the Lagoon_Flow_Depth, which is data type REAL.

The expression runs fine in Excel, substituting the cell for the tag name.

Thanks in advance,

Bill
 
Last edited:
Probbaly because you're using the bit delimiter "/" as a divide instruction when A/B machines use the pipe symbol "|" for divide within CPT instructions. This has bitten me several times...

EDIT: with Logix 5 and 500 the above is true, but the "/" works with 5000. I think it's your "^" symbol it doesn't like. Try "**" instead...
 
Last edited:
Probbaly because you're using the bit delimiter "/" as a divide instruction when A/B machines use the pipe symbol "|" for divide within CPT instructions. This has bitten me several times...

EDIT: with Logix 5 and 500 the above is true, but the "/" works with 5000. I think it's your "^" symbol it doesn't like. Try "**" instead...

Thanks, Okie. This is in 5000. I caught the ^ and changed it to **, but the error persists.
 
Without having access to equipment to try this on right now, perhaps the easiest thing to do (what I would do...) would be to start building the calculation one "phrase" at a time, building on it until it "breaks". Then you'll know exactly which step broke and we can help fix it.
 
I was testing while Okie was answering ... it works in my system when using ** instead of ^ ...

a depth of 7.7 gives a result of 1437.8671 ... is that what you're expecting? ...

lagoon_flow.JPG
 
Last edited:
Master Blaster in post 1, I see an = as the first instruction
I wonder if this is an issue that works in Excel but not Logix 5000
as the destination is the =
 
Last edited:
Master Blaster in post 1, I see an = as the first instruction
I wonder if this is an issue that works in Excel but not Logix 5000
as the destination is the =


Frustrated, I decided to call it a day. I think I tried it both ways, but will do it again tomorrow to be sure.

Bill
 
Master Blaster in post 1, I see an = as the first instruction
I wonder if this is an issue that works in Excel but not Logix 5000
as the destination is the =

Good eye, Gil47!! I owe you an adult beverage of your choice. Eliminating the equal sign did the trick (I couldn't stand not being sure, so I RDC'd into the Plant and tried again).

Thanks to all for you input.

Bill
 
Your quote
I get the error "CPT Operand 1: Invalid expression or tag".

The words "operand 1" made me suspicious and then the first operand was an =

Then when I saw that it was not in Rons post, Thats was when I posted
 
Your quote
I get the error "CPT Operand 1: Invalid expression or tag".

The words "operand 1" made me suspicious and then the first operand was an =

Then when I saw that it was not in Rons post, Thats was when I posted

Comparison with Ron's post is what drove me to SSH into the Plant and try it last night - I was fairly certain you were onto the problem.

Now, wouldn't you think that if the parsing routine knew that the equal sign was the problem, it would either say so or simply delete it? I'm probably not the first guy to get bit by copying a formula from Excel to Logix like that.

Thanks again for the help, everyone.

Bill
 
when you first posted, your formula was all scrambled in some sort of "graphics gone wild" nightmare ...

then when you almost immediately edited it, I assumed (gosh, I hate that word) that the equal sign was just "left over" from the original attempt at an image ... I didn't realize that you were actually leaving the equal sign as part of the expression ...

and just a tip: I always type my expressions into Notepad – and then Copy-and-Paste them into RSLogix5000 ... that way I can expand the window (and control the font) enough to see what's really going on ... same thing for Looooooooonnnnnnnnngggggggg tagnames too ... on many screens they only give you a tiny "peephole" entry zone to type into – and there's no way to see the whole string at one time ...

glad you got it working ...

 

Similar Topics

I am using a legacy Allen Bradley PLC5/40E Series F CPU Having issue with compute instruction syntax with the expression Doing a divide by...
Replies
7
Views
1,775
PLC: Compact Logic 1100 series b RS Logix 500: version 8.40 Issue: No compute Instruction, it is greyed out and I can't use it. Why? Thanks
Replies
6
Views
2,176
How can i get (N7:31 * 6 / 5) to work in compute instruction? This is very annoying. I know i am missing something?? Please help. Thanks, Ven
Replies
6
Views
2,244
I am using a slc 500/03. while writing the instructions for the running average, one of the last rungs had a "compute" instruction for dividing. I...
Replies
4
Views
2,254
What the formula will look like? Assuming that all of the 3 Pumps running time (in Minutes) are stored in N7: 1 / N7: 2 and N7: 3. How would you...
Replies
4
Views
4,575
Back
Top Bottom