ConversionMode Property

General info

Label

Conversion Mode

Tooltip

The mode of conversion that needs to be done on input data

Data type

UInt32

Default value

1 (inmation.model.codes.ConversionMode.CONVERSION_MODE_NONE)

Type

CodingGroup

Code

2451

Symbolic name

MODEL_PROP_CONVERSIONMODE

Available since

1.30.6.4266

Parent properties

InputConversion

Attributes

Name Tooltip
PROP_CONFIGURABLE The property is configurable and can be changed with DataStudio and the various inmation APIs
PROP_VISIBLE The property is visible in DataStudio and can be read by the inmation APIs
PROP_HAS_DEFAULT The property has a default value as standard

Codings

Coding group: ConversionMode

Name Code Label Tooltip

CONVERSION_MODE_NONE

1

None

No conversion to be done

CONVERSION_MODE_RESCALING

2

Rescaling

The range of raw input values is being rescaled to a user defined range

CONVERSION_MODE_STATE

3

Discrete State

Numeric values will be converted to textual identifiers

Examples

Read from or write to the ConversionMode property.

  • Lua

  • C#

-- Read from the ConversionMode
inmation.getvalue("/System/Core/obj.ConversionMode")

-- Write to the ConversionMode
inmation.setvalue("/System/Core/obj.ConversionMode",
    inmation.model.codes.ConversionMode.CONVERSION_MODE_NONE)
string path = "/System/Core/obj.ConversionMode";
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "so", Password = "inmation" };
StatelessInterface sli = new StatelessInterface(tcpcfg);

// Read from the ConversionMode
Result result = sli.ReadValue(sc, new ReadItem(path));
// Write to the ConversionMode
Result result = sli.WriteValue(sc, new WriteItem(ConversionMode.CONVERSION_MODE_NONE, path));

A switch-like function of the codings.

function get_coding_name(code)
    local cm = inmation.model.codes.ConversionMode
    if cm.CONVERSION_MODE_NONE==code then return 'CONVERSION_MODE_NONE'
    elseif cm.CONVERSION_MODE_RESCALING==code then return 'CONVERSION_MODE_RESCALING'
    elseif cm.CONVERSION_MODE_STATE==code then return 'CONVERSION_MODE_STATE'
    end
end
return get_coding_name(inmation.model.codes.ConversionMode.CONVERSION_MODE_NONE)