RSLogix 500 Question

RBergmann

Member
Join Date
Jun 2002
Location
California
Posts
258
Been working on some older programs written with RSLogix 500 and note that the CPT (compute) function is used for scaling data to engineering rather than the SCP (scaling) function.

I've also seen the CPT function used in lieu of MOV.

Any reason for this that I'm not seeing? AB is only one of the PLCs lines I work with and perhaps my lack of AB experience is showing.
 
SCP is hard to beat for scaling. Seems like a mis-application for a MOV.

SCP wasn't always around so older programs or older programmers may be stuck in their thinking and use the CPT block for scaling.

For using it to do a MOV, my best guess is a computer science person wrote the program and they never had an assembler class and they found the CPT function before they found the MOV function...

All just guesses though
 
Last edited:
SCP is hard to beat for scaling. Seems like a mis-application for a MOV.

SCP wasn't always around so older programs or older programmers may be stuck in their thinking and use the CPT block for scaling.

For using it to do a MOV, my best guess is a computer science person wrote the program and they never had an assembler class and they found the CPT function before they found the MOV function...

All just guesses though
Thanks, Norm ...

Kinda confirmed my suspicions. Good to hear from my old stomping grounds.
 
everything else being equal (it seldom is) a properly written CPT would take up less CPU processing time than an SCP ...

each and every time that the processor executes an SCP instruction, the CPU is forced to perform the entire y=mx+b equation ... specifically, it has to do all of the math for the intermediate steps required for the "slope" and the "offset" in order to do the scaling operation ... even if the slope and the offset never change, they still have to be calculated - and recalculated - each and every scan ... this takes up scan time ...

on the other hand, if the programmer is willing to solve those intermediate math steps "up front" then the CPT is able to get exactly the same results as the SCP - while doing a lot less repetitive arithmetic - and the program will have a shorter scan time ...

in most cases, a CPT can get the scaling done with just one multiplication step - and one addition step ... this is MUCH less math than what goes on "under the hood" of the SCP instruction ...

in most situations, the amount of scan time saved won't amount to a hill of beans - so most programmers will just use the SCP and get on with their lives ... in other (usually high speed) applications, every microsecond shaved off of the scan cycle is worth the extra effort required to do as much of the math "up front" as possible ...
 
Last edited:

Similar Topics

Hi all, I'm using a Micrologix 1400 PLC. I have 8 physical DI's, 4 DO, 4 AI's that will be radio transmitted to a DCS Master. The DCS is a Bailey...
Replies
8
Views
9,386
We recently had an issue with one of our systems. I was trying to trouble shoot from RsLogix, however I dont have the original logic file, so...
Replies
2
Views
1,284
I've done a few AB projects, but have not seen either of the following in a MOV instruction (I can't figure how to take a "snippet" and insert). I...
Replies
9
Views
3,283
when your pointer gets indexed, if your previous reference is true, and your current reference is true before getting indexed, will the...
Replies
13
Views
5,472
Hi I deal with the micrologix series of PLCs on a weekly basis from the maintenance and operations side so thought I might have look whats going...
Replies
3
Views
1,773
Back
Top Bottom