SPLat Logo

fAnIn c+ [D>=18]

NOTICE: We are updating our website. For product enquiries and orders please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

fAnIn c+ [D>=18]

W = (analog in c)

Reads analog input channel c as a normalized floating point number.

The analog value is returned in W as a normalized number. That means it is always between 0 and 1, representing a fraction of full scale value. For example, if the analog input range is 0-10V, 5V will give a value of 0.5. The actual number obtained is the closest approximation available given the resolution and accuracy of the analog input. The higher the resolution of the analog input, the closer the approximation will be.

This instruction breaks with our past practice of using letter designations for analog inputs and outputs. Instead we use numeric channel numbers. The correspondence between letter designation and channel number is simply that A=0, B=1, C=2 etc. The analog window in SPLat/PC from V7.18.0 shows both schemes.

Analog I/O using normalized floating point numbers has three advantages:

  1. It handles analog resolution greater than 8 bits. Because the old AnIn and Anout work through X, and X is an 8-bit register, they are limited to 8-bit I/O.
  2. If you write your program using only floating point analog I/O, if and when you switch to a SPLat controller with higher analog resolution, you program will work exactly as before but return higher resolution results.
  3. The instructions can be jndexed.

If you write your program using only floating point analog I/O, if and when you switch to a SPLat controller with higher analog resolution, your program will work exactly as before but return higher resolution results. However, this instruction cannot deliver more analog resolution than the board hardware is capable of. Please see the documentation for your particular board.

The channel number c will be jndexed when executed inside a MultiTrack task and will be indexed if the instruction is preceded by the IasJ: precode.

Dialect exclusions: Not available in dialects before 18

See also AnIn, AnOut, fAnOut