Export Block Descriptor Error

I have the following code running on about 40 Flexy units and once in a while the basic code starts to error on the following line. If I stop and then restart the basic script it starts working again. What could be causing the error and what are the options to gracefully recover from or trap the error so the code continues to work without having to restart the script.
startTime$=MQTT_LAST_HISTORY_DATE_TIME@
endTime$= @GetTimeForEBD$()
ebdHist$ = “exp:$dtHL $ftT $st” + startTime$ + " $et" + endTime$
jsonHistHeader$ = ’ {“HstryT”:{“ST”: “’+ startTime$ +’”,“ET”: “’+ endTime$ +’”} , “Unit”:{“ID”:"’+EownID$+’",“Name”:"’+DeviceId$+’"}, “HstryData”:[’
jsonHistFooter$ = ‘]}’
OPEN ebdHist$ FOR TEXT INPUT AS 1
A$ = Get 1

Hi Ted,

Is it the same error every time when it runs into this issue? If that’s the case we could do an onerror function with a timer that would make it so that section of code wouldn’t be run for a set period of time

Best Regards,
-Tim

There are multiple Flexy units running the same code and some of the units are having an issue with the export block descriptor call. They will error on the line where the ebd is called to open but once the basic script is stopped and then started again the code will run fine for a random amount of time. Below is a small part of each function code where the ebd is called. What could be causing these random errors and how can they be gracefully recovered from without having to restart the script? I do have backups from three unit that had the error if needed.

part a
startTime$=MQTT_LAST_HISTORY_DATE_TIME@
endTime$= @GetTimeForEBD$()

ebdHist$ = “exp:$dtHL $ftT $st” + startTime$ + " $et" + endTime$

jsonHistHeader$ = ’ {“HstryT”:{“ST”: “’+ startTime$ +’”,“ET”: “’+ endTime$ +’”} , “Unit”:{“ID”:"’+EownID$+’",“Name”:"’+DeviceId$+’"}, “HstryData”:[’
jsonHistFooter$ = ‘]}’

OPEN ebdHist$ FOR TEXT INPUT AS 1
A$ = Get 1
//PRINT A$
$Loop:

part b
// this will be current values for group A B C
ebdCurrent$ = “exp:$dtIV$ftT$flABC”
jsonCurrentHeader$ = ’ {“DeviceT”:{“DT”:"’+ @GetTime$() +’"} , “Unit”:{“ID”:"’+EownID$+’",“Name”:"’+DeviceId$+’"}, “CData”:[’
jsonCurrentFooter$ = ‘]}’
OPEN ebdCurrent$ FOR TEXT INPUT AS 1

part c
ebdAS$ = “exp:$dtAR $ftT $tsO”
jsonAS$ = ’ {“DT”:{“T”: “’+ @GetTime$() +’”} , “Unit”:{“ID”:"’+EownID$+’",“Name”:"’+DeviceId$+’"}, “AS”:[’
counter% =0
OPEN ebdAS$ FOR TEXT INPUT AS 1

part d
// start time would be the last ime the data uploaded successfully
startTime$=MQTT_LAST_HISTORY_DATE_TIME@
// end time would be now
endTime$= @GetTimeForEBD$()
ebdAH$ = “exp:$dtAH $ftT $st” + startTime$ + " $et" + endTime$
//ebdAH$ =“exp:$dtAH$st13022020_100000$et14022020_204000”

jsonAHHeader$ = ’ {“DT”:{“T”: “’+ @GetTime$() +’”} , “Unit”:{“ID”:"’+EownID$+’",“Name”:"’+DeviceId$+’"}, “AH”:[’
jsonAHFooter$ = ‘]}’

OPEN ebdAH$ FOR TEXT INPUT AS 1

It is the same error.

Any of the three functions that have the open ebd call in them will error. It is like the Flexy gets stuck on will not allow the basic script to call the ebd
file.

I have tried to call any of the three functions that use the ebd file call and they all error. The only way to fix it is to stop the basic script and then restart
the script. Then all functions work as expected.

image001.jpg

image002.jpg

Does the whole code seem to stop responding after you get those errors or can you still call other functions in the BASIC area and get them to run. Or could you do something like a print statement in the console area and still get that to print?

Just as a test can you try and put an individual tag into group A, B, C, or D and then have the EBD only call that one group and see if it’s still getting that error? If it’s working with that, we might be able to break up the ebd call so that it’s not doing as many tags at once.

The whole code is still responding. Other functions are still working as expected.

When the ebd functions are erroring out I can call other functions from the console line and they will run. I can do a print statement.

image001.jpg

image002.jpg

Ok we can probably do something to get around this error then, can you let me know if it seems to run if you limit it to an individual tag group?

So how would I go about testing that? If the basic script is erroring on the EBD call then I stop the script to make any changes and
start the script t will not error anymore.

The current error on the EBD call is fixed when I stop and start the basic script.

image001.jpg

image002.jpg

Does it just start having issues during part A where it’s calling the historical logs? I wouldn’t think it would have much issues on part B where it’s just grabbing the instantaneous values or on part C where it’s grabbing the alarm realtime info.

If it’s just during part A, I’d like to try and pick one tag and move it into group D and add this to the EBD file name and see if that is still getting the error $flD

Not sure what part has the issues as I can not recreate the error during testing and it seems to be impacting random units.

Can you give me a rough estimate on how many tags are being historically logged and what the loggining interval is? I’d also like to know what the distance is between the start time and end time for how much historical log data you’re calling at once

Typically the time is ten minutes worth of data.

Two units are roughly 50 tags with logging based on delta change not time.

Another is 65 tags with the same logging setup.

image001.jpg

image002.jpg

Could you try adding a logevent with a print statement to each of the sections so you’ll know which part was completed? This would help us narrow down where the issue is happening

So I caught one fo the units erroring on the ebd line and then in the command line I entered Close 1.

The code then started to run as expected. So I needed to add close 1 to the line before the open 1 statement.

Oh ok, and then it seemed to be working ok after that?