:0000000010.0000 Default Format
v1={F4.2} Specify local format
:0010.00 New format
v1={$4.2} Specify hex format
:$000A.00 Hex value
v1="ALPHA" Assign string "ALPHA" to v1
v1={S4} Specify string format first 4 characters
:ALPH
The local format is also used with the MG command.
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-40x0 position parameters such as PR, PA and VP have units of quadrature counts. Speed parameters
such as SP, JG and VS have units of counts/sec. Acceleration parameters such as AC, DC, VA and VD have units
of counts/sec2. 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.
Instruction Interpretation
#RUN Label
IN "ENTER # OF REVOLUTIONS",n1 Prompt for revs
PR n1*2000 Convert to counts
IN "ENTER SPEED IN RPM",s1 Prompt for RPMs
SP s1*2000/60 Convert to counts/sec
IN "ENTER ACCEL IN RAD/SEC2",a1 Prompt for ACCEL
AC a1*2000/(2*3.14) Convert to counts/sec2
BG Begin motion
EN End program
Hardware I/O
Digital Outputs
The DMC-40x0 has an 8-bit uncommitted output port and an additional 32 I/O which may be configured as inputs or
outputs with the CO command for controlling external events. The DMC-4050 through DMC-4080 has an
additional 8 outputs. Each bit on the output port may be set and cleared with the software instructions SB (Set Bit)
and CB (Clear Bit), or OB (define output bit).
Example- Set Bit and Clear Bit
Instruction Interpretation
SB6 Sets bit 6 of output port
CB4 Clears bit 4 of output port
DMC-40x0 User Manual Chapter 7 Application Programming • 164