CPT Instruction

roxusa

Lifetime Supporting Member
Join Date
Nov 2008
Location
NJ
Posts
994
What is the symbol for divide used in a CPT Instruction

Expressions - The expression is zero or more lines, with up to 28 characters per line, up to 255 characters. Instructions that can be used in the Expression include: +, -, *, l (DIV), SQR, - (NEG), NOT, XOR, OR, AND, TOD, FRD, LN, TAN, ABS, DEG, RAD, SIN, COS, ATN, ASN, ACS, LOG, and ** (XPY). The execution of a CPT instruction is longer than a single arithmetic operation and uses more instruction words.

l (DIV) I cant make out what this is, Thanks
 
Maybe what I should be asking is how to find the average of a group of integers.
I was going to use a CPT
 
Maybe what I should be asking is how to find the average of a group of integers.
I was going to use a CPT

CPT would do for LAD programming; FBD (Function Block Diagram) and ST (Structured Text) languages support the MAVE (Moving Average) instruction.
 
Last edited:
Roxusa, what type processor are you using? The Logix based processors have an average (AVE) instruction.
 
Watch out for overflows with adding a bunch of integers together. The highest value you can have for your sum is 32767. If your sum exceeds that, you'll need a different solution.


edit to add:
Didn't realize the thread was quite that old...
 

Similar Topics

I have ran into something I have not seen before and wondering if any one had any ideas. The logic I'm currently troubleshooting is using a...
Replies
3
Views
1,660
Needing help with this, keep getting an error...
Replies
16
Views
4,947
Hey Everyone I was wanting to get some advise on the math below on this expression for a SCP instruction...
Replies
17
Views
5,236
I am trying to add 15 items together using a cpt instruction in logix5000. All of the items are in the same array is there a way i can type in the...
Replies
4
Views
2,235
I am currently converting a PLC5 over to a Compactlgx. I have the logic converted, am in the middle of making all my new tags and have made some...
Replies
9
Views
2,652
Back
Top Bottom