Skip to main content
Version: V2 (Ignition 8.1)

system.mes.unitOfMeasure.getUnitOfMeasure

Description​

Retrieves a Units Of Measure record by its ID or name.

Permissions​

This method requires the UNIT_OF_MEASURE.READ.GET permission.

Syntax​

system.mes.unitOfMeasure.getUnitOfMeasure(idOrName)

Parameters​

ParameterTypeNullableDescription
idOrNameStringFalseThe ID or name of the unit of measure to retrieve.

Returns​

Returns a JSON representation of the unit of measure. Returns nothing if no unit of measure is found.

NameTypeDescription
nameStringThe name of the unit of measure.
symbolStringThe symbol of the unit of measure.
idString (ULID)The ULID of the unit of measure.
notesStringNotes related to the unit of measure.
enabledBooleanIndicates if the unit of measure is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples​

# Retrieve a unit of measure by ID or name
uom = system.mes.unitOfMeasure.getUnitOfMeasure('Pound')

# Output the unit of measure
print(uom)