Standard library for IOs scaling

Hi,

We are using different X20 IO modules, including digital inputs/outputs, 4–20mA analog inputs on X20AI4622 modules, and PT1000 RTDs on X20AT4222 modules.

At the moment, I am handling the IOs in Structured Text. For analog inputs, I am scaling the raw values to engineering units in code.

This is working, but I assume this is a common requirement across B&R projects, so I wanted to check whether there is already an existing library, function block, or recommended standard approach before developing our own solution.

Could you please advise:

  1. For analog inputs, is there a recommended B&R library or function block for scaling raw values to engineering units?
  2. Can scaling or engineering limits be configured directly in the IO module settings in Automation Studio, or is this normally handled in code?
  3. Do you have any best-practice reference for handling X20 IO scaling, especially for 4–20mA transmitters and PT1000 temperature inputs?

For reference, we are using Automation Studio V6.5.3.11, AR 6.5.1, and a redundant X20CP3686X CPU pair.

Thanks
Aditya

MTLookUpTable FB can do this easily.
MTLookUpTable

Might be a bit overkill but that is what I like to use if I don’t want to create a custom FB.

  1. You can configure the out of range limits in the IO module settings, but not the actual scaling or engineering units.

Hello,

You can check the awesome-B-R GitHub, especially the Hammers library.

Thanks mate. I can’t use a third-party library due to client requirements/instructions, but it gave me a good idea of how to build my own scaling library.