JP#WAIT,(@IN[1]=0) (@IN[2]=0)

Loop until Input 1& 2 are not active

RI0

End Input Interrupt Routine without restoring

 

trippoints

Subroutines

A subroutine is a group of instructions beginning with a label and ending with an end command (EN). Subroutines are called from the main program with the jump subroutine instruction JS, followed by a label or line number, and conditional statement. Up to 8 subroutines can be nested. After the subroutine is executed, the program sequencer returns to the program location where the subroutine was called unless the subroutine stack is manipulated as described in the following section.

An example of a subroutine to draw a square 500 counts per side is given below. The square is drawn at vector position 1000,1000.

Instruction

Interpretation

#M

Begin Main Program

CB1

Clear Output Bit 1 (pick up pen)

VP 1000,1000;LE;BGS

Define vector position; move pen

AMS

Wait for after motion trippoint

SB1

Set Output Bit 1 (put down pen)

JS #Square;CB1

Jump to square subroutine

EN

End Main Program

#Square

Square subroutine

V1=500;JS #L

Define length of side

V1=-V1;JS #L

Switch direction

EN

End subroutine

#L;PR V1,V1;BGA

Define A,B; Begin A

AMA;BGB;AMA

After motion on A, Begin B

EN

End subroutine

Stack Manipulation

It is possible to manipulate the subroutine stack by using the ZS command. Every time a JS instruction, interrupt or automatic routine (such as #POSERR or #LIMSWI) is executed, the subroutine stack is incremented by 1. Normally the stack is restored with an EN instruction. Occasionally it is desirable not to return back to the program line where the subroutine or interrupt was called. The ZS1 command clears 1 level of the stack. This allows the program sequencer to continue to the next line. The ZS0 command resets the stack to its initial value.

Auto-Start and Auto Error Routine

The DMC-3425 has two special labels for automatic program execution. A program which has been saved into the controllers non-volatile memory can be automatically executed upon power up or reset by beginning the program with the label #AUTO. The program must be saved into non-volatile memory using the command, BP.

If the program loaded onto the EEPROM has a checksum error at power-up, the routine #AUTOERR will run instead, allowing the user to determine the nature of the checksum error. The _RS operand may be used to determine what sector of the EEPROM has been corrupted.

DMC-3425

Chapter 7 Application Programming123

Page 131
Image 131
Galil DMC-3425 user manual Subroutines, Stack Manipulation, Auto-Start and Auto Error Routine

DMC-3425 specifications

The Galil DMC-3425 is a sophisticated motion controller known for its versatility and high performance in various industrial applications. Designed primarily for multi-axis control, it is well-suited for robotics, CNC machinery, and automated manufacturing systems.

One of the standout features of the DMC-3425 is its ability to control up to 32 axes simultaneously, providing unparalleled flexibility for complex motion tasks. This capability is enhanced by its advanced motion algorithms that ensure smooth and precise movements, essential for high-quality manufacturing and assembly processes. The controller supports a variety of motor types, including servo, stepper, and brushless motors, making it compatible with a wide range of existing equipment.

In terms of connectivity, the DMC-3425 offers an extensive selection of communication options. It supports Ethernet, RS-232, and RS-485 interfaces, allowing for seamless integration with various industrial networks, including EtherCAT and CANopen. This connectivity is vital for real-time data exchange and remote monitoring, enhancing overall system efficiency.

The controller is powered by Galil's innovative software architecture, which includes the DMC programming language. This user-friendly language enables engineers to create complex motion profiles easily, with support for trajectory generation, coordinate transformations, and PID control. The DMC-3425 also features built-in commands for motion profiling, including linear and circular interpolation, allowing for sophisticated path planning.

Moreover, the DMC-3425 comes equipped with an integrated programming environment that facilitates rapid application development. Users can simulate motion profiles before implementation, reducing downtime and minimizing errors. This environment is designed for quick learning, making it accessible even for those new to motion control.

Additionally, the Galil DMC-3425 features a robust safety architecture. It includes over-temperature detection, emergency stop inputs, and configurable limits for position and speed, ensuring safe operation in various environments.

Overall, the Galil DMC-3425 is a powerful and flexible motion controller that combines advanced technologies with user-friendly design. Its ability to handle multiple axes, extensive connectivity options, and comprehensive programming environment make it a top choice for manufacturers seeking to enhance automation and improve productivity in their operations.