Can a script to stop/start planner

Is current time, the same the time the eWon uses in the Basic IDE? It seems like all of the code is working but comparator statement with the time.

Can I take a look at this on teamviewer tomorrow morning and debug this?

Yes. What time are you thinking?

I got it to email out but no information in the body. The bit was already high when I hit run so it did not see the ‘Onchange’

Hi Joseph, I’m free now, let me know if you’re available or what time you’ll be free to work on it today

I get into work in another 45 mins. I’ll send over the team viewer I’d when I get in.

That works for me

Hello Tim,

I am not getting anything in the body of the email. Not sure why. Any insight?

ONDATE 1,“10 6 * * 1-6”,"@Entry1()"

ONDATE 2,“0 16 * * 1-6”,"@Entry2()"

Onchange “Test”,"@Testing()"

FUNCTION Entry1()

If Enable_Production_Email_1@ = 1 Then

$EmailTo$ = “josephm@unitedsalesinc.net

$EmailCC$ = “josephm@unitedsalesinc.net

$EmailSubject$ = “Daily Production Report”

$EmailBody$ = “”

$EmailBody$ = $EmailBody$ + “Bin Count Line 1/2 :” + STR$ Line_1_2_Dumped_Bins_Total@ + “Bins” +CHR$(13) + CHR$(10) // the CHR$(13) + CHR$(10) is the same as newline

$EmailBody$ = $EmailBody$ + “Bin Count Line 3 :” + STR$ Line_3_Dumped_Bins_Total@ + CHR$(13) + CHR$(10) // Second line of email

$EmailBody$ = $EmailBody$ + “Total Bin Count :” + STR$ Total_Bins_Dumped@ + CHR$(13) + CHR$(10) // Third Line of email… ect

$EmailBody$ = $EmailBody$ + “Total Box Count :” + STR$ Total_Boxes_Ran@ + CHR$(13) + CHR$(10) // Third Line of email… ect

$EmailBody$ = “”

// Want to include data such as graphs as an attachment? see: https://ewonsupport.biz/ebd/

$EmailAttachment$ = “&[$dtUF $fnreport_shift_1.html]”

$EmailContents$ = $EmailBody$ + $EmailAttachment$

SENDMAIL $EmailTo$, $EmailCC$, $EmailSubject$, $EmailContents$

Endif

ENDFN

FUNCTION Entry2()

If Enable_Production_Email_1@ = 1 Then

SENDMAIL “jasonp@unitedsalesinc.net”, “josephm@unitedsalesinc.net”, “FN lifts report”, “&[$dtUF $fnlifts_report.html]”

Endif

ENDFN

Function Testing()

$EmailTo$ = “jasonp@unitedsalesinc.net

$EmailCC$ = “josephm@unitedsalesinc.net

$EmailSubject$ = “Daily Production Report”

$EmailBody$ = “”

$EmailBody$ = $EmailBody$ + “Variable name” + STR$ test@ + “Bins” +CHR$(13) + CHR$(10) // the CHR$(13) + CHR$(10) is the same as newline

$EmailBody$ = $EmailBody$ + "Value of Second Tag is " + CHR$(13) + CHR$(10) // Second line of email

$EmailBody$ = $EmailBody$ + "Value of Third Tag is " + CHR$(13) + CHR$(10) // Third Line of email… ect

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

// Want to include data such as graphs as an attachment? see: https://ewonsupport.biz/ebd/

$EmailAttachment$ = “&[$dtUF $fnlifts_report.html]”

$EmailContents$ = $EmailBody$ + $EmailAttachment$

Endif

EndFN

Disregard. Dumb mistake

Hi Joseph,

Just want to make sure this was all set?

Yes, Sorry about that.

1 Like

I am getting this error. “24 Var or keyword too long” I can’t seem to find how long it can be?

This is the script it is getting stuck on.

// $EmailBody$ = $EmailBody$ + “Line 3 Packing Sizer Production Time : " + STR$ Line_3_Packing_Sizer_Production_Time_Total@ + " Hours” + CHR$(13) + CHR$(10)

It looks like the line you sent is commented out. Can you send me the full code in a notepad file?

I figured it out. The eWon tag has a limitation on how long it can be in the script. I commented it out to see how the format looked as it wouldn’t send with the error. I change it to ‘Line_3_Packing_Sizer_Prod_Time’ and that was inside the limitation.

1 Like

When you use the script for the email, do the features from the planner like the retry action still function? If not, is there a way to do the same function in the script?

It may come up with an error if it’s unable to send the email but you could have an OnError function that could try to resend it if the mail doesn’t go through the first time

Topic closed due to inactivity.