Flexy 205 BASIC IDE Historical Logging to SD Card Issues

Hello,

I am attempting to save down the historical logs of some DWORD tags to an SD card installed in my Flexy. I found a BASIC IDE script provided on a HMS forum and was having success with the script when saving down 10 tags but I ran in to issues when I expanded to 36 tags.

I am getting the below messages coming in to my event log when I run the script…

15/01/2021 15:05:01 20162 pla-Queue Full scp

15/01/2021 14:50:22 20162 pla-Queue Full scp

15/01/2021 14:45:01 20162 pla-Queue Full scp

15/01/2021 14:32:38 20162 pla-Queue Full scp

15/01/2021 14:29:31 20162 pla-Queue Full scp

And I am getting the below message in my realtime log…

15/01/2021 15:05:01
BASIC
[ERROR] Operation failed (28) 285 : WRITEEBD EBD_STRING$, FILENAME$
602604591
86

The line I am getting the error from changes every time I run the script.

I imagine this issue is coming from trying to save to much data at once but I am not sure how to split up my script so I am only saving certain tags at certain time intervals.

What can be done about this?

Hello,

It looks like certian processes are not complete regarding the BASIC IDE.

Can you upload a backup with support files? This can be done using eBuddy. I would like to review the full amount of code.

MOVED TO STAFF NOTE (153 KB)

I hope this points us in the right direction.

Is there any update on this issue?

Hello Russell,

So i took a look at your script. I can see why you are getting the queue full and errors as well.

You have a lot of triggers working at the same time. As the values change,it begins the an action, as more actions are triggered more are queued up. The congestion of actions is what is causing the script to fail. Our devices due have limited flash memory. If it fills up with data it can cause adverse affects.

I would review the code, and determine if there is an easier way to get the data you need.

What do you mean by triggers? Are you referring to the ONCHANGE triggers, the ONDATE triggers, or something else?

All of them are triggers.

You have 38 Onchange triggers. This can of data aqcuisition via script can bog down the machine significantly.

Okay.

If I removed all of the ONCHANGE from the script would this be enough to free up space in the queue to write to my SD card?

Yes, that would significantly reduce the amount actions that take place.

Remove the OnChange’s and associated labels, then see if the issue still occurs.

Although, for my project, I could see there being another memory issue coming up from removing the ONCHANGE triggers. The data I am trying to log is a DWORD that is constantly updating from a PLC and the trigger I am using with the ONCHANGE is used to filter out the unnecessary data. I experimented with this when I first started this project of mine and the difference between log entries is in the 1000s. I would also have to start historical logging 38 more tags in order for me to be able to filter out the unnecessary data in Excel.

If this won’t pose an issue I can find a work around with how I filter the data in Excel.

Is there no other way besides scripting to use a SD card to expand memory?

Have you tried using the historical logging feature in tagging? You can historically log the changes, and write a script that uses export block descriptors and have it sent our a few times a day. What you require is possible, just not through basic scripting alone.

image

Unfortunately, the only method expand memory is through the SD card. We do have any other method.

I have tried the historical logging feature in tagging. When I do that my log entries increase by the 1000s. Will this cause other memory issues?

Can you only write to a SD card through scripting?

It depends upon the frequency of logging. If the frequency of logging is high, i would advised sending the historical log out via export block descriptors more frequently.

You can write to the internal storage of the Flexy and to the SD card, if you are using BASIC scripting alone. You can also explore our Java API to send values to a server.

Kevin,

Thanks for the help! I will experiment with how/when I am logging my tags and see what happens.

No problem, Russell.

I understand the frustrations of tryingto achieve your goal. While flexy maybe limited in hardware compared full PC systems. We have several avenues that you can explore. We do offer software solutions through solution center for a fee.

Just an update…

To clear up the queue I stopped using ONCHANGE to create a historical log in the IDE and instead used the logging function in the tag creator. This method could have worked for how I wanted to capture data, but made the final process very labour intensive. I decided this would not work and did some digging in to alternatives. I ended up finding another forum post on how to get a rough estimate of how much memory would be used up when historical logging based off of your memory config and number of tags. I then ran the calculations and found that I could keep my data locally on the Flexy (as in not saving to a SD card) for around 2 weeks before FIFO started overwriting data. With that information in hand I decided I did not need to save my logs down to a SD card and could just use the IDE for ONCHANGE historical logging. Without using the IDE to save to a SD card I have no fears of over filling the queue.

Moral of the story. To avoid having to do and redo - fully understand what you are working with and how to work with it.