Skip to main content

i4connected Knowledge Base

Managing i4connected devices and adapters

Abstract

Check out this article and learn more details on how to use various functionalities on i4connected devices and adapters.

Using Manual Counters and Device Lists
Abstract

Check out this tutorial and learn how to create Manual Counters and manage the List of Device lists by following these steps.

In order to be able to manage Manual Counters and the values inside a device list, please follow the workflow described below:

  1. In the administration section of the i4connected portal, click on the Counter Routes tile.

  2. The Counter Routes panel is opened, displaying all the i4connected Counter Routes.

  3. In this view, click on the Add toolbar button.

    add_button.jpg
  4. In the Add list of devices list panel proceed with the following settings:

    1. Type in the Name of the new List of Devices list.

    2. Upload a Photo for the new List of Devices list.

  5. Click the Save bottom button.

    add_list_of_device.jpg
  6. The Add list of devices list panel is closed and the new Counter has been added to the list.

  7. In the Counter routes panel start typing the name of the newly created List of Devices.

  8. The list is filtered to display the searched List of Devices.

    list_of_devices_filtered.jpg
  9. Click on the Edit button to open the List of Devices panel.

    list_of_devices_panel.jpg
  10. Click the Add counter toolbar button.

    add_counter_button.jpg
  11. The Select counter panel is opened where all the available Manual Counter Devices are listed.

  12. Select the desired Devices and click the bottom Apply & Close button, when ready.

    apply_and_close_button.jpg
  13. The selected Devices are applied. To confirm the changes click the bottom Save button, of the List of Devices panel.

    save_devices.jpg
  14. As we now have the new Manual Counter prepared, we can proceed to the Overview section of the portal and click on the List of Devices Lists tile.

    list_od_device_list.jpg
  15. The List of Device Lists panel is opened where all Device Lists are available.

  16. Search for the previously created Counter Route.

    list_of_devices_panel.jpg
  17. The new counter route is in the state of Unlocked. So to proceed with adding values, you need to Lock it using the designated button.

    locked_device.jpg
  18. Click on the Device List card to open the Table input.

    table_input.jpg
  19. In the Table Input panel, click on the Signals button to manage values.

    signals.jpg
  20. Select the Date, insert the Signal value, and click the Save value button.

    save_values.jpg
  21. A toast message is displayed confirming the success of the write operation.

    write_successful.jpg
  22. The Signal area is updated and the Info labels display the new value you added. Next, click on the List of Values button.

    list_of_values.jpg
  23. The View Signal panel is opened. In this view, the chart displays the last value you added. The list at the bottom of the chart also displays your value.

    view_signal.jpg

    Tip

    Further values can be added in this view, by clicking the Add signal value button, available at the top of the chart. More details about the View Signal panel can be found in the documentation section.

  24. If no further Signal values are necessary click on the Close bottom button of both the View Signal and Table Input panels. In the List of Devices Lists make sure that you Unlock the previously updated entity, using the designated button.

    unblock_button.jpg
Defining and using i4scada Adapters
Abstract

Check out this tutorial and follow the steps in order to add a new i4scada Device and Adapter and define its Signals and Configured Alarms.

Adding a new i4scada Device and Adapter

In order to configure an i4scada Device and an Adapter in the context of the i4connected platform, please follow the below described steps:

  1. Go to the i4connected Admin section and click on the Sites tile.

    Sites_tile.jpg
  2. The Sites panel is opened. Select the Site where the new i4scada Device should be added.

  3. In the Site's detailed view mode click on the Devices tile.

    Devices_tile.jpg
  4. The Device List panel is opened. Click the Add toolbar button.

    Add_new_device.jpg
  5. In the Select Device panel, click on the i4scada tile.

    i4SCADA_device_type.jpg
  6. In the Add Device panel, fill in the mandatory information such as Device Name. Fill in all the other needed optional information.

  7. Next, click on the Select i4scada adapter name field.

    Select_i4SCADA_adapter_name.jpg
  8. In the Select i4scada server panel click on the Add button.

    Add_scada_server.jpg
  9. The Add i4scada Server panel is opened. In this view, fill in the following mandatory settings:

    add_i4scada_server.jpg
    1. Adapter name

    2. Adapter description

    3. WEBfactory server address

      Warning

      The SCADA Server should be installed on a machine that is visible for the i4connected server.

    4. Concurrent connections

    5. Max. number of results/request

    6. Poll Interval (max)

    7. User name

    8. Password

    9. Time zone

    10. Trace Level

    11. Set the adapter to status Enabled

    Tip

    For more details about i4scada Adapters please also visit the dedicated article here.

  10. Click the Save button to preserve the changes.

  11. The Add i4scada Server panel is closed. In the Select i4scada Server panel the newly created server is listed. Select it to add it to your new Device.

    Select_i4SCADA_Server.jpg
  12. Proceed and save your new i4scada Device. As soon as the new Device is saved, it is opened in detailed view mode.

    Notice that the Device has inherited all the parent Site Users, but there are 0 Signals, 0 Alarms, and 0 External Alarms.

    SCADA_device.jpg
Adding new i4scada Signals

In order to add new Signals to your i4scada Device, proceed as follows:

  1. Click on the Signal tile of your Device to open the Signal List panel.

    Signal_tile.jpg
  2. Click on the Add Signal toolbar button.

    Add_Signal.jpg
  3. In the Add signal panel fill in the following settings:

    1. Make sure that the signal is set to Active.

    2. Type in the Signal Name, Alias, and Description.

    3. Leave the Counter settings to their default values.

    4. Click on the Browse i4scada log field to open the list of Signals coming from your SCADA database.

      SCADA_signals.jpg

      As soon as the desired SCADA Signal was selected, the SCADA Signal name and Log name will be filled in, by the system.

      SCADA_signal_settings.jpg

      Next, you can select the Signal type choosing from the drop-down list options: Double or String.

      Tip

      For more details about the i4scada Signal settings, please also visit the dedicated article here.

    5. Proceed with the Advanced settings, as desired.

    6. Set the Signal security as desired.

  4. Click the Save button to add the new Signal to your i4scada Device.

    Signal_added.jpg
Adding Alarms to an i4scada Device

In order to add new Alarms to your i4scada Device, proceed as follows:

  1. Click on the Alarms tile of your Device to open the Alarm script list panel.

    Alarms_tile.jpg
  2. Click on the Add toolbar button.

    Add_alarm_script_list.jpg
  3. In the Add alarm condition panel proceed with the following settings:

    1. Make sure that the Alarm is set to Active.

    2. Click on the Alarm field to open the list of i4connected Alarms.

      sect_alarms.jpg
    3. Chose the desired Alarm from the list view.

    4. Next, proceed with the Alarm condition configuration, by clicking the Add parameter button.

      Select your previously created Signal from the Signal List panel.

      Select_signal.jpg

      As soon as the Signal parameter is added, you can fill in the formula and test the results.

      Test_formula.jpg

      Tip

      For more details about the Event script lists, please visit the dedicated article here.

  4. Press the Save button to add the new Alarm to your Device.

    Alarm_added.jpg
  5. As soon as the Signal value changes, if the inserted condition is not met, a new Alarm will be triggered.

    Notice

    In our case, the Alarm condition states that the Alarm should be triggered if the registered Signal value is higher than 20. As our Signal returned a value of 31.8 a new alarm was triggered.

    Alarm_triggered.jpg
Adding External Alarms to an i4scada Device

In order to add new External Alarms to your i4scada Device, proceed as follows:

  1. Click on the External Alarms tile of your Device to open the External alarms panel.

    External_Alarms_tile.jpg
  2. Click the Change toolbar button of the External alarms panel.

    Change_ext_alarms.jpg
  3. Select the desired External alarm from the Select i4scada alarms panel.

    Notice

    In this view, all the Alarms coming from your i4scada Server will be listed. This list features a filtering mechanism, allowing you to easily pinpoint the desired alarm, by filtering after Signal, Alarm, Type, and Group.

    External_alarms.jpg
  4. As soon as the Alarm is added, the Device details panel is accordingly updated.

    Ext_Alarm_added.jpg
Using MQTT Adapter to connect Ewon Flexy
Abstract

Open this article and learn how to use the MQTT Adapter to connect an Ewon Flexy device to the i4connected environment.

The Ewon Flexy is an advanced internet data gateway that allows Machine Builders to monitor and collect vital KPIs for analysis and predictive maintenance from multiple types of PLCs. Using an MQTT Adapter the Ewon Flexy device can be connected to the i4connected platform through an MQTT Broker.

Setup of BASIC IDE in Ewon Flexy

The MQTT functionality of the Ewon Flexy devices is available via BASIC and Java programming environment. As it is easier to access the BASIC programming environment, please follow the below-described steps:

  1. The first step in preparing the Ewon Flexy devices is uploading the CA certificates.

    Tip

    Depending on the MQTT Broker Certificate type:

    If you are using a self-signed certificate on the MQTT Broker, the CA certificate needs to be uploaded to the Ewon Flexy, using an FTP program (e.g. FileZilla). The CA certificate should be uploaded in the user directory via a PEM file format.

    On the other hand, if your MQTT Broker uses an official CA certificate, make sure that the name of the MQTT Broker is explicitly assigned in the Alternate Names of the certificate. Wildcard certificates such as *.webfactory-i4.de will NOT work.

  2. Next, you can proceed with installing the BASIC Program on the Ewon Flexy, as follows:

    1. Go to the BASIC IDE menu entry, under the Setup category

      BASIC_IDE_entry.jpg
    2. Upload the SendMQTT.bas file into the Init Section by clicking the Import toolbar button. The SendMQTT.bas file can be download here.

      Import_file.jpg

      Warning

      The upload will be possible only if the script execution is NOT in status Running. To stop the scrip execution, toggle the Script execution button.

      Stop_script.jpg
    3. The Init Section will display the uploaded script. The CONFIG area with the variables is displayed at the top of the script.

      Init_section_script.jpg
    4. Start configuring the variables to fit your needs. To support you, we prepared a configuration example and some explanations:

      Tip

      //############### CONFIG ###############
      ProjectNumber$="Project1"
      MQTTBrokerURL$ = "demo.webfactory-i4.de"
      MQTTPort$ = "1883"
      TLSVersion$ = "tlsv1.2"
      CAFile$ = "/usr/certs/mqtt-ca-root.pem"
      ClientID$ = "webfactory_Ewon_001"
      Username$ = "webfactory"
      Password$ = "Password!"
      TopicToPublishBase$ = "webfactory/" + ProjectNumber$
      Timer1_Group$="60sec"
      Timer2_Group$="15min"
      Timer3_Group$=""
      Timer4_Group$=""
      OnChange_Group$="Alarms"
      Write_Group$="Schreiben"
      Time1_Time%=60
      Time2_Time%=900
      Time3_Time%=900
      Time4_Time%=900
      //############### END CONFIG ###############

      As visible in the above example, the topic tree is started using the variables TopicToPublishBase$ and ProjectNumber$ (in this example: webfactory/Project1).

      The variables MQTTBrokerURL$ and MQTTPort$ are used to configure the MQTT Broker, whereas the Username$ and Password$ can be extracted from the broker. It is mandatory that the user has permission to write to the topic.

      The ClientID$ needs to be unique for each Ewon Flexy device.

      Further on, adapt the CAFile$ to correspond to the filename used at step 1, or simply delete or comment the line out by typing // at the beginning of the line.

      As we shall see in the upcoming steps, the page names are used to group the tags of the Ewon Flexy, as follows:

      • Timer1_Group$ - will send data to the JSON format within a 60 seconds interval

      • Timer2_Group$ - will send data to the JSON format within a 15 minutes interval

      • OnChange_Group$ - will send data to the JSON format each time the value gets changed

      • Time1_Time% to Time4_Time% - define the times to send the tags within the defined interval, seconds wise.

      For all these pages the topic of the MQTT message is extended by the page name. E.g. in the example above the tags of the page "60sec" are sent to the topic webfactory/Project1/60sec.

      The JSON format is defined like this:

      {
      "Signal1": "85.50",
      "Signal2": "10.29",
      "Signal3": "4.80",
      "Signal4": "98.04",
      "Signal5": "91.77",
      "Timestamp": "2019-12-12T16:28:29"
      }

      The Write_Group$ can be written via publishing an MQTT message, in all the tags on the page. These are transmitted via RAW format, which expects a numerical value (e.g. 10.25). The topic is extended with the page name and the tag name.

      For the Write1 tag in the Write page, the following topic will be formed: webfactory/Project1/Write/Write1.

    5. As soon as all the needed variables have been changed, toggle the script execution to RUNNING. If the execution test has passed enable the Autorun option.

      Autorun.jpg
  3. Further on, you need to assign the tags to pages. The tags are managed in the menu Tags under the Values entry.

    Values_menu_entry.jpg

    Note

    The tags can be read via the different IO servers or internally (MEM). The exact configuration depends on the used IO server.

    Please consider the Ewon Flexy documentation, because this part is out of the scope of this tutorial.

  4. In order to enter in edit mode, toggle the MODE button to change the state from VIEW to SETUP.

    Values_setup.jpg
  5. By default, the pages Default and System are available. To add further pages, click on the Plus button.

    Add_new_pages.jpg
  6. Proceed with adding the pages as described in step 2d .

    Tip

    Proposal: add the pages "60sec", "15min", "OnChange" and "Write".

    New_pages.jpg
  7. Using the Add toolbar button new Tags can be added.

    Add_tags.jpg
  8. Further on, by selecting a Tag, the options Edit and Delete are enabled.

    Edit_and_Delete_tags.jpg
  9. Click the Edit button to open the Tag configuration panel and proceed with the Tag name assignment, to the corresponding Page.

    Edit_tag.jpg
  10. To preserve the changes click the Update Tag button at the bottom of the Tag configuration panel.

    Update_tag_button.jpg
Setup of i4connected

After the Ewon Flexy has been organized we need to proceed with the i4connected setup. At the level of i4connected, each MQTT Broker needs one MQTT Adapter for the JSON-Format and one for the RAW format.

The MQTT JSON-format Adapter
  1. Go to the i4connected Admin page and click on the Devices tile.

  2. In the Device List panel click on the Add toolbar button.

    Add_device_button.jpg
  3. In the Select Device Type panel, click on the MQTT tile.

    MQTT_Device_type.jpg
  4. In The Add Device panel, start filling in the Device info:

    JSON_Device.jpg
    1. Set the Device Name

    2. Set the Device Site, Area , and Organizational Unit.

    3. Add the Topic extracted from the Ewon Flexy device (for the current example we shall set the topic to webfactory/Project1.

    4. Click on the Select Adapter field to define the JSON format MQTT Adapter:

      1. In the Select MQTT Adapter click on the Add toolbar button.

      2. In the Add MQTT Adapter panel start filling in all the required information and make sure that the Adapter is set to JSON format.

        mqtt_flexy.jpg

        Tip

        More information about the MQTT Adapter can be found in this article.

      3. Click on the Save button to preserve all the changes made.

    5. After saving the new MQTT JSON-format Adapter, it will be visible in the Select MQTT Adapter panel.

    6. Select the new MQTT Adapter and save the Device.

  5. The new MQTT Device with JSON format Adapter is saved and will be opened in detailed view mode.

  6. Click on the Signals tile to proceed with the MQTT Device configuration.

    Signals_for_JSON_Adapter.jpg
  7. The Signal List panel is opened empty. At this step, our goal is to add new Signals to the Device and connect them to the Ewon Flexy tags.

    1. Type in the Signal Name.

      Tip

      The i4connected Signal names do not need to be the same as in Ewon Flexy. Any naming can be defined here.

    2. Go to the MQTT Settings and fill in the settings extracting them from Ewon Flexy, as explained in step 2d.

      MQTT_settings.jpg

      Tip

      For more details about the MQTT Signal settings please also visit this article.

      1. Assign the Signal Type as needed.

      2. Topic to the page of the tag in the Ewon Flexy (e.g. 60sec)

      3. Value should be the name of the tag in the Ewon Flexy (e.g. Signal1)

        Value_JSON.jpg
      4. Timestamp should be the Timestamp in the Ewon Flexy (e.g. Timestamp)

        Timestamp_JSON.jpg
    3. Save the Signal and repeat the same steps for all the Ewon Flexy tags, except for the ones on the page Write or the name of the page you set for Write_Group$.

  8. After adding all the needed Signals you can close the MQTT JSON-format Device details panel and proceed with the next steps, described below.

The MQTT RAW-format Adapter

Tip

The RAW format is only necessary if you want to write data back into the Ewon Flexy tags.

  1. Go to the i4connected Admin page and click on the Devices tile.

  2. In the Device List panel click on the Add toolbar button.

    Add_Device.jpg
  3. In the Select Device Type panel, click on the MQTT tile.

    MQTT_Device_type.jpg
  4. In The Add Device panel, start filling in the Device info:

    RAW_Device.jpg
    1. Set the Device Name

    2. Set the Device Site, Area , and Organizational Unit.

    3. Add the Topic extracted from the Ewon Flexy device (for the current example we shall set the topic to webfactory/Project1/Write.

    4. Click on the Select Adapter field to define the JSON format MQTT Adapter:

      1. In the Select MQTT Adapter click on the Add toolbar button.

      2. In the Add MQTT Adapter panel start filling in all the required information and make sure the Adapter is set to RAW format.

        MQTT_Adpter_Raw_format.jpg

        Tip

        More information about the MQTT Adapter can be found in this article.

      3. Click on the Save button to preserve all the changes made.

    5. After saving the new MQTT RAW-format Adapter, it will be visible in the Select MQTT Adapter panel.

    6. Select the new MQTT Adapter and save the Device.

  5. The new MQTT Device with RAW format Adapter is saved and will be opened in detailed view mode.

  6. Click on the Signals tile to proceed with the MQTT Device configuration.

    Device_with_RAW_detailed_view.jpg
  7. The Signal List panel is opened empty. At this step, our goal is to add new Signals to the Device and connect them to the Ewon Flexy tags.

    1. Type in the Signal Name.

      Tip

      The i4connected Signal names do not need to be the same as in Ewon Flexy. Any naming can be defined here.

    2. Go to the MQTT Settings and fill in the settings extracting them from Ewon Flexy, as explained in step 2d.

      Write1_topic.jpg

      Tip

      For more details about the MQTT Signal settings please also visit this article.

      1. Assign the Signal type as needed.

      2. Topic to the name of the tag in the Ewon Flexy (e.g. Write1)

    3. Save the Signal and repeat the same steps for all the remaining Ewon Flexy tags in the Write_Group$ page.

  8. After adding all the needed Signals you can close the MQTT RAW-format Device details panel.

    Important

    In order to write Signal values, a SCADA page should be integrated into i4connected.

Using the self parameter when working with Virtual signals
Abstract

Check out this article and learn how you can use the "self" parameter when working with i4connected Virtual Signals.

The "self" parameter is a representation of the current virtual signal, allowing you to access the last value of that virtual signal, without the need to reuse the same virtual signal as an input parameter. By calling it through the script formula, it can supply additional benefits for various use cases.

  1. Open a hierarchical entity in detailed view mode, and access the Devices list.

  2. Select your Device in detailed view mode, and click on the Signals tile.

  3. In the Signals List panel, click the Add virtual signal toolbar button.

    Add_virtual_signal.jpg
  4. In the Add Virtual Signal panel proceed as follows:

    Add_virtual_signal_panel.jpg

    Tip

    The "self" parameter is displayed in the Virtual signal configuration section. Since we are in add Virtual signal mode, a real representation of it does not yet exist.

    1. Make sure the virtual signal is Active.

    2. Type in the name of the new virtual signal.

    3. Click the Save button.

  5. Next, open the previously created Virtual signal in edit mode.

    Tip

    You will now recognize that the "self" parameter now refers to the current Virtual signal.

    Edit_sefl_param.jpg

    With a simple check you can verify if it is returning the expected value:

    Self_1.jpg
  6. Add a second parameter, by clicking the Add parameter button, in the Virtual signal configuration section. This will open the list of Signals used by the current Device, allowing you to choose the desired Signal.

    Signal_list.jpg
  7. The new parameter is added to the Virtual signal configuration section.

  8. Now, you can proceed with writing the script formula that suits your use case. To verify your formula, click the Calculate test result button. The result will be returned at the bottom of the inserted Formula.

    Tip

    Even though various use cases can be fulfilled using the "self" parameter, here are some examples:

    in1 + self
    self_2.jpg
    {
    return self + 5;
    }
    self_3.jpg
    { 
    return self.Value + in1;
    }
    self_4.jpg
  9. If your script formula is not correct, the system will notify you by posting the "Error compiling script" result.

  10. Make sure to save your changes, by clicking the Save button.