Remember textinput data during transfering

Hello,

I have a question about mappview in AutomationStudio.

Am I able to remember data from textinputs during transfering to PLC or warm restart? After I do warm restart, I get values from textinputs to default.

I need to get same values after transfer as before.

Thank you :slight_smile:

Hi Jakub,

Welcome to the B&R Community!

I would first suggest checking the binding settings for your widgets. The TextInput widgets in mappView are bound to process variables within your project, but those values may or may not be syncing. In order for a TextInput widget to write its value to a process variable and also update when the value changes within a program, you’ll need to select Binding Mode Read/Write:

If ReadOnly is selected, any updates made to the widget will not transfer to your process variables and will therefore not “save”. However, the widget will still update if its linked variable changes.

If Init Read/Write is selected, the widget will update the value of the variable, but any changes to the variable will not affect what’s displayed in the widget. This means that the widget will not always accurately reflect the value of its linked variable.

Another possibility is that your variables are being cleared out during a transfer or a warm restart. If the binding mode is set accordingly, this would also clear out the Text Input.

There are a couple of ways to prevent this from happening.

  1. If your PLC/PC has retained memory, you can mark the variables you want to save as Retained in the variable declaration file (after allocating RemMem in the CPU Configuration). This will prevent the variables from being cleared on a warm restart, however I believe it’s still possible for them to clear during a transfer.
  2. You can save the variable values to a file (Recipe) that can be loaded from the HMI. This is often used for values which are critical to machine operation (e.g. tuning parameters) so that they can be easily reloaded in the event of a critical error.

Another thing to consider (especially with regard to “settings” pages) is to create a set of buffer variables. The operator would input values into the widgets in the HMI, but these values will not directly write to the relevant variables in your programs. Instead, they are saved in buffer variables which are then transferred to the “real” variables when the operator presses the “Save” or “Confirm” button. If they were to instead Cancel or navigate away from the page, these buffer variables would be cleared out and replaced with the true values of those settings.

Hi Jakub, your problem does not seem to be mappView related. Any variable will lost the value after warm restart if is it not retain. So set it retain and it will work as you wish.


Please make sure that you do not set default value to your variable in init part of the task. If this is not your problem share with us some print screen from your project (binding in mappView, variable declaration, etc.)

Thank you both for your help.

I set variable as retain + I deleted default value from INIT.

Duing build I have this error: Storage area of the CPU for retain variables is too small for variable ‘Test’. Configure PV memory in CPU Configuration. 9096

I did not find anything about RemMem, PV memory, persistent variable in Cpu.sw. I use X20BR9300, X20DM9324 and X20CS1020. In tech spec I did not find info about remanent variables FRAM capacity. So problem will be maybe there?

Thanks :slight_smile:

1 Like

The Configuration for the Memory is done in the PLC configuration

You can check the Data there.

1 Like

Hi Jakub,

yes, it sounds like that the remanent memory is not configured, this could be the problem (I’m almost sure it is :wink: ).

To use remanent variables, you need a PLC with SRAM (Static RAM → most of the PLCs have SRAM, either directly onboard or, in case of a PC based runtime system, on a interface card plugged into the system).

Because I don’t know which PLC you use, I can’t tell you exactly what to setup, but I can give you a example with a X20 PLC.
The memory setup is done inside the PLC configuration, under “RemMem” and “PV memory”.

Depending on the PLC type, maybe you have to change the settings at “Device for memory RemMem” → without changing anything else, there should be then a value != 0 under “RemMem memory size” (this value can also be changed, but normally it’s ok to leave the predefined default value).

After that, if you have GLOBAL variables that should be remanent, you have to set a suitable value at “Remanent global PVs”. The value unter “Remanent local PVs” is calculated automatically and is used for local variables declared as remanent.

More information about the SRAM memory configuration can be found here in the online help.

1 Like

It works for warm restart, thank you all very much.

Is it possible to retain variables also during transferring to target or immediately after successfull download?

Hi Jakub,

the transfer behavior depends on the transfer settings you se.
You can check / change this settings in the transfer dialog, to keep the PV values while transfer the suitable checkbox has has to be checked → please see the example screenshots below.

For more information about project transfer, please have a look here in the automation help

1 Like

Nice, thank you very much.

Everything works perfectly :slight_smile:

2 Likes