gNumericLabel.gPrecision Property

Top  Previous  Next

PROPERTY                                                         DATA TYPE                                                       NOTE

gValue

Double ( Real )

ReadOnly

gPrecision

Integer

Must be positive

gPLCAddressDataType

gPLCAddressDataType

Integer, Real

 

 

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 gPrefixText = ": ", and gUnitText = " Volt"

 

 

Data type of PLC Adress

gPLCAddressDataType

gOPC.PLCValue

gPrecision

gValue

Display

 

 

                   Integer

Integer

Integer

Integer

Real          *

Real          *

Real          *

9876

9876

9876

9876

9876

9876

0

1

5

0

1

5

9876

987,6

0,09876

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

9,8

0,00098

98

98,7

98,76

: 98 Volt

: 9,8 Volt

: 0,00098 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.

 

gNumericLabel.gPrecision = 2;

gNumericLabel.gPLCAddressDataType = gPLCAdressDataType.Integer;