gNumericBox.gPrecision Property

Top  Previous  Next

PROPERTY                                                         DATA TYPE                                                       NOTE

gValue

Double ( Real )

ReadOnly

gPrecision

Integer

Must be positive

gPLCAddressDataType

gPLCAddressDataType


 

 

gValue property holds the formatted value that is formed by means of gPrecision and gPLCAddressDataType.

 

gPrecision property defines the number of characters after decimal point.

Function of this property depends on gPLCAddressDataType setting.

 

gPLCAddressDataType should be set in accordance with data type of PLC address.

 

Setting Examples:

Suppose gUnitText = " Volt"

 

 

Data type of PLC Adress

gPLCAddressDataType

gValue

gPrecision

gPLCValue

Display

 

 

                   Integer

Integer

Integer

Integer

Real          *

Real          *

Real          *

9876

987,6

0,09876

9876

9876

9876

0

1

5

0

1

5

9876

9876

9876

9876

9876

9876

9876 Volt

987,6 Volt

0,09876 Volt

9876 Volt

9876,0 Volt

9876,00000 Volt

                 

 

                    Real

Integer       *

Integer       *

Integer       *

Real

Real

Real

98,76

98,76

98,76

98,76

98,76

98,76

0

1

5

0

1

5

98

987

9876000

98

98,7

98,76

98 Volt

98,7 Volt

98,76000 Volt

98 Volt

98,7 Volt

98,76000 Volt

 * : Inconsistent setting

 

 

C# code example

gValue is a read only property, can not be set by code.

 

gNumericBox.gPrecision = 2;

gNumericBox.gPLCAddressDataType = gPLCAdressDataType.Integer;