RSC device interface services

Note: 

  • Execution of RSC services can take some time. For this reason, avoid direct calls from ESM tasks
  • Exceptions thrown by RSC service calls should always be explicitly caught and handled by RSC clients.
    In addition, the underlying type of each RscVariant returned by RSC service calls should never be assumed, but should always be checked before performing any other operation on that object.

 

The device interface services provide a range of functions for accessing properties of the operating system and the controller hardware. You can call the information with the following interfaces and defined parameters. The following headers are required to use the service.

Integrate these via #include, if necessary:

  • Arp\Device\Interface\Services\IDeviceInfoService.hpp
  • Arp\Device\Interface\Services\IDeviceStatusService.hpp

IDeviceInfoService

The IDeviceInfoService RSC interface enables read access to device information. The status value of a parameter is read with the GetItem() method:

RscVariant<512> GetItem(const RscString<512>& identifier)

The status values of several parameters are read with the GetItems() method:

void GetItems(GetItemsIdentifiersDelegate identifiersDelegate, 
              GetItemsResultDelegate resultDelegate)

 

The following parameters are available in the IDeviceInfoService RSC interface for calling of information:

Parameter Data type Description
General.DeviceClass UInt32 The DeviceClass parameter specifies the device class. At the moment, only “ProgrammableLogicController” is supported.
0: Undefined
1: ProgrammableLogicController
2. BusCoupler
3: Switch
General.VendorName String The VendorName parameter indicates the name of the manufacturer.
General.ArticleName String The ArticleName parameter indicates the device name.
General.ArticleNumber String The ArticleNumber parameter indicates the order number of the device.
General.SerialNumber String The SerialNumber parameter indicates the serial number of the device.
General.Firmware.Version String The FirmwareVersion parameter indicates the firmware version of the device. Here, the 5-level notation (Major, Minor, Patch, Build, Status) is used.
General.Firmware.VersionMajor Byte The firmware version year is indicated without the first two digits. E.g., “2019” is indicated as “19”.
General.Firmware.VersionMinor Byte FirmwareVersionMinor
General.Firmware.VersionPatch Byte FirmwareVersionPatch
General.Firmware.VersionBuild UInt32 FirmwareVersionBuild
General.Firmware.VersionStatus String FirmwareVersionStatus
General.Firmware.BuildDate String FirmwareBuildDate
ISO 8601 format <YYYY>-<MM>-<DD>
General.Firmware.BuildTime String FirmwareBuildTime
ISO 8601 format <hh>:<mm>:<ss>
General.Hardware.Version String The HardwareVersion parameter indicates the hardware version of the device.
General.Fpga.Version String The FPGAVersion parameter indicates the FPGA version of the device. Here, the 3-level notation (Major, Minor, Patch) is used.
General.Fpga.VersionMajor Byte FPGAVersionMajor
General.Fpga.VersionMinor Byte FPGAVersionMinor
General.Fpga.VersionPatch Byte FPGAVersionPatch
General.UniqueHardwareId String Sha256 Hash (32byte) hexadecimal coded as string
General.SPNS.Fpga.Version String FPGA version of the SPNS (only for devices with integrated safety controller)
General.SPNS.Fpga.VersionMajor Byte SPNS FPGA version, major
General.SPNS.Fpga.VersionMinor Byte SPNS FPGA version, minor
General.SPNS.Fpga.BuildVersion Unsigned32 SPNS FPGA build version
General.SPNS.Firmware.Version String SPNS firmware version
General.SPNS.Firmware.VersionMajor Byte SPNS firmware version, major
General.SPNS.Firmware.VersionMinor Byte SPNS firmware version, minor
General.SPNS.Firmware.BuildVersion Unsigned32 SPNS firmware build version
Interfaces.Ethernet.Count Byte The NoOfNetworkInterfaces parameter indicates the number of network interfaces.
Interfaces.Ethernet.{adapterIndex}.{port}.Mac String The Mac parameter indicates the MAC address of the selected network interface.
AA:BB:CC:DD:EE:FF
adapterIndex= 1, 2,... port = 0 for the interface,
MAC port = 1, 2,... for the MAC port

IDeviceStatusService

The IDeviceStatusService RSC interface enables read access to status information. The status value of a parameter is read with the GetItem() method.

RscVariant<512>   GetItem(const RscString<512>& identifier)

The status values of several parameters are read with the GetItems() method. Use the deviceStatusService.GetItem("Parameters") method to call status information.

void   GetItems(GetItemsIdentifiersDelegate identifiersDelegate, 
       GetItemsResultDelegate resultDelegate)

 

The following parameters are available for calling information:

Parameter Data type Description
Status.DeviceHealth Byte The DeviceHealth parameter indicates the operating status of the device.
0: OK
1: WARNING
2: ERROR
Status.Cpu.Load.Percent Byte The CPULoad parameter indicates the complete processor load of the device as a percentage.
0% ... 100%
Status.Cpu.{0}.Load.Percent Byte The CPULoad{Core} parameter indicates the processor load of the selected processor core of the device as a percentage.
0% ... 100%
0x64 = 100%
Core = 0, 1, 2, etc.
Status.Memory.Usage.Percent Byte The MemoryUsage parameter indicates the complete memory usage of the device as a percentage.
0% ... 100%
0x64 = 100%
Status.ProgramMemoryIEC.Usage.Percent Byte The ProgramMemoryUsage parameter indicates the program memory usage of the IEC runtime of the device as a percentage.
0% ... 100%
0x64 = 100%
Status.DataMemoryIEC.Usage.Percent Byte The DataMemoryUsage parameter indicates the data memory usage of the IEC runtime of the device as a percentage.
0% ... 100%
0x64 = 100%
Status.RetainMemory.Usage.Percent Byte The RetainMemoryUsage parameter indicates the complete retain memory usage of the device as a percentage.
0% ... 100%
0x64 = 100%
Status.RetainMemoryIEC.Usage.Percent Byte The RetainMemoryUsage parameter indicates the complete retain memory usage of the device as a percentage.
0% ... 100%
0x64 = 100%
Status.Board.Temperature.Centigrade Int32 The BoardTemperature parameter indicates the temperature of the interior of the device in °C.
Status.Board.Humidity Byte The BoardHumidity parameter indicates the relative humidity in the device.
0% ... 100%
Status.Cpu.Temperature.Centigrade Int32 The CPUTemperature parameter indicates the temperature of the processor in °C (for RFC 4072S only).
Status.KeySwitch.Position Byte The KeySwitch parameter indicates the position of the run/stop switch (for RFC 4072S controller only).
0: Switch in stop position
1: Switch in run position
Status.RamDisk.{RamDiskIndex}.Usage.Percent Byte The parameter indicates the memory usage of the RAM disc(s) as a percentage (for RFC 4072S controller only).
0% ... 100%
RamDiskIndex = 1, 2,... Number of the RAM disc (currently, only one RAM disc is supported, so that the index is always 1)
Status.RamDisk.{RamDiskIndex}.Usage UInt32 The parameter indicates the absolute memory usage of the RAM disc(s) (for RFC 4072S controller only).
RamDiskIndex = 1, 2,... Number of the RAM disc (currently, only one RAM disc is supported, so that the index is always 1)

You can also call status information about the LED states via the IDeviceStatusService interface.

The colors of the LEDs are represented as follows, normally in the high word (HW) of the return value:

public enum LedColor : ushort
   {
   Green = 1,
   Yellow = 2,
   Red = 4
   };

The status of the LEDs is represented as follows, normally in the low word (LW) of the return value:

public enum LedStates : ushort
   {
   Off = 0,
   On = 1,
   Flashing_0_5_Hz = 2,
   Flashing_2_Hz = 3,
   Alternating_0_5_Hz = 4,
   Alternating_2_Hz = 5
   };

IEC runtime system LEDs

Parameter Data type Description
Status.Leds.Runtime.Run UInt32 Runtime RUN LED (HW= color, LW= status)
Status.Leds.Runtime.Fail UInt32 Runtime FAIL LED (HW= color, LW= status)
Status.Leds.Runtime.Debug UInt32 Runtime DEBUG LED (HW= color, LW= status)

Axioline LEDs

Parameter Data type Description
Status.Leds.Axio.D UInt32 AXIO master D LED (HW= color, LW= status)
Status.Leds.Axio.E UInt32 AXIO master E LED (HW= color, LW= status)

PROFINET LEDs

Parameter Data type Description
Status.Leds.Pnio.Bf_C UInt32 Pnio controller BF LED (HW= color, LW= status)
Status.Leds.Pnio.Bf_D UInt32 Pnio device BF LED (HW= color, LW= status)
Status.Leds.Pnio.Sf UInt32 Pnio controller SF LED (HW= color, LW= status)

Calling network status information via IDeviceStatusService

You can also call status information about the network states via the IDeviceStatusService interface:

Parameter Data type Description
Status.Interfaces.Ethernet.{adapterIndex}.{port}Baudrate Byte The “Interface Baudrate” parameter indicates the current speed of the interface.
1: 10 Mbps
2: 100 Mbps
3: 1000 Mbps
adapterIndex = 1, 2, ...
port = 1, 2, ...
Status.Interfaces.Ethernet.{adapterIndex}.{port}.Duplex Byte The “Interface Duplex Mode” parameter indicates the current duplex mode of the interface.
1: Half duplex
2: Full duplex
adapterIndex = 1, 2, ...
port = 1, 2, ...
Status.Interfaces.Ethernet.{adapterIndex}.{port}.Link Byte The “Interface Link State” parameter indicates the link status of the interface.
0: linkDown
1: linkUp
adapterIndex = 1, 2, ...
port = 1, 2, ...