Objective: scale an analog input of the RevPi AIO in PiCtory so that the process image contains the measured distance in millimeters instead of the voltage or current value.

The example uses a measuring range of 30 to 300 mm. It shows the scaling both for a voltage signal of 0 … 10 V and for a current signal of 4 … 20 mA.

This tutorial applies to the following base modules:

Prerequisites #

Devices

✓ RevPi AIO

✓ Analog sensor with an output signal of 0 … 10 V or 4 … 20 mA.

Hardware Installation

✓ RevPi base module and RevPi AIO are connected via the PiBridge.

✓ RevPi base module and RevPi AIO are connected to the power supply.

Software Installation

✓ RevPi Bookworm or higher is installed on the RevPi.

✓ Web browser on your PC (e.g. Chrome, Firefox or Edge).

✓ There is a network connection between the RevPi and your PC.

1. Defining the Measured Value Range #

▷ Check the data sheet of your sensor to see whether it outputs a voltage signal of 0 … 10 V or a current signal of 4 … 20 mA.

▷ Check which measured values correspond to the two signal limits.

  • Voltage Measurement

  • Current Measurement

Measured distance Signal limit

30 mm

0 V

300 mm

10 V

Measured distance Signal limit

30 mm

4 mA

300 mm

20 mA

The RevPi AIO calculates the scaled value using the following formula.
X is the input value in mV or µA, Y the distance in mm:

\[Y = \frac{\mathrm{Multiplier}}{\mathrm{Divisor}} \cdot X + \mathrm{Offset}\]

2. Connecting the Sensor and Setting up the Scaling #

Caution
Damage to the device due to installation under voltage supply

While the RevPi device is connected to a power source, no other devices may be connected or disconnected, as this may cause damage to the devices.

▷ Do not connect the power supply until all other devices are connected correctly.

▷ Switch off the power supply before disconnecting a device from the system.

▷ Drag the RevPi base module from the Device Catalog to the empty slot in the configuration area with position number 0.

▷ Drag the RevPi AIO from the Device Catalog to the left of the base module.

▷ Select the RevPi AIO in the configuration area.

  • Voltage Measurement

  • Current Measurement

▷ With the power supply switched off, connect the sensor to input 1.
See also pinout:

Pin Connector

28

Signal + of the sensor

24

Signal − (ground) of the sensor

26

Not assigned, no wire jumper

Caution
Incorrect measured values or damage due to wire jumper during voltage measurement

With a wire jumper between pin 26 and pin 28, the input measures via the internal shunt. This puts a heavy load on the sensor output.

▷ Do not set a wire jumper between pin 26 and pin 28 for voltage measurements.

▷ For input 1, select the value 0 … 10 V under Input1Range.

▷ Enter the example values for input 1:

  • Input1Multiplier = 270

  • Input1Divisor = 10000

  • Input1Offset = 30

For the voltage measurement, this results in:

\[Y = \frac{270}{10000} \cdot X + 30\]

❯ The process image contains the measured distance in millimeters, e.g. 0 V → 30 mm, 5 V → 165 mm, 10 V → 300 mm.

▷ With the power supply switched off, connect the sensor to input 1.
See also pinout:

Pin Connector

28

Signal + of the sensor

24

Signal − of the sensor

26

Wire jumper to pin 28 (shunt)

The wire jumper connects the internal shunt. The input measures the current via the voltage drop across the shunt. Without a wire jumper, no current flows and the input does not deliver a valid value.

Note

A passive 2-wire sensor additionally requires a voltage supply in the circuit. Refer to the data sheet of the sensor.

▷ For input 1, select the value 4 … 20 mA under Input1Range.

▷ Enter the example values for input 1:

  • Input1Multiplier = 270

  • Input1Divisor = 16000

  • Input1Offset = -38

For the current measurement, this results in:

\[Y = \frac{270}{16000} \cdot X - 38\]

❯ The process image contains an integer value for the measured distance in millimeters. For positive results, the RevPi AIO truncates decimal places. The calculated offset of -37.5 can only be entered as an integer. The displayed value can therefore deviate from the ideal value.

3. Saving the Configuration #

▷ Select File › Save as Start-Config. to save the configuration.

▷ Select Tools › Reset driver to apply the configuration.

❯❯ The RevPi AIO provides the scaled values in the process image.

Further Resources #