Variable
The space that storages numerical and string, it is called value.
Initial value of numerical variable is 0, initial value of character variable is empty string("").
User can define variable type and variable name.
Variable Name
The first character of variable is english character, not digital. Others of digital part are also be discerned. It can not use special symbol. To sum up as follow:
First position:must be letter('A' to 'Z', 'a' to 'z')
Middle:letter/numeral('0' to '9')
Last:'&'/'&&'/'#'/'##'/'$'/'$$'
(Example)NUMBER&, CHARA$, POS##

Note
- Variable name can't begin with numeral. It can't use special symbol in the variable name.
- We can't use the same variable name with reservedword, it can contain reservedword.
- Lowcase is the same with uppercase in character treatment.
(Example) Variable A& and variable a&...is the same. Both of them are considered as uppercase.
Variable Type
- It can be devided into integal variable, double variable and string variable.
- After variable name, please add all kind of identifications. The same variable name with different type is different.
- Add double identifications is seen as save variable. (Please refer to following information in detail.) Saving variable is different with not saving variable to the same variable name.
- It must be defined only when use array variable.
"Integer Variable"
We can use integer from -2147483648 to 2147483647.
Add "&"or"&&" after variable name.
"&" can't be neglected.
(Example)
"Double Variable"
We can use real number from -1.0E30 to 1.0E30.
Add "#"or"##" after variable name.
"#" can't be neglected.
(Example)
A#=12.34
BB##=-.987
C3#=-12.3E12
"Charater Variable"
We can use " " to enclose string.
Add "$"or"$$" after variable name.
The most length of string is 255 characters.
"$" can't be neglect.
(Example)
AA$="OMRON"
B$$="OMRON"+"TATEISI"
"Array Variable"
We can use not more than 4 dimensions array variable.
We can use dim command to define array variable.
Additional numbers begin with 0. The number of element is "Additional number add 1".
(Example)
Dim A&(100) one dimension array, the number of element is 101
Dim B&&(100, 100) two dimensions array
Dim C&(100, 100, 100) three dimension
Though array variable name is same with general variable name, they are different.
If different dim have same variable name. it is also considered to be same array. Then last defined array is seen as to be valid.
(Example)Following variables are different with each other.
A& A&& AA# A$ A&(0) A#(0) A##(0) A$(0)
Variable Space
Use space of variable devides fix length space and variable length space.
The capacity of fix length space is 8KB. It can save integer and double variable.
The capacity of variable length space is no limited(memory permit), it can store string and array variable.
Save Variable
Variable can be divided to save variable and unsave variable.
If cut electric power down, not save value of unsave variable.
Save variable is used to execute save of mode menu. For example, Save system data to flash memory. Transmit data from treatment unit 0 to treatment unit 1. Dgital value of save variable will also be transmited.
Integer Value
|
Unsave variable XXX&
|
Save variable XXX&&
|
Double Value
|
Unsave variable XXX#
|
Save variable XXX##
|
String Value
|
Unsave variable XXX$
|
Save variable XXX$$
|
Integer Array
|
Unsave variable XXX&()
|
Save variable XXX&&()
|
Double Array
|
Unsave variable XXX#()
|
Save variable XXX##()
|
Character Row Array
|
Unsave variable XXX$()
|
Save variable XXX$$()
|
When using backup array, we should maintain dim's concerning mark.
(Example)
*McrInit
dim ARRAY&&(2)
return
After saving, next time load macro program, ARRAY&&() will be defined again. Saved value will be initiated.
To avoid this kind of situation:
*McrInit
if ARRAYCHK&&=0 then
dim ARRAY&&(2)
ARRAYCHK&&=1
endif
return
We should check if adding mark or not.

Note
The value of Macro variables are not changed when "clear measurement" is executed.
Scope of Macro variables
- All Macro variables is controled by each Macro unit.When some macro unit is in a flow, same name variables in each macro unit are unique (not same variable).
- Only the macro unit which has the macro variable can access it. But access by external reference of Macro unit whose dataident is variable's name, access from out of the macro unit is available.