Skip to content

Analog Inputs

Version: develop

The ReliaIO package provides also a Driver to manage the analog inputs. It can be installed following the usual instructions for instantiating Drivers.

ReliaIOAnalogDriver

Once installed, the driver should be configured with the ReliaIO model name:

ReliaIODriverConfig

The corresponding asset can be configured as follows:

  • enabled: it allows to enable/disable the channel. If it isn't selected the channel will be ignored.
  • name: the channel name.
  • type: the channel type, (READ, WRITE, or READ_WRITE).
  • value.type: the Java type of the channel value. The value read by the Driver will be converted to the value.type. Conversely, in write operations the Driver will accept value of this kind.
  • scale: an optional scaling factor to be applied only to the numeric values retrieved from the field. It is represented as a double and if the value.type is, for example, an integer, the scaling factor multiplier will be casted to integer before multiplying it to the retrieved value.
  • offset: an optional offset value that will be added only to the numeric values retrieved from the field. It is a double in the asset definition, and will be casted to the value.type of the retrieved value before being applied.
  • unit: an optional string value that will be added to the asset channel read to represent the unit of measure associated to that specific channel.
  • listen: it is not supported for this kind of channel. Selecting it has no effect.
  • resource.name: the name of the analog ports. They can be:
    • RIO_AIN1: ADC analog input 1
    • RIO_AIN2: ADC analog input 2
    • RIO_AIN3: ADC analog input 3
    • RIO_AIN4: ADC analog input 4
    • RIO_ADC_CAL: ADC calibration data corresponding to a fixed 2.5V
    • RIO_RAW_TEMP: raw value of the temperature sensor
    • RIO_RAW_VDD: raw value of the VDD voltage monitor
    • RIO_CONV_CHANNELS: number of channels converted (normally 7)
    • RIO_TEMP: corrected value of the temperature sensor in °C
    • RIO_VDD: corrected value of the VDD voltage monitor in mV
  • read.mode: RAW or SCALED read modality.

The read.mode parameter sets how the ADC read has to be reported. If set to RAW the integer output of the ADC is emitted. Conversely, if the SCALED options is set, the output of ADC is scaled using a function whose parameters depend on the ReliaIO model. The read.mode parameter is applied only for RIO_AIN1 to 4. For the others channels, it has no effect.

REIO-10-12-01

The ReliaIO REIO-10-12-01 model is equipped with four 0 to 36V Voltage Inputs corresponding to the RIO_AIN1 to 4. If the read.mode parameter is set to SCALED, the following function is applied to the ADC output:

\[V_{in}[mV] = {ADC_{count} \times {RIO\_VDD \over 4095} \times 12} = {ADC_{count} \times 9.67mV}\]

The voltage monitor RIO_VDD is acquired at each ADC read.

REIO-10-12-02

The ReliaIO REIO-10-12-02 model is equipped with four 4 to 20mA Current Loop Inputs corresponding to the RIO_AIN1 to 4. If the read.mode parameter is set to SCALED, the following function is applied to the ADC output:

\[I_{in}[mA] = {ADC_{count} \times {RIO\_VDD \over 4095} \times {1 \over 150}} = {ADC_{count} \times 5.37 \mu A}\]

The voltage monitor RIO_VDD is acquired at each ADC read.

How to use RAW outputs

The RAW mode is used to emit the integer ADC outputs without any modification. The scaled value can be computed using an external component, as the script filter. The user can apply the same function presented in the section above or use the RIO_ADC_CAL instead of the RIO_VDD to obtain the corrected value. In the latter case the function to be applied is:

\[V_{in}[mV] = {2.5 \over RIO\_ADC\_CAL} \times ADC_{count} \times 12\]

for the REIO-10-12-01 or

\[I_{in}[mA] = {2.5 \over RIO\_ADC\_CAL} \times {ADC_{count} \over 150}\]

for the REIO-10-12-02.