Getting a single tag value and sending in email


I have a Flexy 205 setup with an Allen Bradley PLC attached to it. I am able to see tag values and send alarm emails and such. Tags have been created in the Flexy.

I understand that the planner makes it easy to send an email on a schedule. I have been able to get it working without a problem. There is a totalizer value being read from the PLC to the Flexy. My question: is there a way to send this tag value in an email, either with the planner or through BASIC scripting?


You can create a BASIC script that can send the value like in the following document.

You could also send the value out when an alarm is triggered.


Thanks for your feedback.

Is there a way to have the tag value written directly in the email rather than in an attached file?

(i.e. have function run ONDATE, then sendmail, “myemail”,"",“weekly total”, “”)


This is what you can do for a value and change the ONCHANGE to the trigger you need.

Onchange “Email_Example”, “@tagmail()”

Function tagmail()

$EmailTo$ = ""

$EmailCC$ = ""

$EmailSubject$ = “Daily Report”

$EmailBody$ = “”

$EmailBody$ = $EmailBody$ + "Value of First Tag is " + STR$ Tag_name@ + CHR$(13) + CHR$(10) // the CHR$(13) + CHR$(10) is the same as newline

$EmailBody$ = $EmailBody$ + "Time: " + TIME$ + CHR$(13) + CHR$(10) // Gives the full date when this was sent

If Email_Example@=1 Then

SENDMAIL $EmailTo$, $EmailCC$, $EmailSubject$, $EmailBody$




Thanks Zach, I will try this on Monday.

Having another issue, not sure if I should start a new thread or not. When I sync the time in my Flexy to my PC, the device tends to go offline and requires a power cycle to reset. Any ideas?


I am not sure what you mean by sync the time to the PC but you can use are ntp server for time syncing of the flexy.