Unit
Adds a unit to a value and converts it to a quantity or transforms the unit of a quantity.
Syntax
Unit<[Y Unit][, X Unit][, Z Unit]> Expression
The syntax of the Unit operator consists of the following elements:
Element |
Description |
---|---|
Expression |
Any expression. All data types and data structures are permitted. |
Y Unit, X Unit, Z Unit |
The unit symbol for the corresponding component of Expression. |
Remarks
The operator can process all data structures. Lists are processed by element. All numerical data types are allowed. Integral data types, to which a unit is to be added, are automatically converted to floating point data types, since integral quantities are not supported.
If the argument is already a quantity, its unit is transformed to the new unit. This is only possible if it is compatible with the new unit, i.e. they have the same SI dimension.
You can specify up to three units in the operator for the individual components of the argument. If you do not specify a unit for a component, it remains unchanged. Any unit that may be present is not removed, but remains unchanged.
Available in
FlexPro View, Basic, Professional, Developer Suite
Examples
Unit<mV> 1 V |
Returns the quantity 1000 mV. |
Unit<1> 2 π |
Returns the quantity 6.283185307179586 with the unit 1. |
Unit<1> 2 |
Returns the quantity 2 with the unit 1. |
Unit<mV> 1n |
Converts the 32-bit integer 1 to the 64-bit floating point quantity 1 mV. |
Unit<A> 1 V |
Generates a runtime error, since the unit Ampere is not compatible with the unit Volt. |
Unit<mV, ms> Signal |
Converts the Y component of the signal to the unit mV and the X component to the unit ms. |
Unit<, ms> Signal |
Converts only the X component of the signal to the unit ms and leaves the Y component unchanged. |
Unit<mV, ms> List |
Transforms the unit of the Y and X components of all list elements. |
Unit<> Signal |
Has no effect. The signal remains unchanged. |
Unit<%>Unit<1>(Signal / Maximum(Signal)) |
Calculates the relative signal amplitude in %. Unit<1> ensures that the calculated ratio receives the unit 1 even in the event that the Y values of Signal do not have a unit. It is then transformed to the unit %, which is similar to multiplying by 100. |