UM-0085-B09
DT80 Range User Manual
Page 107
RG
Unloads can also be sent via email. In this case the data file is included as an attachment to the email.
Specifying an email destination is similar to FTP, except that a
mailto:
URI is used. This has the form:
mailto:
recipient-email
?priority=
priority
&subject=
subject
&body=
body
&interface=
interface
where:
•
recipient-email
is a comma-separated list of up to 5 email addresses in the usual format (e.g.
jake@peg.edu.au
). Note that there is no extra overhead in sending an email to multiple addresses – the
data is only sent once and the delivery to the required recipients is handled by the Internet email system.
•
priority
is
high
,
normal
(default) or
low
. A high priority message will be sent as soon as possible, with the
"high importance" flag set (typically displayed as an exclamation mark in email clients). A normal priority
message is also sent as soon as possible, but without the "high importance" flag. A low priority messages will
be queued and sent when a communications session next starts. (If a communications session is already active
then it will be sent immediately.) If the Ethernet interface is used then all messages are either high or normal
priority – if low priority is specified then normal priority is assumed
•
subject
is a string to use as the subject of the email. If not specified then "
dataTaker SN
serial
alarm
" is
used as the subject (where
serial
is the
DT80
serial number).
•
body
is a string to use as the body of the email. If not specified then the alarm action text is used.
•
interface
is applicable to DT8xM models only, and specifies the network interface to use:
modem
(default), or
ethernet
. For models without internal modem, Ethernet is always used and this option is ignored.
The format of this URI is identical to that used for email alarms (see
)
See
Communications Sessions (P222)
for more details about how email transmission is managed.
Note:
No more than 12 separate emails can be queued; any subsequent attempts will be discarded (a message will be written to the
event log, and the
start=new
pointer will not be updated, so the next unload will contain additional data).
For example, the following has
merge=n
set, so it will send two emails (one for schedule A's data, one for schedule B).
Each email will be directed to two recipients.
COPYD merge=n sched=AB dest=mailto:harpo@marx.org,groucho@marx.org
If
merge=y
had been used then each recipient would get a single email with a single merged file attached, containing
data from both schedules.
Unload Destination Replaceable Parameters
The
dest=
option can include embedded
replaceable parameters
. These are special text sequences which will be
replaced with dynamic values when the unload command is processed. The following replaceable parameters may be
used:
Parameter
Substitutes the following
Example
?(timestamp)
time (
yyyymmdd
T
hhmmss
) at which unload started
20110414T120344
?(seq)
3-digit sequence number
007
?(serial)
6-digit
DT80
serial number
089999
?(
n
CV)
value of channel variable
n
CV
(integer part only)
23
?(
n
$)
value of string variable
n
$
ABCD
For example,
COPYD dest=ftp://bee@ftp.honey.net/data/?(serial)/?(timestamp).csv
will write files such as /data/081122/20110104T030001.csv on the FTP server.
In the following example a very similar job is deployed to a number of different sites – the only difference being that the
first line of each job sets string variable 1$ to a unique site code (e.g. "BKLO" or "CTVA"). Then the following command
is placed in ONINSERT.DXC on a USB memory device:
COPYD dest=a:\?(1$)\
When this is plugged into the logger it will generate files such as \BKLO\002_20110202T112233.csv on the USB device.