How do you store variables into non volatile memory

How do you retain variable values in the Opta.
I'd like them to still be there after it re-powers up.

I've found the 'Parameters (Non volatile)' under Configuration->Opta->Public objects->Parameters and have added a list of variables, but they aren't stored and reset to zero when powered back on!

If anyone has any information on this, I'd be grateful for some info.

Kind Regards
Mark

https://www.google.com/search?as_q=arduino+Opta+eeprom

points to

which has a link

Thank you

Sorry I didn’t make myself clear.
I don’t want to do this within the sketch.
I would like to do this within the PLC part.

I’d like to store a few plc variables in non volatile memory so that the values are stored and can be read after a power failure.

Thank you
Mark

happy new year Mark,

To make it more clear:

You want to store some values inside of the memory of the PLC.
Your PLC works in collaboration with an arduino opta.
So what is the real question?

Do you mean:

How can my Opta-C++-Code send values to my PLC so the PLC will store these values
in the PLC- internal-non-volatile-memory?

Or do you mean:

You adjusted some values inside the PLC and now these values shall read out by the arduino-opta and then be stored
in the flash-memory of the Arduino-Opta ?

You are working on an informatic project. (even if a PLC is part of it) and what is most needed in an informatic project is - guess what ? sufficient precise information

best regards Stefan

Hello @StefanL38
Happy New Year to you too...

Further to your question...
Do you mean:

How can my Opta-C++-Code send values to my PLC :white_check_mark:
So the PLC will store these values in the PLC- internal-non-volatile -memory ???

This is the question I'm having difficulty in doing.
I've worked out how to get variables to and from the Arduino sketch to the PLC by using the PLCIn.### & PLCOut.###. So I've got the first part of your question, thank you.

The part I cannot get to work is the second half of your question. Getting the PLC-internal-non-volatile memory to work!

Would you have any advise on how to setup and use the non-volatile memory within the PLC.
best regards
Mark

PS: I'm using the Arduino PLC IDE version 1.0.3.1

This is a screen shot of my variables I would have thought are non-volatile.

Would anyone have any information on this please.

Thank you
Mark

Very important information. So I want to ask new:

Is your system build from an Arduino Opta
and
some second NON-ARDUINO-device which must communicate with each other ?
or
is your system only the Arduino-Opta?

And in case there are two parts

  1. NON-Arduino-PLC
  2. Arduino-Opta programmed by the Arduino PLC-IDE

What type of NON-Arduino-PLC is this?
My understanding of your question is:

How can I store data in the NON-Arduino-PLC?

Is this correct?

Maybe it would be good if you add a picture that shows all important parts of your system.
this are

  • each and evey powersupply (yes they are important!)
  • involved microcontrollers
  • sensors directly connected to your Arduino-Opta
  • the NON-Arduino-PLC

best regards Stefan

Hi Stefan

Thank you again for your assistance.

The system I have is the following:
1x Mean Well Switch Mode Power Supply 24vdc @ 1.7A
1x Arduino-Opta Plc
4x Potentiometers to simulate analog inputs on 4x Plc inputs.
2x Switches on 2x Plc inputs.
4x Led's on the 4x Plc outputs.
1x RS485 device connected to RS485 port on Plc.

All of my prototype system as above is all working fine.

Couple of photos...


My apologies, with your help I've just cracked it and I wasn't really asking the question correctly!

Using RETAIN under the variables attribute does keep the variables value when switching off and then restarting the Plc.

Thank you @StefanL38

Screenshot 2024-01-02 194745
Screenshot 2024-01-02 194709

1 Like