Author Topic: How to save a STRING to NV?  (Read 15231 times)

Offline spittet

  • PLUS+1 Guru
  • *****
  • Posts: 118
  • Karma: +6/-1
How to save a STRING to NV?
« on: September 01, 2020, 03:39:26 PM »
Hi,

I'm using the DM1000T screen for the first time. I would like it to create a Wifi AccessPoint with a specified SSID and Password that would be stored in NV memory and that could be changed from ServiceTool.

None of the Non-Volatile Memory Dynamic component seems to accept a STRING value type.

So, how do you store a parameter of String type in NV memory that could be changed from Service Tool as a parameter?

I know I could store each char as a U8 using a single NV component for each and then concatenate them into a String, but because the SSID and PASS are 32 and 64 char long respectively, I do not think that this is the best solution.

Let me know if you have a potential solution for this.

Have a good day!

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 352
  • Karma: +8/-0
    • Marbek Elektronik
Re: How to save a STRING to NV?
« Reply #1 on: September 02, 2020, 06:47:42 AM »
Hi,
we create text strings from display. We have 4 Lines and 36 characters per line and wie select with all the keys. It works as fast as with mouse.

You arr right: Service tool can't handle text arrays. I have tell helpdesk this years ago and there is no possibility select "ascii".
Or, is it possible in new V12? I am using 11.6.
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline Tor

  • Administrator
  • PLUS+1 Guru
  • *
  • Posts: 289
  • Karma: +28/-1
Re: How to save a STRING to NV?
« Reply #2 on: September 02, 2020, 08:36:34 AM »
Hi,

This would be great to have, a NV memory for Strings that can be changed in the Service Tool. But as Marbek_Elektronik pointed out, this has been a wish for a long time, and it seems to be very complicated to implement into PLUS+1 GUIDE.
There's the "Set Value" component that handles strings, and you can read strings in service tool with a checkpoint. The step to have a NV memory that handles string doesn't seem to be a very big step?  =)

I'm sorry, but I don't have any better solution for you in this matter.
As long as these issues comes up from you guys, we can point out to the developers that this is what the customer wants. So keep it up.

Have a nice day.
Best regards,
Tor
PLUS+1® SW PAE Team

Offline acmall

  • PLUS+1 Guru
  • *****
  • Posts: 199
  • Karma: +37/-1
Re: How to save a STRING to NV?
« Reply #3 on: September 02, 2020, 09:07:27 AM »
+1 vote for NV memory components that can store strings. I store operator input text on a DP720 for one of our machines which requires 140 individual NV memory components.

For me this would have been a better use of developer time than the changes to the user interface in V12.

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: How to save a STRING to NV?
« Reply #4 on: September 02, 2020, 06:09:30 PM »
I'd be checking to see if STRING type variables will save as RETAIN variables in the Structured Text POU.  That'd be by far the easiest way.
Controls Engineer
Hydra-Power Systems

Offline spittet

  • PLUS+1 Guru
  • *****
  • Posts: 118
  • Karma: +6/-1
Re: How to save a STRING to NV?
« Reply #5 on: September 02, 2020, 11:10:42 PM »
I'd be checking to see if STRING type variables will save as RETAIN variables in the Structured Text POU.  That'd be by far the easiest way.

I tried it and, unfortunately, it seems that a variable of String type cannot be set as "RETAIN" in ST. I got the following message in the "Compiler Messages" during compilation (that aborted) :

Code: [Select]
st_SavedString_data has a non-basic type, and can therefore not be backed by Non-Volatile memory
I joined the test project to this post

Offline acmall

  • PLUS+1 Guru
  • *****
  • Posts: 199
  • Karma: +37/-1
Re: How to save a STRING to NV?
« Reply #6 on: September 03, 2020, 08:53:12 AM »
See this post from Nilla about limited support for RETAIN: -
https://www.plus1forum.danfoss.com/index.php?topic=1157.msg3763#msg3763

Offline Sergio-DEK

  • PLUS+1 Developer
  • ***
  • Posts: 12
  • Karma: +2/-0
  • Each is a programmer of its own luck.
    • www.dek.si
Re: How to save a STRING to NV?
« Reply #7 on: July 21, 2021, 10:13:50 AM »
I agree. Expanding the support for NV and RETAIN variables is long overdue.
Sergio Kosic
DEK electronics

Offline macbahi

  • PLUS+1 Guru
  • *****
  • Posts: 124
  • Karma: +1/-0
Re: How to save a STRING to NV?
« Reply #8 on: August 29, 2022, 05:43:37 PM »
Hi All,

I downloaded the program SaveStringNV and I modified.

It's working but the data it's not saved as in NV.
when the controller is off,  the SaveString data it's not saved .

Please are you finding a why to save string?

I need that to integrate a password in our program for customers. 

Thanks in advance for your help

With best regards

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: How to save a STRING to NV?
« Reply #9 on: August 30, 2022, 12:44:43 AM »
It sounds like the only way to do it with Danfoss hardware may be to set up an ASCII lookup table and actually save the values as number arrays.
Controls Engineer
Hydra-Power Systems