AdjustUnit (FPScript)

21.09.2021

Adjusts the unit(s) of a data set to those of a different data set.

Syntax

AdjustUnit(DataSet [ , OtherDataSet ])

 

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

Part

Description

DataSet

 

The data set with the unit(s) to be adjusted.

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

OtherDataSet

 

The data set to whose units DataSet is to be adjusted. If you omit the argument or pass the value Empty, DataSet is returned without modification.

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

Remarks

If DataSet already has a unit, the unit is converted. If OtherDataSet does not have a unit, then the unit of DataSet, if present, is converted to the unit "1". If conversion is not possible due to mismatching SI dimensions, an error occurs. Aggregate data structures and lists are processed on a per-element basis. If only one of the arguments is an aggregate data structure or list, then only the Y component or the first element is taken into account.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

AdjustUnit(1.4 V, 1.2 mV)

Results in 1400 mV. The unit is converted.

AdjustUnit(1.4, 1 mV)

Results in 1.4 mV. The unit is set.

AdjustUnit(Signal1, Signal2)

The Y and X units of 'Signal1' are adjusted to the units of 'Signal2'.

AdjustUnit(List1, List2)

The units of all elements in the list 'List1' are adjusted to those of 'List2'.

AdjustUnit(Frequency, 1. / Unit(Time))

The 'Frequency' unit is transformed to the reciprocal value of the 'Time' unit.

See Also

ChangeUnit Function

Unit Function

Unit Manager

Quantities in FPScript

Unit<> Operator

Share article or send as email:

You might be interested in these articles