
LNC-M8000
Variables
寶元數控精密股份有限公司 233
LNC Technology Co., Ltd.
9.5 Variables to value function in string
Version:Mill_int_Ver03.01.34
When editing program or MACRO, you may need sting, ex:G65 “string” or:ALARM("string"). If you want
tomix MACRO variables in this string(value of global variable’@’, local variable’#’), you can use this function
to show some MACRO calculating value or system info in it. It’s easy for user to understand program or
MACRO current situation from string, example as below:
#1= R_MACH_COOR(0,1); /* If this path MACHINE coordinate 1 axis= 1.234mm, #1 value=1.234 */
ALARM("MACHINE coordinate X#1mm"); /* Alarm 610000, string:” MACHINE coordinate X1.234mm” */
From above example, you can see the sting is within” “, and #1 is MACRO variables. When running to ALARM
MACRO command, system will send alarm, and show string” MACRO coordinate X1.234 correct”, #1 will
change to be value automatically.
Valid digits:
MACRO variables with () and numbers can appoint valid digits for MACRO variables to change to be
value, rules are:
When this is integer value, it will add a zero in front of this value.
EX:When #1=12, string will be
” MACHINE coordinate X#1(4)mm” => ” MACHINE coordinate X0012 mm”
EX:When #1=1234567, if the value is over valid digits, it will not do any changes.
” MACHINE coordinate X#1(4)mm” => ” MACHINE coordinate X1234567mm”
When this is not integer value, it will add zero after this value to be a valid value.
EX:When #1=12.34, string will be
” MACHINE coordinate X#1(4) mm” => ” MACHINE coordinate X12.3400 mm”
EX:When #1=12.345678, string will be
” MACHINE coordinate X#1(4) mm” => ” MACHINE coordinate X12.3456 mm”
Stop changing digit:
You can add ’\’ with MACRO variables to make it stop changing value.
EX:When #1=12.345678, string will be
”MACRO calculating result \#1 = #1” => ” MACRO calculating result #1 = 12.345678”
Komentarze do niniejszej Instrukcji