Instruction

Interpretation

v1=10

Assign v1

v1=

Return v1

: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-2x00 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-2x00 has an 8-bit uncommitted output port and an additional 64 I/O which may be configured as inputs or outputs with the CO command for controlling external events. The DMC- 2x50 through DMC-2x80 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).

DMC-2X00

Chapter 7 Application Programming y 113

Page 168
Image 168
Galil DMC-2X00 user manual Hardware I/O, Converting to User Units, Digital Outputs, Alph