Bit-Wise Operators

The mathematical operators & and are bit-wise operators. The operator, &, is a Logical And. The operator, , is a Logical Or. These operators allow for bit-wise operations on any valid DMC-3425 numeric operand, including variables, array elements, numeric values, functions, keywords, and arithmetic expressions. The bit-wise operators may also be used with strings. This is useful for separating characters from an input string. When using the input command for string input, the input variable will hold up to 6 characters. These characters are combined into a single value that is represented as 32 bits of integer and 16 bits of fraction. Each ASCII character is represented as one byte (8 bits), therefore the input variable can hold up to six characters. The first character of the string will be placed in the top byte of the variable and the last character will be placed in the lowest significant byte of the fraction. The characters can be individually separated by using bit-wise operations as illustrated in the following example:

Instruction

Interpretation

#TEST

Begin main program

IN "ENTER",LEN{S6}

Input character string of up to 6 characters into

 

variable ‘LEN’

FLEN=@FRAC[LEN]

Define variable ‘FLEN’ as fractional part of

 

variable ‘LEN’

FLEN=$10000*FLEN

Shift FLEN by 32 bits (IE - convert fraction,

 

FLEN, to integer)

LEN1=(FLEN&$00FF)

Mask top byte of FLEN and set this value to

 

variable ‘LEN1’

LEN2=(FLEN&$FF00)/$100

Let variable, ‘LEN2’ = top byte of FLEN

LEN3=LEN&$000000FF

Let variable, ‘LEN3’ = bottom byte of LEN

LEN4=(LEN&$0000FF00)/$100

Let variable, ‘LEN4’ = second byte of LEN

LEN5=(LEN&$00FF0000)/$10000

Let variable, ‘LEN5’ = third byte of LEN

LEN6=(LEN&$FF000000)/$1000000

Let variable, ‘LEN6’ = fourth byte of LEN

MG LEN6 {S4}

Display ‘LEN6’ as string message of up to 4 chars

MG LEN5 {S4}

Display ‘LEN5’ as string message of up to 4 chars

MG LEN4 {S4}

Display ‘LEN4’ as string message of up to 4 chars

MG LEN3 {S4}

Display ‘LEN3’ as string message of up to 4 chars

MG LEN2 {S4}

Display ‘LEN2’ as string message of up to 4 chars

MG LEN1 {S4}

Display ‘LEN1’ as string message of up to 4 chars

EN

 

This program will accept a string input of up to 6 characters, parse each character, and then display each character. Notice also that the values used for masking are represented in hexadecimal (as denoted by the preceding ‘$’). For more information, see section Sending Messages.

To illustrate further, if the user types in the string “TESTME” at the input prompt, the controller will respond with the following:

T

Response from command MG LEN6 {S4}

E

Response from command MG LEN5 {S4}

S

Response from command MG LEN4 {S4}

T

Response from command MG LEN3 {S4}

M

Response from command MG LEN2 {S4}

E

Response from command MG LEN1 {S4}

128 • Chapter 7 Application Programming

DMC-3425

Page 136
Image 136
Galil DMC-3425 user manual Bit-Wise Operators, ENTER,LENS6, Flen=@Fraclen, LEN1=FLEN&$00FF

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.