PlcType Property

General info

Label

Type

Tooltip

The PLC type

Data type

UInt64

Type

FlagGroup

Code

2500

Symbolic name

MODEL_PROP_PLCTYPE

Available since

1.30.6.4266

Parent properties

PlcDeviceInfo

Attributes

Name Tooltip
PROP_VISIBLE The property is visible in DataStudio and can be read by the inmation APIs
PROP_VOLATILE The property exists during runtime of the service only and is not saved to the image

Flags

Flag group: PlcType

Examples

Read from or write to the PlcType property.

  • Lua

  • C#

-- Read from the PlcType
inmation.getvalue("/System/Core/obj.PlcConnection.PlcDeviceInfo.PlcType")

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

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

A switch-like function of the flags.

function get_flag_name(mask)
    local pt = inmation.model.flags.PlcType
    if mask & pt.PLC_TYPE_UNKNOWN == pt.PLC_TYPE_UNKNOWN then return 'PLC_TYPE_UNKNOWN'
    elseif mask & pt.PLC_TYPE_S5 == pt.PLC_TYPE_S5 then return 'PLC_TYPE_S5'
    elseif mask & pt.PLC_TYPE_S5_PG == pt.PLC_TYPE_S5_PG then return 'PLC_TYPE_S5_PG'
    elseif mask & pt.PLC_TYPE_RK == pt.PLC_TYPE_RK then return 'PLC_TYPE_RK'
    elseif mask & pt.PLC_TYPE_S7 == pt.PLC_TYPE_S7 then return 'PLC_TYPE_S7'
    elseif mask & pt.PLC_TYPE_S7_200 == pt.PLC_TYPE_S7_200 then return 'PLC_TYPE_S7_200'
    elseif mask & pt.PLC_TYPE_S7_300_400 == pt.PLC_TYPE_S7_300_400 then return 'PLC_TYPE_S7_300_400'
    elseif mask & pt.PLC_TYPE_S7_1200 == pt.PLC_TYPE_S7_1200 then return 'PLC_TYPE_S7_1200'
    elseif mask & pt.PLC_TYPE_LOGO == pt.PLC_TYPE_LOGO then return 'PLC_TYPE_LOGO'
    elseif mask & pt.PLC_TYPE_RFC1006 == pt.PLC_TYPE_RFC1006 then return 'PLC_TYPE_RFC1006'
    elseif mask & pt.PLC_TYPE_S7_1200_1500_TIA == pt.PLC_TYPE_S7_1200_1500_TIA then return 'PLC_TYPE_S7_1200_1500_TIA'
    elseif mask & pt.PLC_TYPE_IEC == pt.PLC_TYPE_IEC then return 'PLC_TYPE_IEC'
    elseif mask & pt.PLC_TYPE_IEC_ADS == pt.PLC_TYPE_IEC_ADS then return 'PLC_TYPE_IEC_ADS'
    elseif mask & pt.PLC_TYPE_IEC_CODESYS == pt.PLC_TYPE_IEC_CODESYS then return 'PLC_TYPE_IEC_CODESYS'
    elseif mask & pt.PLC_TYPE_REMOTE == pt.PLC_TYPE_REMOTE then return 'PLC_TYPE_REMOTE'
    elseif mask & pt.PLC_TYPE_AB_LOGIX_5000_EIP == pt.PLC_TYPE_AB_LOGIX_5000_EIP then return 'PLC_TYPE_AB_LOGIX_5000_EIP'
    end
end
return get_flag_name(inmation.model.flags.PlcType.PLC_TYPE_UNKNOWN)