Programming

I am actually trying to process some information using EWON FLEXY 205 which should store the value in one variable from noon to midnight and then send that email at 8:00 in the morning but still continue to process the information from noon to midnight. I am having trouble reset the orignal variable which is going to collect the information because when I reset the variable it also reset the total from midnight to noon.

Hello @Abhay,

Can you provide more context or details to you issue here? Is this being done in basic scripting ? Perhaps you need to setup the script to use two variables and switch between the two?

Deryck

Yes, I am trying to do this on basic IDE.
Down below is my program, I made some changes in it now but as you see I am trying to add a value of 25 in A% each time the HIGH_LEVEL_ALARM is =1. Now I have programmed it this way that it should calculate the value of A% from noon to midnight and then store this value into total and reset the value of A% and start calculating again.

TSET 1,5
ONTIMER 1, “Goto GetTime”
END
Rem — eWON user (end)
End
Rem — eWON end section: Init Section
Rem — eWON start section: TOTAL
Rem — eWON user (start)
GETTIME:
Z$ = TIME$
z% = DOW Z$

x% = VAL(Z$(12 TO 13))

c% = VAL(Z$(15 TO 16))

 IF ((z% > 0) AND (z% < 6)) THEN
 
 IF ((x% >= 12) AND (x% <= 24)) THEN
  
  IF (c% > 0) THEN
  

   GOTO LEVELCALCULATOR
   
   ENDIF
   
   ENDIF
   
   ENDIF

END
LEVELCALCULATOR:
ONCHANGE “HIGH_LEVEL_ALARM”, “@TAGALARM
Function TAGALARM ()

IF HIGH_LEVEL_ALARM@=1 THEN

A%=A%+25
PRINT A%
ENDIF

ENDFN

END

@Abhay

I am having a hard time understanding what you are looking to implement here. Can you be more specific regarding what you are looking for help with.

It looks like you are trying to check the time cyclically with a timer. If so I would suggest using the ONDATE command to trigger you script according to a set time. This might make running the script a little easier. The time for ONDATE uses CRON format.

Deryck

hey @deryck_hms thanks for the reply the ondate command worked actually and sorry for the confusion

Glad to hear you have it working!