Supported platforms: CODESYS 2.3, CODESYS 3.5
This function scales the ADC value to voltage or current according to the selected input pin type. The ADC value is given to the function as an input and the function returns the calculated voltage or current value. The returned value (WORD) is presented with two decimals (675 = 6,75V or 6,75mA).
The hardware specific library provides global G_AIType for value scaling.
Input variable name |
Data type |
Range |
Description |
i_ADCValue |
WORD |
0..65535 |
AD converter value of AI input |
i_AIType |
BYTE |
0..G_ADScaleArrMax |
Selection of used voltage or current range in conversion |
Input variable name |
Data type |
Range |
Description |
i_ADCValue |
WORD |
0..65535 |
AD converter value of AI input |
i_AIType |
ADData |
|
Selection of used voltage or current range in conversion |
Return value |
Data type |
Range |
Description |
|
WORD |
0..65535 |
Scaled voltage or current value |
Source file Topic000232.htm
Last updated 21-Feb-2025