Viewon export

Do you just want to change something like the body of the email? This can be done in viewon and you could have the Flexy read the value of that button press.

For the button you could do an Onchange and make it so when the button is pushed it will send out an email

No, I don`t want to change the body of the email, I don’t want to write anything on it. I only want to have a file with the same header in all of the sends and include some information when I pressed the button.

Yes, I alredy detected the button’s pulse with BASIC IDE.

This line of code from the doc above should be able to give you the time that the email was sent which should correspond with the time the button was pressed

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

You could just have it so that it the remaing sections are left blank, like this

sendtoamc.txt (619 Bytes)

Thank you!! One more question…

ONALARM “envio”, “GOTO envio_LABEL”
envio_label:
If (envio@= 1) THEN

IsFile% = FS "touch", "/usr/fileToSend.txt"
PRINT IsFile%
// returns -1 if "fileToSend" exists
// returns 1 if "fileToSend" doesnt exist and creates it as a file

     IF (IsFile% = 1) THEN
        OPEN "file:/usr/fileToSend.txt" FOR TEXT APPEND AS 1
        PUT 1, " Se realiza un histórico de los distintos valores tomados por las variables cada vez que se presiona el botón de envío" +  CHR$(13) + CHR$(10)
        PUT 1, " MIESA " + ";" + " 2019 " + ";" + " Flexy 205 : eWON " +  CHR$(13) + CHR$(10)
        PUT 1, Time$ + ";" + " Variable suma " + ";" + STR$ suma@ + ";" + " Variable resta " + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
        REM PUT 1, Time$ + ";" + "Variable resta" + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
        CLOSE 1
      ENDIF

      ELSE    
          OPEN "file:/usr/fileToSend.txt" FOR TEXT APPEND AS 1
          PUT 1, Time$ + ";" + " Variable suma " + ";" + STR$ suma@ + ";" + " Variable resta " + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
          REM PUT 1, Time$ + ";" + "Variable resta" + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
          CLOSE 1
      ENDIF

   PRINT "Archivo creado"
   SENDMAIL "anacollada@opendeusto.es", "", "Archivo","&[$dtUF$uf/usr/fileToSend.txt$fnArchivo.txt]"

ENDIF
END
Rem — eWON user (end)
End
Rem — eWON end section: Init Section

I have this program to send an email when an alarm(envio) is happend.

But I have an error:
variable not found(16) 15: IsFile% = FS “touch”, “/usr/fileToSend.txt”

Do you find the error?

Hello @amc,

I don’t see anything wrong with this program. Are you able to run the line
IsFile% = FS "touch", "/usr/fileToSend.txt" from the console with out errors?

Deryck

I get the same message.

variable not found(16): IsFile% = FS “touch”, “/usr/fileToSend.txt”

Ana

Hi Amc,

What is the ewon device are you using and what Firmware are you running?

This is a bit odd this should be defining the variable at the same time. Can you set the IsFile% equal to 0 first? Or if you run just FS "touch", "/usr/fileToSend.txt" does the file get created in the usr directory?

If you provide me with talk2m login info and the user name and Password for the device I can remote into it and test this myself.

Deryck

I updated de firmware to 13.2s1 and it works perfectly.

Thank you for the help!

Your welcome, Glad to hear it is working.

Deryck

I have a problem a with the Historical Trending screen, I enabled this option with a check.
Two of the six tags I want to show make this graph perfectly, but the other tags doesn’t show me nothing and its has the same configuration.

Have you any idea of what its the problem?

Thank you!

Do you mean that only one of the tags are working when you do the historical logging? Or do you mean that you can only view one of the tags at a time with historical logging

I only see two of these tags, one to one in its history graph. When I open the graph of the other tags I don’t see anything, it doesn’t print any value of the tag.

Can we set up a time when I can take a look at this on team viewer?

I only can in between 8:45-13:15 spanish hour.

Its there an other posible solution?

You may need to contact your local distributors for support during that time

Ok, well I Will contact with them!

One more question, I have one tag en eWON that represents how much time during our process in seconds, but I want to show it in Viewon in minutes or hour.
What I have to do to get this?

I want to show in Viewon the state of the process. So, in depends on the value of one of tags I want to see if it is on manual, automatic, on going or sttoped.

Do you know how I can do this?

Thank you!!

You want to know how many seconds since the device turned on?

You should be able to do this with an ontimer and then just create a counter that will increment a tag in the basic ide section

No, I have a tag which give me the seconds of the process running on the PLC.

I want to take hour:minute:seconds from this tag with Viewon to show in a dashboard.

In that case you could just create 2 other integer tags that could run on ONDATEs or Onchanges

it could be done like this:

We’ll use tag1 as the tag that’s reading the number of seconds that the process was running on the PLC and assume that tag1 is an integer. We’ll also create 2 more tags called minute and hour

ONCHANGE “Tag1”, “@timecheck()”

Function Timecheck()

minute@ = tag1@/60
hour@ = tag1@/3600

Endfn

These will stay at whole numbers because they are integers and will update each time that the amount of seconds in tag1 changes