0304-01 E-mail Notifications
Example Projects > 0304 External Programs > 0304-01 E-mail Notifications
EPC - sending e-mail notifications from Linux
This is an example on sending e-mail notifications from Linux machines. The example is based on the EPC function block, which requires a licence for advanced function blocks.
For basic e-mail notifications please refer to example 0202-10 on using the SMTP function block.
The execution of the external program is triggered by the EXEC input of the EPC function block. In this example the external program is a Python script located in /rex/data/email_notification.py (the cmd parameter of the EPC function block).
Timing of the project
The algorithm runs each 500 milliseconds (0.5 s). See the EXEC function block,
tick x ntick0 = 0.1 x 5 = 0.5
- REXYGEN Runtime Core and AdvBlk modules must be installed and running on the target device.
- A valid licence for advanced function blocks is required.
- Configure e-mail settings in the .py file.
- Copy the .py file to /rex/data/ on the target device.
Running the example
- The *exec.mdl file is the project main file.
- Open it with REXYGEN Studio, compile and download it to the target device.
- Switch to online mode and watch the algorithm.
- Enable online monitoring of the EPC block (Target->Watch Selection).
- Change MP_TRIGGER:BSTATE to ON.
- Check your inbox for incoming e-mail notification.
- Run MP_TRIGGER:BSTATE again to send another e-mail.
- Press F1 for help on the selected function block in the REXYGEN Studio.
- EPC function block documentation
- Function blocks of REXYGEN
- REXYGEN Studio User Guide
- Complete documentation of REXYGEN
- Visit the REXYGEN webpage for more information about the example projects and developing advanced automation and control solutions using REXYGEN.