Scale and offset are useful for converting the DMA FIFO value (DFV) to a usable value that corresponds to a real-world measurement.

The following table displays equations that show how scale and offset convert DFV to voltage value (VV) for read channels of different data types, and VV to DFV for write channels of different data types.

Data type Read or Write Equation

I8, U8, I16, U16, I32, U32, I64, U64, Boolean

Read

V V = [ D F V × ( scale ÷ P ) + offset ]

I8, U8, I16, U16, I32, U32, I64, U64, Boolean

Write

D F V = ( V V offset ) × ( P ÷ scale )

FXPI32, FXPU32,FXPI64, FXPU64

Read

V V = ( F X P V × scale ) + offset

FXPI32, FXPU32,FXPI64, FXPU64

Write

F X P V = ( V V offset ) ÷ scale

PWM

Read

V V = [ H T ÷ ( L T + H T ) ] × ( scale + offset )

PWM

Write

H T = [ ( V V offset ) ÷ scale ] × P W M period

L T = P W M period H T

V V
—Represents voltage value.

D F V
—Represents DMA FIFO value.

P
—Represents the positive range of the data type.

F X P V
—Represents the converted fixed-point value.

H T
—Represents high time.

L T
—Represents low time.