boardSetAIResolution (Function)

Top  Previous  Next

Architecture:

X32/ NX32 / NX32L

Device support:

MX2 turbo/encore/warp, AX9i series, DX4i pro, AX9 turbo/encore, NX-200, NX-400, NX-900, NX-910, LX2, LX4, LX5

Firmware version:

4.00 / 1.00.00


The analog input sampling logic can work at multiple resolutions to fit different needs.

The default resolution is 10 bit.

When increasing the resolution from 10 to 12 bit, the range of the analog input values change from 0..1023 to 0..4095.

 

 

Input:

res : int (10,12)

Selects the resolution for the analog input sampling.
 

Returns: INT

0

Successful.

1

Not supported.

 

Declaration:

FUNCTION boardSetAIResolution : INT;
VAR_INPUT
  res : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
// Selects 12 bit sampling:
boardSetAIResolution(res := 12);
 
BEGIN
END;
END_PROGRAM;