Back to tutorials
PLC Instructions

PLC Programming Advanced Mathematical Instructions – SCP | Scale With Parameters

By
Vladimir Romanov
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

Back to tutorials

Related Tutorials

Beginner

Limit Switch - What it is, How it works & How it is used in Manufacturing

A limit switch is an electro-mechanical device used to send an electrical signal based on a physical interaction. Limit Switches are used to detect the presence of objects, thus allowing the system to take desired action.

By
Vladimir Romanov
Intermediate

MicroLogix 1100 RSLogix 500 External IO PLC Programming Tutorial

The MicroLogix 1100 PLC is still heavily used in the industry and is one of the most recommended PLCs for learning PLC programming. The MicroLogix 1100 PLC is compact, offers a variety of I/O configurations and is inexpensive relative to other Rockwell options. Furthermore, the MicroLogix 1100 PLC is programmable using the free version of RSLogix 500 that can be downloaded from the official Rockwell website.

By
Vladimir Romanov
Beginner

PLC Simulator - PLC Programming & Testing within a Simulated Environment

A PLC Simulator is an excellent avenue to practice PLC ladder logic programming. Although the software environment is not the perfect substitute for hands on experience on an actual PLC, the simulation delivers a very accurate representation of ladder logic execution.

By
Vladimir Romanov