7 ee memory variable use, Ee memory variable use – High Country Tek emc-3L User Manual

Page 11

Advertising
background image

Notice the bubbles are directly related to the flowchart steps, now the programmer needs to write code for the
individual bubbles. This is a very simple example, but it gives a demonstration of how the flowchart can be
created and then converted into the bubble logic.

7

EE Memory Variable Use


Electronically erasable memory (EE Memory) is memory that is maintained (non volatile) when there is no
power to the DVC5/7/10. The DVC5/7/10 has 128 EE memory locations. EEmemory locations can be used to
interface to the compiled, running DVC program. For instance, if during troubleshooting, the user wanted to
change between different virtual display screens, the programmer may create a EEmem variable
‘virtual_screen’. By programming the DVC, the contents of the variable ‘virtual_screen’ could be monitored to
determine which virtual display is active. EE memory locations are all unsigned 16-bit values that can store any
number from 0 to 65535. EE memory names can be 32 characters in length. The actual EE memory is not
used while the program is running. A mirror copy in DVC5/7/10’s program memory is used to prevent over
usage of the EE memory. There is a special command to save the mirror copy to the EE memory and another
one to copy the EE memory to the program memory location. The EE memory has an approximate 1 million
writes guarantee. If a new value where to be stored every minute, the DVC5/7/10 is guaranteed to run for 1.9
Years.
To save all of the EE memory, execute this line of code in your application: EECommand = EEWrite. In between
writes you will need to reset the EEcommand to 0. Also, note that the EE memory will only be written to if one
or more of the EE memory variables has changed. So if you insert the EEcommand = EEwrite in your always
bubble or some other frequently executed logic bubble you are very unlikely to exceed the 1 million writes limit
of the memory chips. A typical sequence of code to update EE memory would look like the following:

Dim eememory_update_timer as timer
EEcommand = 0
If (eememory_update_timer = 0s) then
eememory_update_timer = 2s ‘ timer set to > 10ms needed to insure at least one EEcommand = 0
‘ executed between EEcommand = EEwrite commands
EEcommand = EEwrite
End if

To declare an EE memory variable use this line of code: Dim VarName as EEmem
To save all of the EE memory use this command: EECommand =
EEWrite

To restore actual EEmemory values to program memory use this
line of code: EECommand = EERead
EERead (is rarely used but) would be used if you had changed
an EE memory variable in your application but had not saved it to
permanent memory and wished to reset the variable to the
permanent EE memory value.

Note: When the DVC5/7/10 powers up the program memory copy
of EE memory is automatically initialized to the values stored in
permanent EE memory. Therefore, you do not need to start your
program with an EEread command.

PN 021-00154-QSG, Rev A.2

Quick Start Guide

Page | 11

Advertising
This manual is related to the following products: