SIUnits (FPScript)

21.09.2021

Returns the presentation of the unit of a data set in SI units.

Syntax

SIUnits(DataSet)

 

The syntax of the SIUnits function consists of the following parts:

Part

Description

DataSet

The data set whose unit is to be determined in SI units.

All data structures are allowed. All data types are permitted.

Remarks

For aggregate data structures, only the Y component is considered. If the data set does not have a unit, the function provides the Empty data type. Otherwise, the result is a list with the following named elements:

Name

Contains

Scale

64-bit floating point scalar value with the scaling factor. If the data set does not have a unit or has a unit with an unknown SI dimension, then the scale is equal to zero.

Offset

64-bit floating point scalar value with the offset.

ExpNum

32-bit integer data series with the exponential numerators of the seven SI base units in the order of m kg s A K mol cd.

ExpDenom

32-bit integer data series with the exponential denominators of the seven SI base units.

The Internal Representation of Units describes how to interpret the individual values.

If an argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

SIUnits(1 mV)

Results in [<Scale> 1.E-3, <Offset> 0.0, <ExpNum> { 2, 1, -3, -1, 0, 0, 0}, <ExpDenom> { 1, 1, 1, 1, 0, 0, 0} ]. The unit Volt (V) corresponds to the SI Units m2 kg s-3 A-1. The Scale is equal to 1.E-3, since 1 mV = 10-3V.

SIUnits(1 Pi)

Results in [<Scale> 3.141592653589793, <Offset> 0.0, <ExpNum> { 0, 0, 0, 0, 0, 0, 0}, <ExpDenom> { 1, 0, 0, 0, 0, 0, 0} ]. The Scale is equal to π. All numerator exponents are equal to 0, since the unit Pi is dimensionless. The denominator exponent of the SI unit m is equal to 1. This is interpreted as m/m.

SIUnits(1 sr)

Results in [<Scale> 1.0, <Offset> 0.0, <ExpNum> { 0, 0, 0, 0, 0, 0, 0}, <ExpDenom> { 2, 0, 0, 0, 0, 0, 0} ]. The unit steradian (sr) of the solid angle is dimensionless and is represented in SI units as m2/m2. It remains obvious through this type of presentation that it is the relationship between two areas. All numerator exponents are equal to 0, since the unit sr is dimensionless. The denominator exponent of the SI unit m is equal to 2. This is interpreted as m2/m2.

SIUnits(22 °C)

Results in [<Scale> 1.0, <Offset> 273.15, <ExpNum> { 0, 0, 0, 0, 1, 0, 0}, <ExpDenom> { 0, 0, 0, 0, 1, 0, 0} ]. 0 °C correspond to 273.15 K, i.e. the °C scale is offset by the Kelvin scale by 273.15. This offset is shown via the element Offset.

SIUnits(2)

Results in [<Scale> 0.0, <Offset> 0.0, <ExpNum> { 0, 0, 0, 0, 0, 0, 0}, <ExpDenom> { 0, 0, 0, 0, 0, 0, 0} ]. The value does not have a unit. The Scale element is therefore equal to zero.

SIUnits(2 Dummy)

Results in [<Scale> 0.0, <Offset> 0.0, <ExpNum> { 0, 0, 0, 0, 0, 0, 0}, <ExpDenom> { 0, 0, 0, 0, 0, 0, 0} ]. The unit "Dummy" is unknown. The Scale element is therefore equal to zero.

See Also

Unit Function

UnitType Function

UnitSymbol Function

Unit Manager

Quantities in FPScript

Share article or send as email:

You might be interested in these articles