
13. Program Support Functions
13.5 User Macro Specifications
313
13.5.4 Variables
Function and purpose
Both the variable specifications and user macro specifications are required for the variables which
are used with the user macros.
The offset amounts of the local, common and system variables among the variables for this
MELDAS NC system except #33 are retained even when the unit's power is switched off. (Common
variables can also be cleared by parameter "#1129 PwrVC1".)
Variable multiplexing
When the user macro specifications applied, variable numbers can be turned into variables
(multiple use of variables) or replaced by <formula>. Only one of the four basic arithmetic rule (+, -,
×
,
÷
) operations can be conducted with <formula>.
(Example 1)
Multiple use of variables
#1 = 10 #10 = 20 #20 = 30 ;
#[#[#1]] = #[#10] from #1 = 10.
#5 = #[#[#1]] ;
#[#10] = #20 from #10 = 20.
Therefore, #5 = #20 or #5 = 30.
#1 = 20 #10 = 20 #20 = 30 #5 = 1000 ;
#[#[#1]] = #[#10] from #1 = 10.
#[#[#1]] = #5 ;
#[#10] = #20 from #10 = 20.
Therefore, #20 = #5 or #20 = 1000.
(Example 2)
Example of multiple designation of variables
#10 = 5
In which case ##10 = 100 ; #5 =
100
<Formula>##10 = 100; is handled in the
same manner as # [#10] = 100.
(Example 3)
Replacing variable numbers with <formula>
#10 = 5 ;
#[#10 + 1] = 1000 ;
In which case, #6 = 1000.
#[#10 - 1] = -1000 ;
In which case, #4 = -1000.
#[#10
∗
3] = 100 ;
In which case, #15 = 100.
#[#10/2] = -100 ;
In which case, #3 = -100. (Rounded off.)