Read\Write from flash memory

I have an Opta PLC that is currently communicating with an HMI via Modbus. Currently, when power is lost all my variables return to a default state. I would like to be able to write values to a location in flash memory so that they can then be set on startup from an Init task program. I have found a tutorial about how to write to the flash memory of a Portenta H7 using the Arduino IDE 1.8. Will this work with the PLC IDE? If not is there another way to safely access persistent memory?