Galil Motion Control DMC-21 5 Series User Manual page 113

Table of Contents

Advertisement

:v1=?
$0A.00
:VF1
:v1=?
9
Local Formatting of Variables
PF
and
VF
commands are global format commands that affect the format of all relevant returned values and
variables. Variables may also be formatted locally.
:VF 10.4
:v1=10
:v1=
10.0000
:v1={F4.2}
0010.00
:v1={$4.2}
$000A.00
:v1="ALPHA"
:v1={S4}
ALPH
The local format is also used with the
Converting to User Units
Variables and arithmetic operations make it easy to input data in desired user units such as inches or RPM.
The DMC-21x5 position parameters such as PR, PA, and
such as SP, JG, and
VS
counts/sec
2
. The controller interprets time in milliseconds.
All input parameters must be converted into these units. For example, an operator can be prompted to input a
number in revolutions. A program could be used such that the input number is converted into counts by
multiplying it by the number of counts/revolution.
#run;
cts=2000;
MG
"Enter number of
revolutions";
MG
"rev=?"
rev=0;
#rev;
WT
20
JP
#rev,(rev=0);
PR
rev*cts;
MG
"Enter speed in
MG
"rpm=?"
rpm=0;
#spd;
WT
20
JP
#spd,(rpm=0);
SP
rpm*cts/60;
MG
"Enter acceleration in
Rad/sec2";
MG
"acc=?"
Chapter 7 Application Programming ▫ 108
'return v1
'change format
'return v1
'set default variable format
'assign v1 variable
'return v1
'specify local format
'specify hex format
'assign string "ALPHA" to v1
'specify string format first 4 characters
MG
command.
have units of counts/sec. Acceleration parameters such as AC, DC, VA, and
'main program label
'counts per rev conversion factor
'prompt for number of revs
'initialize rev variable
'label for loop
'jump back to rev label if variable is unchanged
'define relative position move in counts
RPM";
'prompt for speed
'initialize rpm variable
'label for loop
'jump back to spd label if variable is unchanged
'convert to counts/sec and use as speed
'prompt for acceleration
have units of quadrature counts. Speed parameters
VP
have units of
VD
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents