Where to store constant data?

Where to store constant data?

Data is coming from PAC Control.

I know that, I cannot relay on persistent variable coz for few reason it will wipe out.

Is the groov datastore best recommendation to store constant data?

Working backwards through your post…

The groov View data store is not a store as in database, its a place to move data into so that it can be used on any of the screens in groov View.

I am very interested in why you think that persistent variables are not the right tool to use (tip: it is).

The only time they will be overwritten is if you download a strategy with a different name, ie a totally different strategy or a firmware update.

In the case of the firmware update, we provide two methods to retain the data.

  1. In PAC Control, while in debug mode:


Click on Control Engine and then select to download the variables.
You can then reverse the process after you do the firmware update.

  1. You can use OptoTagPreserve. The nice thing about this method is that you can do it as often as you like and thus take snapshots of your variables at any time.
    Again, follow the PDF and do the reverse when needed.

In persistent variables would be my advice.

A failed strategy download can wipe persistent variables too. I’ve had this happen on multiple occasions. OptoTagPreserve is a must if you will be downloading strategies over vpn or other network connection that can suddenly drop.

Ah yes this is where I am coming from.
I experience this too. Doesn’t matter how rare this happens, when this happens all my constant that are stored on a persistent variable are all gone.

My workaround long time ago is to store on groov data store via node-red and load from data store at strategy startup.

I worked on a project where I saw they were saving setpoints to the scratchpad and loading them on startup. I’m thinking this was for similar reasons.

I agree, it doesn’t have to happen often - just once and it ruins your day or two.

If you’re using PAC Display, the recipe save and restore option is another option that many customers use for this purpose as well.

I typically save persistent variables to a table and save them to the SD card in the strategy so they can be restored on startup or by a screen button. It’s a bit more complicated but it has never failed me.

1 Like

One more instance: if variables are in a persistent table, when you change table length.

1 Like