FOR Loop never ending.
Hi all,
Hope someone could help me out with some IDE code. I wrote a small script to change the emails of the alarms in my Ewon using a FOR loop. I am using a Pushbutton on the HMI (Email_Change) in order to update the list when the operator wants to change the email. When the code executes, it will go through the for loop and just keep going through it printing my print statement at the end over and over. But if i get rid of the FOR loop and just have my print statement, it works as intended. Any suggestions on how to fix this?
ONCHANGE "Email_Change", "GOTO Change_Email@"
Change_Email:
i%=0
FOR i%=0 TO 2 STEP 1
SETSYS TAG, "LOAD", -i%
SETSYS TAG, "ETO", Email_List$
SETSYS TAG, "SAVE"
NEXT i%
print "FOR Statement Done"
END
-
Hi Luke!
Here is a reference using the For Loop to change Tags:
Change Tag parameter settings for multiple Tags in Basic | Ewon Developers
The difference i see there is that i% does not get declared before the loop. Does removing that change anything?
otherwise it doesn't use STEP since it always does step 1 if you leave it away but it also shouldn't have trouble if you declare it like that...
Didn't test it but this is what i would try out first.
Hope that helps.
br
Franziska Gültig
0
Please sign in to leave a comment.
Comments
1 comment