Compute Troubles

The Plc Kid

Member
Join Date
Feb 2009
Location
Macon, Georgia
Posts
3,233
How can I view the values of a compute statement in slc 500 when it is assembled like this?

( I:9.4 | 16383 ) * F58:27 how can I see what the portion in brackets is actual at the moment before it is multiplied by F58:27?
Is there a better way to set this up? Best practice for setting up a compute where you can view values as they are computed?
Is there a way to view this without changing it? Does the processor store this value somewhere accessible before multiply by F58:27
Also on the compute statement what is / ? Is it multiply also? Does not say in slc instruction help but I have seen that in programs before.
 
make a new rung for each task, store the end result in a buffer.
Use that buffer in the new statement.

BTW, you are only allowed 5 questions per day.
 
You're bad, SNK...

There's no limit to the number of questions you can ask.


SNK is right about using a buffer.

The | (usually the shift of "\" -- it's the "pipe" symbol) is division.
 
Trying to fit in a lot of questions before my next class got a little bit of a break today.

Most of the time I have to post quickly between classes and reply back from work.
 
The intermediate result is kept in a processor register or the stack so it is not accessible. If you want to see the intermediate results then use separate DIV and MUL instructions. If you are just debugging then I wouldn't bother with changing the CPT rung, just insert a temporary rung right below it where you do the division again using the DIV instruction and put the result in a convenient temporary address.

For single operations the ADD, SUB, MUL, DIV instructions execute faster than the CPT instruction. However for complex statements a CPT instruction might execute faster because it can skip storing intermediate results in memory and then fetching them again from memory for the next operation.

Also, enter 16383 as 16383.0, that forces the type casting of the constant to a float so that your processor doesn't have to make the conversion every time it performs the division.
 
let's nail this one down ...

the "/" (slash) character means "the address of a BIT follows" ...

for example: "N7:54/8" means "BIT number 8 within the WORD N7:54" ...

the "|" pipe character means "divide" ...

basic idea: they had to use something weird like that for the "divide" symbol because the slash was already used for the bit thing ...
 
Last edited:

Similar Topics

I am trying to add 9 DINT values with the CPT instruction in ControlLogix and I keep getting errors. I am just choosing each tag with an add...
Replies
13
Views
2,316
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,761
I've got a print-out of old code (PLC-5/250) that I am trying to decipher. I am hung up on an expression in one of the compute blocks. The block...
Replies
7
Views
3,065
I have written control logic for several situations recently where I have used a compute statement instead of a PID loop. My statement looks...
Replies
11
Views
3,566
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,166
Back
Top Bottom