NOTE: An ENDIF command must always be executed for every IF command that has been executed. It is recommended that the user not include jump commands inside IF conditional statements since this causes re-direction of command execution. In this case, the command interpreter may not execute an ENDIF command.

Using the ELSE Command

The ELSE command is an optional part of an IF conditional statement and allows for the execution of command only when the argument of the IF command evaluates False. The ELSE command must occur after an IF command and has no arguments. If the argument of the IF command evaluates false, the controller will skip commands until the ELSE command. If the argument for the IF command evaluates true, the controller will execute the commands between the IF and ELSE command.

Nesting IF Conditional Statements

The DMC-3425 allows for IF conditional statements to be included within other IF conditional statements. This technique is known as 'nesting' and the DMC-3425 allows up to 255 IF conditional statements to be nested. This is a very powerful technique allowing the user to specify a variety of different cases for branching.

Command Format - IF, ELSE and ENDIF

Format:

Description

 

 

IF <condition>

Execute commands proceeding IF command (up to ELSE command) if

 

conditional statement(s) is true, otherwise continue executing at ENDIF command

 

or optional ELSE command.

ELSE

Optional command. Allows for commands to be executed when argument of IF

 

command evaluates not true. Can only be used with IF command.

ENDIF

Command to end IF conditional statement. Program must have an ENDIF

 

command for every IF command.

 

 

Instruction

Interpretation

#TEST

Begin Main Program "TEST"

II,,3

Enable interrupts on input 1 and input 2

MG "WAITING FOR INPUT 1, INPUT 2"

Output message

#LOOP

Label to be used for endless loop

JP #LOOP

Endless loop

EN

End of main program

#ININT

Input Interrupt Subroutine

IF (@IN[1]=0)

IF conditional statement based on input 1

IF (@IN[2]=0)

2nd IF executed if 1st IF conditional true

MG "INPUT 1 AND INPUT 2 ARE ACTIVE"

Message executed if 2nd IF is true

ELSE

ELSE command for 2nd IF statement

MG "ONLY INPUT 1 IS ACTIVE

Message executed if 2nd IF is false

ENDIF

End of 2nd conditional statement

ELSE

ELSE command for 1st IF statement

MG"ONLY INPUT 2 IS ACTIVE"

Message executed if 1st IF statement

ENDIF

End of 1st conditional statement

#WAIT

Label to be used for a loop

122 • Chapter 7 Application Programming

DMC-3425

Page 130
Image 130
Galil DMC-3425 user manual Using the Else Command, Nesting if Conditional Statements, Command Format IF, Else and Endif

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.