SMTP

Supported hardware and firmware

Cloud Logging via SMTP is supported on the x500 in firmware 3.10 and up. Please upgrade your firmware if you are running an older version.

Activate Cloud Logging

Please first activate Cloud Logging (or start the 30 day free trial) if you haven't already.

The second 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, instead of to a public cloud SMTP server. The SMTP catcher will then pass on a part of this e-mail to 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 or push notification on their phone using Cloud Notify. The Lenze mobile app needs to be installed on the phone to receive push notifications.

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’s SMTP catcher.

  • Open your system’s SMTP server settings and enter the x500’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 will use to communicate with the PLC.

  • Go to the Fleet Manager app, which is accessible from the Apps menu in the top right corner if you are currently in a different X4 Remote app.
  • Open the Main menu, go to Devices, and select the concerning device.
  • Click on the Add a service icon in the left menu, select [Data source], and then select [SMTP/GPIO].
  • Enter the requested information (details below) and click on [Add].
Field Description / instructions
Name Enter a name for the data source.
Identifier

The identifier ensures that every data source remains unique, even if they share the same name.

IP address Leave this field empty.
Polling sleep time Leave this field to “None”.

Add variables

Once you’ve added a data source and selected a communication protocol, you can start adding variables. You can do this by following the steps below:

  • Expand the Data source service and go to [Variables].
  • You can now choose to:
    • Manually add new variables
    • Import variables from a file (or device) 

Manually add new variables

  • Click on [Add variable] in the bottom right corner.
  • Enter the requested information (details below) and click on [Add].
Field Description / instructions
Name Enter a name for the variable.
Identifier The identifier ensures that every variable remains unique, even if they share the same name.
Type Here you select the applicable variable type. Options are Boolean and String. Boolean: TRUE when received an email containing keywords. String: pass on content of e-mail depending on selected action.
Length (for String data types only) Enter the number of characters the action should pass on (max. 255).
Protocol Select SMTP.
Action Select the content from the original e-mail you want to pass on.
Keywords Leave empty to trigger on every e-mail or enter a keyword to only trigger on e-mails containing this keyword.

Temporary disconnect

After this next step, the config push, the device may temporarily disconnect and LAN communication may be temporarily interrupted while it's applying the new settings. This may take a minute.

You have now made the changes in X4 Remote, but these are not yet active in your device. You will need to push your changes to your device for them to take effect.

  • Click [Push config to device] in the top right corner.

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 article.

  • Click on [Import from CSV-file] in the top right corner of the screen.
  • Select a CSV file to import and click on [Open].

Temporary disconnect

After this next step, the config push, the device may temporarily disconnect and LAN communication may be temporarily interrupted while it's applying the new settings. This may take a minute.

You have now made the changes in X4 Remote, but these are not yet active in your device. You will need to push your changes to your device for them to take effect.

  • Click [Push config to device] in the top right corner.

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 displays each variable’s current value if everything is configured correctly and the PLC sends an e-mail. If not, the values will stay empty. The test utility will attempt to update values every 0.5 seconds, regardless of how often it’s actually being logged (this does not count towards your license’s dps/hr). Please follow the steps below to test your variables.

  • Expand the Data source service, go to [Variables], and click on [Run test] at the top.

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

Port Transport protocol Application protocol
443 TCP WebSocket

You will see live values of all variables, if the configuration is set up correctly and the PLC sends an e-mail, otherwise the values will stay empty.

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 on the variables page:

  • Expand the Data source service and go to [Variables].

You can [Edit] individual variables, [Remove] individual or a selection of variables, and export all or a selection of variables.

Variables can be selected by clicking the checkbox on the left, or you can select them all by clicking the checkbox at the top.

 

Контактная форма