Skip to main content

RapidPath Data Sink

The RapidPath Data Sink (sometimes referred to, internally, as FDS, or Firmware Data Sink) facility allows the plugin to be configured to export data directly from the EtherCAT master/slaves to an arbitrary data sink (e.g. database).

Configuration

INI Configuration File

The RapidPath plugin reads configuration data for all FDS instances from a directory in the profile: RapidPathDataSink

Any INI file in that directory will be treated like a configuration file for a distinct instance of a sink.

Format

The configuration file has a global section, and then separate section for each data item to capture and sink.

Global Configuration Options

Example

[Global]
Name=Axis Positions
ExportPeriodSeconds=5.0
DataSinkDSN = sqlite:C:\Data\AxisPositions.sqlite
  • Name
    • This is a uniquely-identifying name for the sink.
    • Log messages pertanining to this sink will have this name in them.
  • ExportPeriodSeconds
    • Configures the frequency with which the instance exports buffered data records to the data sink.
    • This is a decimal number of seconds (0.001 is a valid export period that will essentially defeat any performance improvement accomplished by buffering).
    • 0.250 is probably the smallest useful value you could set this to for an SQLite backend.
  • DataSinkDSN
    • a specifier for the data sink backend
    • Currently Supported Backends
      • SQLite
        • sqlite:<path_to_sqlite_db_file>
        • The path could be anything supported by the SQLite library.
Item Configuration Options

Each individual data item must have a separate configuration section.

Example

[Item:...]
Name = <item_display_name>
DataType = {Int32|UInt32|Double|Int16|UInt16|Int8|UInt8|Float}
Type = {PDO|Axis}
Path = <type_specific_path>
SamplePeriodSeconds = <period_seconds>
SummaryType = {Mean|Latest|Minimum|Maximum}
Scale = <xform_scale_multiplier>
Offset = <xform_offset>
Mask = <mask>
  • Section Name
    • This must begin with Item:
    • The remainder of section name should be unique to the file (INI syntax/semantic rules), but isn't used for configuration purposes.
  • Name
    • This is the name of the data item, as it will be saved in the data sink.
    • Depending on the backend, there may be restrictions on characters that can be used in the name.
  • Type
    • The type of data item to read.
    • This choice determines how the Path configuration option is interpreted.
  • Path
    • This tells the FDS facility how to retrieve the raw data.
    • PDO
      • The complete PDO name (e.g. shown in RapidSetup) must be specified (case-sensitive).
    • Axis
      • The (global) axis index and an axis feature name must be specified, separated by a forward slash ("/").
      • The axis features may be found in MotionControllers/RapidPath/Runtime/RSI/include/rsienums.h. Look for RSIAxisAddressType.
        • Remove "RSIAxisAddressType" from the full enumeration name, e.g. "ACTUAL_POSITION", "MOTION_ELEMENT_ID", or "TARGET_FEEDRATE"
  • DataType
    • This is an indication of the raw data type as stored in RMP firmware memory.
    • For PDO and Axis types, this will be detected, but you may specify a data type to use if one cannot be automatically detected.
    • Default Value: automatically detected
  • SamplePeriodSeconds
    • This determines the frequency with which data is captured for an individual data item.
    • This is expressed as a decimal number of seconds.
      • Meaningful values should be ≥ the EtherCAT sample period.
    • The data is sampled every sample (based on the EtherCAT sample period—ususally 1 ms), but a "summarized" value is calculate for all the sampled data in this period.
    • Only one data point will be sinked for the entire sample period.
    • Default Value: 0.001
  • Scale
    • The raw value will be multiplied by this before being summarized and sinked.
    • Default Value: 1.0
  • Offset
    • This will be added to the scaled (See Scale) raw value before being summarized and sinked.
  • SummaryType
    • This determines how a single value for the SamplePeriodSeconds is calculated from the set of scaled/offset raw values captured doring the sample period.
    • Choices
      • Latest
      • Mean
      • Minimum
      • Maximum
    • This is only meaningful if the SamplePeriodSeconds is larger than the EtherCAT sample period.
    • Default Value: Latest
  • Mask
    • For integral data types, the raw value is bitwise AND'ed with the mask before being summarized.
    • This is useful for selecting a single bit or bit range from a word (e.g. digital inputs).
    • Hexadecimal and decimal values are supported.
    • DefaultValue: 0xFFFFFFFF

Using the Data

SQLite

The most straightforward query to run joins the two tables together and sorts by timestamp.

SELECT
    data.timestamp_utc AS TimestampUTC,
    item.name AS Item,
    data.value AS Value
FROM data
    INNER JOIN item
    ON data.item_id = item.id
ORDER BY TimestampUTC
;