Using Aware Electronics Aw-Radw to Send E-mails and Text Messages when Radiation Alarm is Triggered

and/or every X number of points (See bottom of this page)

Instructions below involve copying and pasting to a batch file. When copying from an http file like this one, sometimes every line copied and pasted will have an extra space character at the end of the line which would disrupt the batch file execution. To avoid this, copy from the text file found here: email_alarm.txt

Example steps to follow for setting up Aw-Radw to send E-mails and Text Messages when Radiation Alarm is triggered.

This example will send E-Mails and/or Text Messages with alarm that includes two attachments to the messages. The first attachment is a text file contaning summary data about the current conditions. The second attachment is a gif graph image of the radiation data.

Download from here: Blat Download the zip file that contains Blat.exe and its files and unzip to a folder on your PC, for example C:\SENDMAIL\BLAT

The following example assumes your copy of BLAT.EXE, BLAT.LIB and BLAT.DLL reside in folder C:\SENDMAIL\BLAT

The example also assumes your copy of Aw-Radw.exe resides in the folder C:\AWARE. It also assumes the copy of Aw-Radw that is gathering the radiation data is saving the data to a Aware binary radiation file.

Use Windows NotePad to create a batch file as follows. Start NotePad and enter (or paste) the following, each on its own line:

REM **********Start of Batch File**********
@echo off
title Sending Alarm E-Mail

REM Make a GIF graph of the current radiation data which includes the latest 1000 points
REM Omit this line if Aw-Radw is not saving data to an Aware binary file
start /min /wait C:\AWARE\AW_RADW -R%3 -GC:\SENDMAIL\email_graph.gif -P1000

REM Make sure the default drive for this batch file is C:
REM i.e. the drive where BLAT.EXE is

REM Make sure the default folder for this batch file is where Blat.exe is

REM Set the mail server name and port to use.
REM Find these in your e-mail program i.e.:
REM Tools-Accounts-Mail-Properties-Servers-Outgoing Mail
REM and Outgoing Mail Server Port Number


REM Set the From e-mail address

REM Set the To E-mail address

REM Set the cc E-mail address

REM Set the E-Mail's subject to first command line argument (from Aw-Radw)
set subject=%1

REM Ditto for the message body
set body=%1

REM Set two file attachments. First attachment is second command line argument from Aw-Radw and second argument is the graph.

set attach=%2,C:\SENDMAIL\email_graph.gif

REM If Aw-Radw is not saving data to an Aware binary file, then just attach the summary text file as in:
REM set attach=%2

REM Have E-mail program generate a log file
set debug=-debug -log blat.log -timestamp

REM Now send the E-mail by running Blat:

start /min /wait C:\SENDMAIL\BLAT\BLAT.EXE -server %server% -f %from_email% -t %to_email% -c %cc_email% -s "%subject%" -body "%body%" -attach %attach% %debug%

REM **********End of Batch File**********

Now save the NotePad file with a name of SEND_MAIL.BAT in the folder C:\SENDMAIL\BLAT i.e. C:\SENDMAIL\BLAT\SEND_MAIL.BAT

Now setup Aw-Radw to run the SEND_MAIL.BAT when the alarm is triggered:

Start or switch to the Aw-Radw which will be gathering your radiation data.

Click menu item: "Alarm Options" and set all the options as desired (See Aw-Radw's help file).

Click menu item: "Alarm Options" - "Choose Alarm Program" then "Files of Type" and choose Bat. Browse to your C:\SENDMAIL\BLAT\SEND_MAIL.BAT and click to select it.

Click menu item: "Alarm Options" - "Command Line Argument for Alarm Program" and enter the following with the quotes:

"Radiation Alarm Loc. 1: % `" $ #

This will cause Aw-Radw to include three arguments when launching the batch file. The first argument will be along the lines of "Radiation Alarm Loc. 1: 300 CPM".

The second argument $ will cause the formation of a "SUMMARY.TXT" file within the current folder, containing information such as Program Window Title, Computer name, all the information within the summary window followed by each line of text in Aw-Radw's main window. The $ will be replaced within the command line with the complete short form path to the SUMMARY.TXT file.

The third argument # will be replaced with the complete short form path to the current binary radiation data file.

Click menu item: "Alarm Options" - "Alarm Program Yes-No" - and click to check "If High Alarm Run Program" and also click to check "Run Alarm Program Minimized".

To save the settings in Aw-Radw, either close the program normally or menu item: "Screen" - "Program Defaults" - "Save Current Setting"

Start Aw-Radw collecting your radiation data. If the high alarm is triggered, it will send the e-mail(s) as per C:\SENDMAIL\BLAT\SEND_MAIL.BAT


Please read Aw-Radw's help file to learn more about Aw-Radw's command line arguments used at the top of the batch file to generate the GIF graph.

Note the graph generated for the E-mail will include all Aw-Radw and Aw-Graph defaults, that is, using the default Bitmap window size, default Aw-Graph colors, etc. Set these as desired i.e. from the Aw-Radw program used to generate the graph, open the bitmap graph (Aw-Radw's menu "Graphs" - "Open Aw-Graph's Bitmap Graph") and then size the window as desired, then close the graph.

If running under 64 bit Windows, be sure to click to check Aw-Radw's menu "Graphs" - "Use DosBox to launch Aw-Graph"

Also see the help file for more information about the $ and # characters used in the "Command Line Argument for Alarm Program" instruction above.

To send TEXT messages to a cell phone, enter the cell phone's TEXT message address instead of an E-mail address, for example See: Send E-Mails to Phone for examples.

If you look at this file: Blat Syntax notice additional switches Blat.exe responds to including:

-U (username) and -pw (password)

If these are not included in the argument list passed to Blat.exe, as per the above example batch file, Blat.exe will use the username and password stored in the Registry. Also note Blat.exe, with the appropriate switches, can E-mail to an unlimited number of E-mail addresses using a recipient list file.

If one wants to be extra sure the E-mail(s) will reach the recipient(s), one could send them twice by duplicating all the lines in the above batch file with, for example, the line "C:\AWARE\W-SLEEP 20" between the two sets of lines i.e. the first set of lines in the batch file will send the e-mails, then w-sleep 20 will cause the batch file to sleep for 20 seconds, then the second set of lines in the batch file will send the same e-mails again.

There are other free e-mail programs available that can be used instead of Blat.exe. For example SendEmail.exe available for download here: SendEmail Program (Download the zip file that contains SendEmail.exe and its files and unzip to a folder on your PC, for example, C:\SENDMAIL\SENDEMAIL)

Additional Notes: Using Aw-Radw's “Trigger a program every X points” Feature to send E-Mails - Text Messages

The same technique as detailed above can be used to send E-Mails - Text messages with graphs, etc., once per X number of points as follows. Set Aw-Radw to trigger the batch file from the menu item: “Output Options” – “Trigger a program every X points” – “Choose Trigger Program” and browse to your C:\SENDMAIL\BLAT\SEND_MAIL.BAT or another batch file and click to select it.

Set the menu item: “Output Options” – “Trigger a program every X points” – “Command Line Argument for Trigger Program” and enter the string as per the above example except perhaps along the lines of "Daily Report From Loc. 1: % `" $ #

Click menu item: “Output Options” – “Trigger a program every X points” – “Choose Number of Points per Trigger” and enter the desired number. For example, to receive one E-mail per day and with a TBU of 60 seconds, enter 1440.

Actual E-Mail received using above technique:

E-mail Received

Phone:(800)729-5397 or Phone/Fax: (302)655-3800

To return to the previous page, use your browser's BACK button.

Return to index page?