ATSCADA Advanced Programming: Email, SMS programming

In the SCADA applications, sometimes you need to send notifications email or SMS to your cell phones to know what your machines or processes are doing when you’re not in front of them. Let’s find out how Email, SMS programming on ATSCADA software

Email, SMS programming

Here is an example about sending email notifications and SMS using ATSCADA Alarm Tools by c# language.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.Windows.Forms;
using ATSCADA;
using System.Net.Mail;
using System.IO;

namespace EmailSMSProgramming
{

public partial class Form1 : Form
{

public Form1()
{

InitializeComponent();

}
private void btSendEmail_Click(object sender, EventArgs e)
{

ATSCADA.iWinTools.iEmail email = new ATSCADA.iWinTools.iEmail(); // Create email object
string toEmail = “example@gmail.com“;
email.Message.To.Add(toEmail); // Recipients email ID

email.Message.Subject = “Email Subject“; // Email Subject
email.Message.Body = “Text body“; // text body

//Attach files
if (File.Exists(@”C:\Program Files\ATPro\ATSCADA\Reports\DataGeneral” + “.xls”))
{

Attachment _data = new Attachment(@”C:\Program Files\ATPro\ATSCADA\Reports\DataGeneral” + “.xls”);
email.Message.Attachments.Add(_data);

}

//Send email
email.SendEmail(); // send email to recipients
email.Message.Dispose();
email.Dispose();

}

private void btSendSMS_Click(object sender, EventArgs e)
{

//SMS
ATSCADA.iWinTools.iSMS sms = new ATSCADA.iWinTools.iSMS(); // create SMS object
sms.COMPort = “COM11.115200.8.None.One”; // set port for SMS modem
sms.Message = “message content”; // message content

string recipient = “your phone number”; // recipient phone number
sms.Close();
sms.Open();
sms.sendMsg(recipient.Trim()); // send SMS to recipient
sms.DeleteMsg(); // clear SMS
sms.Close();
sms.Dispose();

}

}

}

>> ReferenceEnglish – Traning Cources

Contact:

If you are interested in Email, SMS programming on ATSCADA software. Please contact ATSCADA Lab hotline for quick support.

Thank you.

ATSCADA việt nam

ATSCADA - Providing ATSCADA software - The monitoring and data acquisition control system is the appropriate choice for integrated system projects, IoT, smart city projects, agriculture 4.0... Is trusted by many customers.

Related posts

ATSCADA Installation Guide

Video ATSCADA Installation Guide The following video shows the steps of ATSCADA installation. If having any [...]

ATSCADA – Software Architecture

Tìm hiểu về ATSCADA – Kiến trúc phần mềm ATSCADA được thiết kế trên KIẾN [...]

ATSCADA Graphic Tools

ATSCADA Graphics Tool Guide ATSCADA Graphic Tools: iGraphic, iImageButton, iGauge, iHBar, iVBar, iMotion Picture, iRealtime [...]

ATSCADA Custom Usercontrol programming

In this section, I’ll show complete demo of how to create Custom User Control in [...]

ATSCADA Advanced Programming Tag Events

In advanced programming, we usually use tag events to do some duties, we have two [...]

ATSCADA Advanced Programming Tag Read/Write

In advanced programming, sometimes we need to read the tag value or write the tag [...]

Leave a Reply