5.1.5. Analogue input — basic (pai_BasicAnalogInput)

Read an analogue input channel and convert to a voltage.

5.1.5.1. Supported targets

All targets

5.1.5.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.5.3. Description

This block reads a physical analogue channel identified to obtain a raw input value when run on target hardware. When run in simulation, the block instead takes the value on its inport as its raw value.

A raw value is the number obtained from the analogue-to-digital converter in the ECU device scaled as if it had 10-bit resolution, such that 0 indicates the reference ground (0 V), -1023 indicates the lower reference voltage (-5V) and 1023 indicates the upper reference voltage (5V).

Note

The worst case conversion time for all analogue-to-digital values is ~500μs. Thus, when the software asks for an analogue-to-digital conversion, the analogue-to-digital value may be up to 500μs old.

Note

Once read, the [-5, 5]V range must be scaled by the application to the range indicated in the technical specification for the selected target.

5.1.5.4. Inports

  • sim_adc

    Only used under simulation when the parameter Provide simulation input? is ticked. The outport voltage is written to the value of this inport scaled from A/D counts to a voltage.

    Range: [-1023, 1023] A/D counts

    Value type:Real

5.1.5.5. Outports

  • voltage

    The raw input reading converted to a voltage assuming the input range is -5V to 5V. The outport must then be scaled by the application to the range given for the channel in the target's technical specification.

    Range: [-5, 5] volts

    Value type:Real

5.1.5.6. Mask parameters

  • Channel

    The channel pin for this analogue input.

    Value type:List
    Calibratable:No
  • Sample time

    The periodicity of the block execution.

    Range: [0.001, 3600] seconds

    Value type:Real
    Calibratable:No
  • Provide simulation input?

    Tick to enable inport sim_adc.

    Value type:Boolean
    Calibratable:No

5.1.5.7. Notes

None.