19 - 11 - 2017

Internet library

Block MailSender

The difficult question about how to send e-mail is easy resolved with block SendMail. When the input DoSend become to hight value, the SCADA software will try to send a e-mail.

 

Parameters related with Mail Server:

  • Server - host address of mail server. For example smtp.gmail.com
  • Port - port of the mail server. 25 is SMTP port without SSL connection, 465 is SMTP port with SSL connection;
  • UserName - User name of the mail account, for gmail is e-mail addres. For expample This email address is being protected from spambots. You need JavaScript enabled to view it.
  • PassWord - pass word of the mail account;
  • SenderEMail - e-mail of the mail account: This email address is being protected from spambots. You need JavaScript enabled to view it.
  • SSL - Yes/NO regarding using of SSL connection or not;

Parameters related with sending e-mail:

  • RecipientMail - e-mail address of the recipient;
  •  RecipientName - name of the recipient
  • Subject - the subject of the e-mail;
  • Body – the text of the e-mail. It can be multiline;
  • AttachedFile - full path and name of the attached file. Optional;
  • MinPeriodToSendMail - a minimal period in seconds, which protect an e-mail account from sending too many e-mails. If several events OnSend occured in this period, ony the first will be send. When the period expired, a new e-mail can be send.

The block SendMail has a parameter Inputs, which allows many inputs from type Digital, Analog, Integer and String to be added to the block. These inputs allow some parameters to be changed from the running SCADA process. The paremeters are: RecipientMail, RecipientName, Subject, Body, AttachedFile. If in the text of the the mentioned parameters is included a name of the block's input in brakets <>, then the value of input will appears into the text of the parameter.


Let see how the demo diagram SendMail.nsm works. The value of parameter Body is:
Temperature=<Temp;2>
The yard lamp is <Lamp>
Electrical boiler is currently <Boiler>
The season is <Season>

When the input DoSend becomes to hight value, the tags with <Block input name> will be changed with theirs values, so the result mail's body would be:

Temperature=12.45
The yard lamp is On
Electrical boiler is currently Off
The season is Summer

Pelase note:

  • for Analog input type, after name of input, number of digits after dot can be added: <Temp;2> means two digits after dot in replaced string in mail's body;
  • for Digital input type is possibe to be added meaning of Hight or Low value of the input signal: <Lamp;Turn on;Turn off>


At the demo diagram, the value of parameter RecipientMail is <mail>. This means when the input DoSend becomes to hight value, the value of parameter RecipientMail will be gotten from the value of input mail.

How to send e-mail via GMail account:
In order to allow AltoLab to send e-mail via GMail, some settings have to be set in GMail account:  go to GMail Settings -> Accounts and Import -> Other Google Account settings. Then in Signing section click to Access for less secure apps. This property has to be set to Turn on.

Google's SMTP server requires authentication, so here's how to set it up:

  • Server (i.e., outgoing mail): smtp.gmail.com
  • Username: Your full Gmail or Google Apps email address (This email address is being protected from spambots. You need JavaScript enabled to view it. )
  • Password: Your Gmail or Google Apps email password
  • SMTP port: 465
  • SMTP TLS/SSL required: yes


In order to store a copy of outgoing emails in your Gmail or Google Apps Sent folder, log into your Gmail or Google Apps email Settings and: 6.Click on the Forwarding/IMAP tab and scroll down to the IMAP Access section: IMAP must be enabled in order for emails to be properly copied to your sent folder.

Sending Limits:
Google limits the amount of mail a user can send, via its portable SMTP server. This limit restricts the number of messages sent per day to 99 emails; and the restriction is automatically removed within 24 hours after the limit was reached.


 

Block InternetChecker

Tests the computer’s internet connection. The block tries to ping first URL, then second. If both do not reply the output gets low level which means there is no internet.

Parameters:

  • FirstURL - the first internet address for ping;
  •  SecondURL - the second internet address for ping. Optional;
  • CheckPerMin - the first and second URL will be checked at a period of the entered number of minutes;
  • WithOutStringInRes – Some WiFi routers would return to the computers an HTML with information that the connection is lost when this happens. If the text in this parameter exists in the returned text from the URL this would mean the router has lost connection;
  • ShowMessageOnCheck - Show a text message on the right blue area of the application whenever a connection check occurs;
  • WriteHTMLToFile - Write the received HTML to a file called NiSimIChecker.txt in the current directory of NiSim.exe;