Contents
Intermediate

PLC Programming Advanced Mathematical Instructions – SCP | Scale With Parameters

By
Vladimir Romanov
|
March 5, 2019
Table of Contents

Introduction

The SCP, also known as the scale with parameters, is an instruction which is commonly used for working with analog signals. It’s an instruction which can be utilized in ladder logic as well as function blocks. The instruction will take input, use input minimum & maximums parameters as well as outputs min/max parameters and convert the output scaling based on them.

The primary reason as to why you’d want to utilize this instruction is the fact that analog data will typically be meaningless as it comes into the Programmable Logic Controller or Input Card. The reason being is that the 4-20mA or 0 to 10 VDC signal is generally scaled to the largest scale. On an RSLogix 500 based PLC, this is typically 16

The CPT, also known as the compute, is an instruction which has extensive capabilities when it comes to mathematical and logic functions in ladder logic. This instruction allows the user to input a complex string of instructions composed of computational, operational and comparison functions and computes the result which is stored in the specified register. The instruction will work with operands used in the based instructions as well as many others.

The CPT instruction has many advantages as well as drawbacks. Based on personal experience, you should only use this instruction if absolutely necessary and the same could not be achieved with several basic instructions. In other words, you can compute an ADD instruction through the CPT, but you shouldn’t.

The drawbacks come from the fact that it’s not easy to see what’s going on with the logic within this particular instruction. Multiple operands interact with each other which leads to a confusing execution and inability to troubleshoot or tweak when needed.

Example & Usage of SCP

An SCP is composed of the following registers:

  • Input
  • Input Min
  • Input Max
  • Output
  • Output Min
  • Output Max

Each one of the registers is either an INT or a REAL value.

The input is the value which will be processed by the instruction. The limits will dictate the lowest and the highest values which can be seen through the input register. Do note that the instruction will allow negative values and will scale them accordingly.

The next two values specified within the instruction are the scaled parameters on the outputs side. These values will dictate the transformation applied to the input & imply the upper and lower limits of the output signal produced by the SCP.

The outputs of the instruction is a single integer or floating point value which is the transformation of the input. It can be used within the PLC logic just like any other register.

PLC SCP Instruction - Scale With Parameters RSLogix 500 Example for Analog Inputs Programming RSLogix 500

Data Types Allowed for SCL

The SCL take an input, output as well as four parameters. It’s highly recommended to use integers for the parameters for easier conversions, but they can be specified as floats as well.

  • Integer – You may specify each operand to be of “Integer” type.
  • Float – You may specify each operand to be of “Float” type.

Video Tutorial

Got a question or comment?

Related Tutorials

Beginner

Photo Eye Sensor | How to Wire a Photoelectric Sensor into a CompactLogix Allen Bradley PLC

Learn how to work with photoelectric sensors, understand the basics, how to wire them, how to tie them into various PLCs and field devices and lastly how to troubleshoot them.

April 24, 2020
|
By
Vladimir Romanov
Beginner

PLC Programming | How to Read Ladder Logic

Learn the basics of Ladder Logic, one of the top 5 most popular types of PLC programming languages used in manufacturing environments.

April 7, 2020
|
By
Vladimir Romanov
Beginner

Ladder Logic Symbols | PLC Programming in RSLogix 5000 Studio Allen Bradley

A step-by-step introduction to Ladder Logic symbols. Ladder Logic symbols are foundational elements that are memorized by every plc programmer. They’re essential to know if you plan to do any work with this PLC programming language.

April 8, 2020
|
By
Vladimir Romanov