0% found this document useful (0 votes)
196 views2 pages

Siemens Scale X

The Scale instruction scales a value at the VALUE input to a specified range defined by the MIN and MAX parameters. It works by taking the VALUE, multiplying it by the difference between MAX and MIN, adding MIN, and storing the integer result in the OUT output. ENO is set to 0 if errors occur such as MIN being greater than or equal to MAX, VALUE being outside the normalized floating-point range, or overflow. The instruction scales the VALUE proportionally within the defined MIN-MAX range.

Uploaded by

Rudimar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views2 pages

Siemens Scale X

The Scale instruction scales a value at the VALUE input to a specified range defined by the MIN and MAX parameters. It works by taking the VALUE, multiplying it by the difference between MAX and MIN, adding MIN, and storing the integer result in the OUT output. ENO is set to 0 if errors occur such as MIN being greater than or equal to MAX, VALUE being outside the normalized floating-point range, or overflow. The instruction scales the VALUE proportionally within the defined MIN-MAX range.

Uploaded by

Rudimar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SCALE_X: Scale (S7-1200, S7-1500) Página 1 de 2

SCALE_X: Scale

Description

You can use the "Scale" instruction to scale the value at the VALUE input by mapping it to a specified value
range. When the "Scale" instruction is executed, the floating-point value at the VALUE input is scaled to the
value range that was defined by the MIN and MAX parameters. The result of the scaling is an integer, which is
stored in the OUT output.

The following figure shows an example of how values can be scaled:

The "Scale" instruction works with the following equation:

OUT = [VALUE ∗ (MAX – MIN)] + MIN

Enable output ENO has signal state "0" if one of the following conditions applies:

Enable input EN has signal state "0".

The value at the MIN input is greater than or equal to the value at the MAX input.

The value of a specified floating-point number is outside the range of the normalized numbers according
to IEEE-754.

An overflow occurs.

The value at the VALUE input is NaN (Not a Number = result of an invalid arithmetic operation).

Note
For more information on the converting of analog values, refer to the respective manual.

Parameters

The following table shows the parameters of the "Scale" instruction:

Parameter Declaration Data type Memory area Description

EN Input BOOL I, Q, M, D, L Enable input

mk:@MSITStore:C:\Program%20Files%20(x86)\SIEMENS\Automation\Portal%20V... 27/07/2020
SCALE_X: Scale (S7-1200, S7-1500) Página 2 de 2

ENO Output BOOL I, Q, M, D, L Enable output

MIN Input Integers, floating- I, Q, M, D, L or Low limit of the value range


point numbers constant

VALUE Input Floating-point I, Q, M, D, L or Value to be scaled.


numbers constant
If you enter a constant, you
must declare it.

MAX Input Integers, floating- I, Q, M, D, L or High limit of the value range


point numbers constant

OUT Output Integers, floating- I, Q, M, D, L Result of scaling


point numbers

You can select the data types of the instruction from the "???" drop-down lists of the instruction box.

You can find additional information on valid data types under "See also".

For additional information on declaring constants, refer to "See also".

Example

The following example shows how the instruction works:

The following table shows how the instruction works using specific operand values:

Parameter Operand Value

MIN Tag_MIN 10

VALUE Tag_Value 0.5

MAX Tag_MAX 30

OUT Tag_Result 20

If the "TagIn" operand has signal state "1", the instruction is executed. The value at the "Tag_Value" input is
scaled to the range of values defined by the values at the "Tag_MIN" and "Tag_MAX" inputs. The result is
stored in the "Tag_Result" output. If the instruction is executed without errors, the ENO enable output has
signal state "1" and the "TagOut" output is set.

mk:@MSITStore:C:\Program%20Files%20(x86)\SIEMENS\Automation\Portal%20V... 27/07/2020

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy