Retentive Memory variables

System Variables - Retentive Memory protocol allows to create Tags that point to a memory area whose content is maintained when HMI is powered off.

The physical support for retentive memory is based on FRAM technology.

Important: Not all HMI devices include FRAM memory. If FRAM memory is not available, persistency is supported using user memory storage (Flash or hard disk drive). Flash technology has a limitation in the maximum number of write operations. The use of Flash as storage media for retentive memory with frequent write operations may damage the memory components. Check the HMI device datasheet for the availability of FRAM memory.

Important: Retentive memory is 16 KB flat memory area organized in bytes and accessible through an offset. Refer to schema below.

Retentive memory vs. recipes storage
Recipe data is saved in flash memory (except forJMobile PC Runtime) while retentive data is saved in a FRAM. Flash memory is not suitable for a high number of write operations, while FRAM supports a virtually unlimited number of write operations and should be preferred when frequent write operations are required.

 

Protocol Editor Settings

From PLC Model list of Protocol Editor dialog, select Retentive Memory.

 

Tag Editor Settings

Path: ProjectView> Config > double-click Tags

  1. To add a tag, click +: a new line is added.
  2. Select System Variables from the Driver list: tag definition dialog is displayed.

Element Description

Memory Type

Fixed to Retentive Memory

Offset

Offset address where tag is located. Range: 0-16383

SubIndex

This parameter allows resource offset selection based on selected Data Type
Data Type
Data Type Memory Space Limits
boolean 1-bit data 0 ... 1
byte 8-bit data -128 ... 127
short 16-bit data -32768 ... 32767
int 32-bit data -2.1e9 ... 2.1e9
int64 64-bit data -9.2e18 ... 9.2e18
unsignedByte 8-bit data 0 ... 255
unsignedShort 16-bit data 0 ... 65535
unsignedInt 32-bit data 0 ... 4.2e9
uint64 64-bit data 0 ... 1.8e19
float IEEE single-precision 32-bit floating point type 1.17e-38 ... 3.4e38
double IEEE double-precision 64-bit floating point type 2.2e-308 ... 1.79e308
string Array of elements containing character code defined by selected encoding
binary Arbitrary binary data

Note: to define arrays. select one of Data Type format followed by square brackets like “byte[]”, “short[]”…

Arraysize

  • In case of array tag, this property represents the number of array elements.
  • In case of string tag, this property represents the maximum number of bytes available in the string tag.

Note: number of bytes corresponds to number of string characters if Encoding property is set to UTF-8 or Latin1 in Tag Editor.
If Encoding property is set to UCS-2BE, UCS-2LE, UTF-16BE or UTF-16LE one character requires 2 bytes.

Conversion

Conversion to be applied to the tag.

Depending on data type selected, the list Allowed shows one or more conversion types.

Value Description
Inv bits

inv: Invert all the bits of the tag.

Example:
1001 → 0110 (in binary format)
9 → 6 (in decimal format)

Negate

neg: Set the opposite of tag value.

Example:
25.36 → -25.36

AB -> BA

swapnibbles: Swap nibbles in a byte.

Example:
15D4 → 514D (in hexadecimal format)
5588 → 20813 (in decimal format)

ABCD -> CDAB

swap2: Swap bytes in a word.

Example:
9ACC → CC9A (in hexadecimal format)
39628 → 52378 (in decimal format)

ABCDEFGH -> GHEFCDAB

swap4: Swap bytes in a double word.

Example:
32FCFF54 → 54FFFC32 (in hexadecimal format)
855441236 → 1426062386 (in decimal format)

ABC...NOP -> OPM...DAB

swap8: Swap bytes in a long word.

Example:
142.366 → -893553517.588905 (in decimal format)
0 10000000110 0001110010111011011001000101101000011100101011000001

1 10000011100 1010101000010100010110110110110010110110000100111101
(in binary format)

BCD

bcd: Separate byte in two nibbles, read them as decimal (from 0 to 9)

Example:
23 → 17 (in decimal format)
0001 0111 = 23
0001 = 1 (first nibble)
0111 = 7 (second nibble)

Select conversion and click +. The selected item will be added to list Configured.

If more conversions are configured, they will be applied in order (from top to bottom of list Configured).

Use the arrow buttons to order the configured conversions.

.

Cleaning Retentive Memory

Use the ClearRetentiveMemory action to clear the content of the retentive memory.

Tip: Use this action to set the memory content to a known status at any time.

See Actions > Tag Actions section of main manual for more details.

JavaScript interface for this action is:
project.clearRetentiveMemory();

 

Preserving Retentive Memory at project download

When a project file is downloaded to an HMI, or when the active project is modified, the content of retentive memory is usually deleted.

If is needed to preserve the content of retentive data at project download or update, select the Keep retentive data on project update option in the settings tabs of the HMI device.

This setting will be ignored if Delete runtime dynamic files option is selected from Download to Target window.

 

Preserving Retentive Memory in Simulator

Simulator of JMobile Studio supports the retentive memory. To enable retentive memory during project simulation use the option "Keep retentive data on project simulation" in context menu.