i4connected Knowledgebase 5.6

The MSCONS Adapter

Abstract

The MSCons adapter is a specialized Adapter that can load measurements from XML files located on disk storage or FTP/HTTP storage.

The MSCons adapter is a specialized Adapter that can load measurements from XML files located on disk storage or FTP/HTTP storage. Each file contains values for a single signal.

This article describes the required XML structure of the MSCONS Adapter configuration file. The MSCONS Adapters can be configured by accessing the Devices tile from the Administrative area of i4connected.

MSCons_adapter_selection.jpg

The MSCONS Device

Further on, in the Add Device panel, the MSCONS Adapter specific settings can be accessed by clicking the MSCONS adapter name field. A new panel will be opened, allowing the user to either select an existing adapter or create a new one.

MSCons_adapter_add_button.jpg

Select the MSCONS Source panel

By clicking the Add button, the Add MSCons source panel will be opened. In this view, the following MSCONS source settings will be organised:

  • Name - The name of the MSCONS source settings, that will be displayed in the configured device, under the MSCONS adapter name field.

  • Address - The location of the directory where the MSCONS data is collected. The directory can be accessed using one of the following methods:

    • FTP: ftp://MyFTPServer/MyFolder/MyData/

    • HTTP: http://MyServer/MyFolder/MyData/

    • Local (complete): c:\MyFolder\MyData\

    • Local (relative): \\MyFolder\MyData\

  • Poll interval (ms) - The interval of time, defined in milliseconds, for scanning the folder for MSCONS data.

  • User name - If required, only when using FTP or Local address. The user name required to access the directory.

  • Password - If required, only when using FTP or Local address. The password required to access the directory.

  • Use file name pattern for sorting - Enables the usage of the file date/time pattern for sorting.

  • File date/time pattern - Represents the date/time format of the date or/and time from the name of the MSCONS file. If specified, the parser will try to recognise the pattern in the name of the MSCONS file. Examples: yyyyMMdd, yyMMddHHmmss, yy-MM-dd-HH-mm-ss.

  • Select owner - name of the Adapter owner.

    IoT_owner.jpg

    Adapter owner selector

    By clicking on the owner selector, the Select Users panel is opened allowing the user to chose the Adapter's owner.

    List_of_users.jpg

    Select Users panel

    Important

    When adding a new Adapter the creator user is by default set as Adapter's owner. However, the owner can be changed after the Adapter was saved, by all users having at least the Manage adapters permission enabled.

  • Time zone - The time zone used by the new MSCONS Adapter. By default, the Time Zone defined for the currently logged in user is set.

  • Trace Level - The level of logging used by the new MSCONS Adapter. Trace levels determine which events the trace provider generates. The Trace level value can be Trace, Debug, Info, Warn, Error, Fatal or Off.

  • Enabled - If the setting is turned on, the Adapter is enabled and functional.

Note

Only users with the Manage adapters permission enabled can add and edit Adapters.

Configuring the MSCONS files

The MSCONS Adapter configuration file allows the user to set up the MSCONS Adapter in order to retrieve and parse the data from MSCONS files. The configuration must follow a simple but logical structure, detailed below.

XML configuration example structure OLD

<msconsFolder address="ftp://someserver/Data" password="pswd" userName="user" pollInterval="900000" fileTimePattern="_yyyyMMdd_">
  <msconsMeasurementParser device="Device01" locationId="DE1000601234500000000000000025901" />
  <msconsMeasurementParser device="Device02" locationId="DE1000601234500000000000000025902" />
</msconsFolder>

XML configuration example structure NEW

//<msconsFolder address="ftp://someserver/Data/" password="pswd" pollInterval="1800000" userName="user">
//  <msconsMeasurementParser delimiter="39" device="Device01" signalName="Signal 01" locationId="CH1078601234500000000000000000014" />
//</msconsFolder>
The <msconsFolder> element

The root element <msconsFolder> is used to define the directory where the data is located. The <msconsFolder> element is unique per configuration XML.

Example

<msconsFolder
	address="ftp://myserver/myfiles" 
	userName="root" 
	password="12345" 
	pollInterval="600000"
	fileTimePattern="_yyyyMMdd_">
	
</msconsFolder>
The <msconsMeasurementParser> element

The <msconsMeasurementParser> element defines how the MSCONS data will be parsed. This element is highly configurable using its attributes and must be configured based on the structure of the MSCONS data.

Example

<msconsFolder
	address="ftp://myserver/myfiles" 
	userName="root" 
	password="12345" 
	pollInterval="600000"
	fileTimePattern="_yyyyMMdd_">
	
	<msconsMeasurementParser
		device="Device01"	
		locationId="DE1000601234500000000000000025901" />
	
</msconsFolder>