Supported platforms: CODESYS 2.3, CODESYS 3.5
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.
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 |
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 |
Data type |
Range |
Description |
|
WORD |
0..65535 |
Converted AD value |
Source file Topic000234.htm
Last updated 21-Feb-2025