ExeSSI works when template file is accessed directly from the eWon, but not in a sent email attachment

Hi,

I’m trying to generate reports with a dynamic data range, the goal being to display relevant data for only one “round” of production. To this end, I have a script in the eWon BASIC IDE to generate an EBD, which is then read by the .shtm page in order to get the data. A report is then emailed at completion.

The template itself seems to work if I load it directly from the eWon, but the ExeSSI blocks seem to run into some kind of a problem when I view the email attachment. They don’t seem to get the data I need.

I’ve tried to run a sample snippet of code (reading a tag description) as well and the same thing happens. If I go through the eWon and load the .shtm directly the code works, but if I try to have it sent by email then it doesn’t seem to get executed correctly.

I also run TagSSI commands in the .shtm which work.

ExeSSI block :

<%#ExeSSI,
SETSYS TAG,"load","Temp306_EBD"
ebd1$ = GETSYS TAG,"TagValue"
OPEN ebd1$ FOR TEXT INPUT AS 1
readLoop1:
a1$ = Get 1
PRINT #0,a1$;
IF a1$ <> "" THEN GOTO readLoop1
CLOSE 1%>

BASIC script to generate the EBDs :

Temp306_EBD@ = "exp:$dtHL $ftT $st" + Jours$ + Moiss$ + Annees$ + "_" + Hdcs$ + Mdcs$ + Sdcs$ + " $et" + Jours$ + Moiss$ + Annees$ + "_" + Hfcs$ + Mfcs$ + Sfcs$ + " $tnTemperature_306"
Pres306_EBD@ = "exp:$dtHL $ftT $st" + Jours$ + Moiss$ + Annees$ + "_" + Hdcs$ + Mdcs$ + Sdcs$ + " $et" + Jours$ + Moiss$ + Annees$ + "_" + Hfcs$ + Mfcs$ + Sfcs$ + " $tnPression_306"
CTemp306_EBD@ = "exp:$dtHL $ftT $st" + Jours$ + Moiss$ + Annees$ + "_" + Hdcs$ + Mdcs$ + Sdcs$ + " $et" + Jours$ + Moiss$ + Annees$ + "_" + Hfcs$ + Mfcs$ + Sfcs$ + " $tnSetpoint_Temperature_306"
CPres306_EBD@ = "exp:$dtHL $ftT $st" + Jours$ + Moiss$ + Annees$ + "_" + Hdcs$ + Mdcs$ + Sdcs$ + " $et" + Jours$ + Moiss$ + Annees$ + "_" + Hfcs$ + Mfcs$ + Sfcs$ + " $tnSetpoint_Pression_306"

Sample EBD :

exp:$dtHL $ftT $st19052020_121047 $et19052020_122011 $tnTemperature_306

Thanks for any help.

EDIT :

I have switched to a method involving Web-context variables, same thing happens.

ExeSSI to get the EBD from the BASIC variables :

<%#ExeSSI,
SETSYS TAG,"load","Temp306_EBD"
ebdtemp! = GETSYS TAG,"TagValue"
SETSYS TAG,"load","CTemp306_EBD"
ebdtempc! = GETSYS TAG,"TagValue"
SETSYS TAG,"load","Pres306_EBD"
ebdpres! = GETSYS TAG,"TagValue"
SETSYS TAG,"load","CPres306_EBD"
ebdpresc! = GETSYS TAG,"TagValue"%>

ParamSSI :
<%#ParamSSI,+ebdtemp%>

I have modified the EBD formatting to run it in ParamSSI. Example :
[$dtHL$ftT$st19052020_121047$et19052020_122011$tnTemperature_306]

The ExeSSI tag doesn’t seem to run in my email attachments.

EDIT 2 :

I have tried to copy and paste a code snippet from the Web Reference guide. Even that does not work when I open the attachment, but everything works when I access the file from the /usr folder. I have “east-Invalid Parser name in InitSSI” in the log when the email is sent but not when the file is accessed directly on the eWon. Perhaps something to do with the EBD that sends the email attachment?

ebd$ = "&[$dtUF$uf/usr/rap306.shtm$fnrap306.html]"
SENDMAIL "email@email.com", "", "Rapport de production", ebd$

I appreciate any insight.

Hello,

Can you send us a backup.tar file of this device with the support files included from eBuddy? I’d like to take a look at the full BASIC code running on this device.

Also are you trying to include all of these EBD files in one email or are each of these separate emails?

Is there a reason that you’re grabbing individual tags historical data instead of the historical data for all of the tags at once?

-Tim

Hi,

In which manner can I send the backup?

The EBDs pull data into a single webpage so that I can run it through charts.js, which is then sent as an email attachment.

Thanks for the quick reply.

Hello,

I just saw your backup and started taking a look through it. One thing I noticed was that you have some code in the cyclic section, I would strongly recommend moving this to the Init section because that will run every processor cycle and depending on how often those onchanges occur, that could cause many issues with the device.

Could you give me a call at 312-893-5636 when you’re available to go over this, it think it might be easier to figure out what’s going on in this case

Hi Tim,

The onchanges are infrequent. They might toggle once every few hours during production periods. Nonetheless, I will move the code as suggested.

Thanks for the quick replies. Due to the COVID outbreak, this particular project has been more or less in stasis and I work on it in my spare time. I have some stuff that takes priority in the pipeline right now, so it may be a few days until I can give you a call. Do you want me to send you a reminder message before calling or will it be alright if I call out of the blue when I have time?

Thanks for the assistance.

If possible it would be nice to set a time for the call, but if that’s not an option then you can call anytime M-F 8AM-5PM Eastern time and one of us should be able to help out with this if I’m not available.