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-1700/1800 allows for IF conditional statements to be included within other IF conditional statements. This technique is known as ‘nesting’ and the DMC-1700/1800 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 conditional statement(s)

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.

 

 

Example using IF, ELSE and ENDIF:

#TEST

Begin Main Program “TEST”

II,,3

Enable input 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 conditional statement executed if 1st IF conditional true

MG “INPUT 1 AND INPUT 2 ARE ACTIVE”

Message to be executed if 2nd IF conditional is true

ELSE

ELSE command for 2nd IF conditional statement

MG “ONLY INPUT 1 IS ACTIVE

Message to be executed if 2nd IF conditional is false

ENDIF

End of 2nd conditional statement

ELSE

ELSE command for 1st IF conditional statement

MG”ONLY INPUT 2 IS ACTIVE”

Message to be executed if 1st IF conditional statement

ENDIF

End of 1st conditional statement

#WAIT

Label to be used for a loop

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

Loop until both input 1 and input 2 are not active

RI0

End Input Interrupt Routine without restoring trippoints

148 • Chapter 7 Application Programming

DMC-1700/1800

Page 156
Image 156
Galil DMC-1800, DMC-1700 Using the Else Command, Nesting if Conditional Statements, Command Format IF, Else and Endif

DMC-1800, DMC-1700 specifications

The Galil DMC-1700 and DMC-1800 are advanced motion controllers widely recognized for their high performance and versatility in the automation and robotics industries. These controllers are designed to meet the demands of complex motion control applications, providing users with enhanced features and innovative technologies that optimize motion precision and efficiency.

One of the main features of the Galil DMC-1700 is its ability to handle up to 8 axes of motion control. This capability makes it suitable for a range of applications, from simple point-to-point movements to intricate trajectories in multi-axis systems. In contrast, the DMC-1800 extends this functionality, supporting up to 64 axes, making it ideal for large-scale automation environments.

Both models leverage Galil's powerful programming interface, which simplifies the development of motion control applications. The DMC-1700 and DMC-1800 controllers utilize a high-level programming language that supports advanced motion commands, including linear interpolation, circular interpolation, and complex motion profiles. This feature allows users to implement sophisticated motion sequences seamlessly.

In terms of connectivity, the Galil DMC series offers multiple communication options, including Ethernet, RS-232, and CAN bus, ensuring compatibility with various hardware and enabling easy integration into existing systems. The controllers also come equipped with digital and analog I/O ports, providing flexibility for sensor feedback and actuator control.

The advanced technology incorporated into both the DMC-1700 and DMC-1800 includes on-board PID control, which ensures precise motion control through closed-loop feedback. This results in improved stability and accuracy, particularly in high-speed applications. Additionally, the controllers offer extensive diagnostics and monitoring capabilities, allowing for real-time performance analysis and troubleshooting.

Another notable characteristic of these motion controllers is their compact design, which offers space-saving advantages while maintaining high processing power. Their robust construction and ability to operate in challenging environments make them suitable for a wide range of industrial applications, from CNC machining to assembly lines.

In conclusion, the Galil DMC-1700 and DMC-1800 motion controllers stand out due to their high-performance capabilities, advanced programming features, and flexibility in connectivity. With their ability to handle complex motion control tasks efficiently, these controllers are invaluable tools for engineers and manufacturers looking to enhance their automation processes. By integrating Galil's innovative motion control technology, industries can achieve greater precision, speed, and reliability in their operational workflows.