5 ee memory, Ee memory – High Country Tek DVC80 User Manual
Page 59

P/N: 021-00154, Rev. A.6 - updated for V4.7 Tools
Page | 59
Code Comments
Dim VarName as Uint
Declares a 0 to 65,535 value variable
All variables are Global
Dim VarName as Timer
Declares a Uint variable that once set will decrement at 10ms
intervals until it reaches zero.
Dim VarName as EEmem
Create a Uint location in memory that can be stored in
permanent non-volatile memory. Up to 128 EEmem resident
variables can be declared.
Private VarName as Uint/Timer/String
Private variables are only referenceable within the logic
sequence in which they are defined. Code reuse is the
primary reason for using Private variables.
Const VarName = Value
Declares a constant named VarName
If (Logic Statement) Then
If Statement Logical Operators are AND, OR, XOR, NOT, <,
>, =, <>, >=, and <=
ElseIf (Logic Statement) Then
The else if condition
Else
The else condition
End If
The end of an If Statement
Var = Algebraic Statement
Algebra Statements can include +, -, *, and /
On and True are equivalent to the value 65535
Off and False are equivalent to the value 0
' Comment
Comments are started by using a " ' "
0xFFFF
Hex Notation
Some statements unique to the Bubble Language are:
Code Comments
A = 100%
The % after a number will scale the value between 0 and 1023.
Percentage numbers can include a decimal e.g. PWM_1 = 75.3%
TimerA = 100ms
The ms after a number scales the value to units of 10ms. ms
numbers can include a decimal e.g. Timer0 = 250.5ms
TimerA = 1s
The s after a number scales the value to units of 10 milliseconds.
s numbers can include a decimal e.g. Timer1 = 5.8s
Supply > 20sv
The sv after a number will scale the value to units of supply
voltage. Supply is the voltage powering the unit. sv numbers
can include a decimal, e.g. Var = 13.8sv
4.5
EE Memory
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.