Author Topic: Issue with Scale  (Read 755 times)

Offline samuelhj

  • PLUS+1 Developer
  • ***
  • Posts: 24
  • Karma: +1/-0
Issue with Scale
« on: March 22, 2025, 12:37:43 AM »
Hello.

I ran into an interesting issue today.

While using the scale function in Guide, if the input is out of the minimum value, or the max value, the output becomes undefined.
Took me a while to figure out what was going on. This is not mentioned in the documentation as far as I can see.

For a solution to this problem I did the following (see attached screenshot)

Offline BRIan

  • PLUS+1 Expert
  • ****
  • Posts: 64
  • Karma: +3/-0
Re: Issue with Scale
« Reply #1 on: March 24, 2025, 03:25:58 AM »
I always use capped components then you get sensible results.

Offline Tor

  • Administrator
  • PLUS+1 Guru
  • *
  • Posts: 311
  • Karma: +28/-1
Re: Issue with Scale
« Reply #2 on: March 24, 2025, 07:56:39 AM »
Hello,

If you use the regular Scale component it's important to understand that the values you enter are not end points, the line keeps going in both directions (see image ScaleLine.png).
In the user manual for the Scale component you can read that the values (A2 - A5) do not limit the resulting output value (see image ScaleComponent.png). The risk of an overflow is imminent if you don't know what kind of signal you have.

And as BRIan pointed out, a capped component will solve this. On the capped component the output value is clamped to Max or Min value in case of an overflow (see image ScaleCappedComponent.png)

All the images and examples can be found in the component user manual.
To find the Online User Manual for the component, mark the component in the component tree and press F1 on the keyboard, or Query the component in the drawing area and click the question mark in the top right corner.


Have a nice day.
« Last Edit: March 24, 2025, 08:11:23 AM by Tor »
Best regards,
Tor
PLUS+1® SW PAE Team

Offline G30RG3

  • PLUS+1 Expert
  • ****
  • Posts: 78
  • Karma: +3/-0
Re: Issue with Scale
« Reply #3 on: March 24, 2025, 08:40:01 AM »
It is easier to use a limit - median value, either on the input (preferred) or the output side.
« Last Edit: March 24, 2025, 08:59:33 AM by G30RG3 »

Offline samuelhj

  • PLUS+1 Developer
  • ***
  • Posts: 24
  • Karma: +1/-0
Re: Issue with Scale
« Reply #4 on: March 26, 2025, 12:27:23 AM »
Thank you all for your input, looks like I've fallen into the trap of assuming it was similar to some other PLC software. I guess I missed the part in the documentation where this is mentioned. Thanks.