Ewon TechForum
Providing technical solutions to technical requests


BASIC Script generates errors after running for 8 hours
NTA_JK Offline
Junior Member
#1
I have the attached code running in a Flexy 201, Firmware version 14.1s0 (#1076), S/N: 2008-0059-21.

After running for multiple hours, the program stops executing properly.  The "Autorun" checkbox is checked.  I started running the program at 10pm.  I checked the log files on the SD Card and at 6:54am (8+ hours) the program stopped saving data to the SD Card.  Previous test runs have stopped at 16+ hours, 1+hr, 2+hrs.  It seems to be random.  I added some PRINT statements to the code so I could see where it was getting hung up at.  When I logged into the Flexy to look at the console window of the BASIC IDE, the program was no longer printing the PRINT statements.  Instead it was generating an error code.  The line "dummy1% = dummy1% + 1" in the Cyclic Section was generating error # 16 (Variable not found).  The code in the Cyclic Section was just recently added because I suspected that Timer2 was stopping unexpectedly and that was the reason the data logs were stopping.  That appears not to be the case.  Why does the program randomly stop working?


Attached Files
.txt   program.txt (Size: 5,95 KB / Downloads: 7)
Reply

tedsch Offline
Junior Member
#2
A tip for an issue that we have ran into recently. Add a Close 2 statement before all of your OPEN file statements. This is incase there was an un-handled error when opening the files.
Reply

NTA_JK Offline
Junior Member
#3
Thanks for the tip.  I have added the CLOSE command before the OPENs.  I am testing now to see if that fixes the issue.
Reply

NTA_JK Offline
Junior Member
#4
(30-06-2020, 01:08 AM)NTA_JK Wrote: Thanks for the tip.  I have added the CLOSE command before the OPENs.  I am testing now to see if that fixes the issue.
Adding the CLOSE commands before the OPEN commands did not fix the issue.  The Script ran for about 2hours last night and then crashed.  I started to get the error "Variable not found (16)."  Any other thoughts on why my program is crashing?  Is a one second sampling rate too quick for Timer2?
Reply

NTA_JK Offline
Junior Member
#5
I'm still having the issue of the program crashing. I added the "ONERROR" command so I could capture exactly when the program crashes. However, that didn't give me any more information than I already had. I got error # 16 (Variable not found) from the cyclic section. I've only added the code to the cyclic section in attempt to debug the issue. Even with the code out of the cyclic section, the program still crashes. Is there an issue with writing to a file too often? Am I open/closing the file too frequently? Is grabbing tag data once per second too fast for the EWON to handle?
Reply



Possibly Related Threads…
02-07-2020, 09:57 AM
Last Post: DavidLindberg
26-06-2020, 11:50 AM
Last Post: simon
  Console Basic script Started by Cst
1 Replies - 83 Views
24-06-2020, 09:45 AM
Last Post: simon
16-06-2020, 03:03 PM
Last Post: simon
16-06-2020, 02:58 PM
Last Post: simon
  Redirect via BASIC Script Started by bdoucet
1 Replies - 129 Views
04-06-2020, 02:12 PM
Last Post: simon
02-06-2020, 01:58 PM
Last Post: simon
  String type in basic Started by khaterchi
2 Replies - 186 Views
14-05-2020, 07:19 PM
Last Post: khaterchi
12-05-2020, 09:20 AM
Last Post: simon
05-05-2020, 10:32 AM
Last Post: simon



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy