SMTP

The first step in Cloud Logging is setting up a data source. This is done by selecting a communication protocol and defining the variables. This article shows you how to do this for communication via SMTP.

In short, it works as follows: your system sends an e-mail to the SMTP catcher inside the x500 IoT gateway, instead of to a public cloud SMTP server. The SMTP catcher will then pass on a part of this e-mail to the X4 remote. You can configure what you’d like to pass on.

For example, let’s say you configured a variable to search for a text pattern (i.e. “Description:”) and the original e-mail contains the following text:

Alarm triggered
Description: Valve C6 opened during operation. Machine has entered error state.
Code: 153

The SMTP catcher will search for the pattern “Description:” and return the text following this pattern until the end of that line. This means the following value will be passed onto the variable:

Valve C6 opened during operation. Machine has entered error state.

This value can be logged using Cloud Logging or sent to users via an e-mail.

System settings

Instead of sending the e-mail to a public cloud SMTP server, the system will have to send the e-mail to the x500 IoT gateway’s SMTP catcher.

  • Open your system’s SMTP server settings and enter the x500 IoT gateway’s LAN IP address as “SMTP server address”.

Select a communication protocol

You first have to select a communication protocol. This is the protocol that the x500 IoT gateway will use to communicate with the PLC.

  • Go to [Devices] in the main menu, select the concerning device, open its [Services] tab, and press [Add service].
  • Name the PLC, enter the PLC’s IP address, and press [Next].
  • Select your service type: [Data source].
  • Select the communication protocol “SMTP / GPIO”. Press [Add].

Available datatypes

X4 Remote supports the following datatypes when using SMTP or GPIO:

  • BOOLEAN
  • STRING (SMTP only)

Add variables

Once you’ve added a Data Source and selected a communication protocol, you can start adding variables. This is done in the configurator tool, specifically designed to quickly addduplicateimportexport, and remove variables.

  • Go to [Devices] in the main menu, select the concerning device, open its [Services] tab, and edit  the target’s services.
  • Select [Data source] and press [Open configurator].
  • To add a variable press [Add variable].

Tip!

It is advisable to add variables in small batches and test the variables periodically to verify the entries.

You can choose to:

Manually add new variables

When you press [Add new variable] you’ll see the window that is depicted below.

  • Enter a name (i.e. “SMTP Catcher – High priority e-mails”), select the “SMTP” protocol and configure which data from the original e-mail you’d like to pass on with the settings typelengthaction, and keywords, and press [Add]. The image below contains explanatory text for each setting.

Tip

You can create 3 separate variables with each 1 keyword (i.e. high, medium, or low, depending on the content of your e-mails). You can then link a data tag to these variables to only log data when it’s a high, medium, or low urgency e-mail.

Duplicate

You can easily duplicate this variable if you’re adding variables that are only slightly different. This way you’ll only have to make small adjustments.

Temporary disconnect

After this next step, the config push, the device will temporarily disconnect to reconfigure its settings and will automatically reconnect. This may take a minute.

  • Press [Push changes] in the config tab to complete the setup.

Next step

Now that you’ve added the variables, you can test if they’re configured properly.

Import variables from a file (or device)

You can easily and effortlessly copy variables from one device to another by exporting the concerning variables (view the “Manage variables” part of this article) and then importing them in your new device. Alternatively, you can manually prepare your variables in the required CSV format to load them all at once into your configurator. The CSV file structure is explained in our “Import variables: CSV file structure“-article.

When you press [Import from CSV-file], you’ll see a browse window.

  • Select a CSV file to import and press [Open].
  • When the file has been read, press [Add] to add all variables to your data source.

Temporary disconnect

After this next step, the config push, the device will temporarily disconnect to reconfigure its settings and will automatically reconnect. This may take a minute.

  • Finally, press [Push changes] in the config tab to complete the setup.

Next step

Now that you’ve added the variables, you can test if they’re configured properly.

Test variables

The test utility is used to check if all the added variables are set correctly. It shows the status of every variable and displays the variables’ latest values if everything is configured correctly. If not, it’ll show an error message.

  • In the configurator press [Run test].

A connection will now be set up to stream the data directly to your computer, using:

PortTransport protocolApplication protocol
443TCPWebSocket

When the connection is set up and all variables are set correctly, it should look like this:

Unexpected Result?

If the test utility shows unexpected values, please check if the addresses and data types of all variables are entered correctly.
If you get no data at all, please also check that the above listed port and protocols are not being blocked by your computer’s or company’s firewall.

Next step

Now that you’ve tested the variables, you can view our “Configure data tags” guide to start logging.

Manage variables

You can view all defined variables in a list view or table view. Multiple variables can be selected by pressing the  icon on the left, or you can select all by pressing […]. These can then be removed, duplicated, or exported to a CSV file.