Supported platforms: CODESYS 2.3, CODESYS 3.5

ADC_From_mAorV (FUN)

Description

This function scales the voltage or current value to the ADC value according to the selected range. Voltage or current value is given to the function as an input and the function returns the calculated ADC value.  

 

The hardware specific library provides global G_AIType for value scaling.

 

Inputs

CODESYS 2.3CODESYS 2.3

Input variable name

Data type

Range

Description

i_mAorV

WORD

0..65535

Current or voltage value to be converted

i_AIType

BYTE

0..G_ADScaleArrMax

Selection of used voltage or current range in conversion

 

 

CODESYS 3.5CODESYS 3.5

Input variable name

Data type

Range

Description

i_mAorV

WORD

0..65535

Current or voltage value to be converted

i_AIType

ADData

 

Structure that defines the AI scaling values

 

 

Return value

Return value

Data type

Range

Description

 

WORD

0..65535

Converted AD value

Example code

See also

 

 

Source file Topic000234.htm

Last updated 21-Feb-2025