Output Of Data (Numeric And String); Sending Messages - Galil Motion Control DMC-1600 Series User Manual

Table of Contents

Advertisement

In this example, the message "Enter Length" is displayed on the computer screen. The controller
waits for the operator to enter a value. The operator enters the numeric value which is assigned to
the variable, LENX.
Cut-to-Length Example
In this example, a length of material is to be advanced a specified distance. When the motion is
complete, a cutting head is activated to cut the material. The length is variable, and the operator is
prompted to input it in inches. Motion starts with a start button which is connected to input 1.
The load is coupled with a 2 pitch lead screw. A 2000 count/rev encoder is on the motor, resulting
in a resolution of 4000 counts/inch. The program below uses the variable LEN, to length. The IN
command is used to prompt the operator to enter the length, and the entered value is assigned to
the variable LEN.
#BEGIN
AC 800000
DC 800000
SP 5000
LEN=3.4
#CUT
AI1
IN "enter Length(IN)", LEN
PR LEN *4000
BGX
AMX
SB1
WT100;CB1
JP #CUT
EN
Inputting String Variables
String variables with up to six characters may input using the specifier, {Sn} where n represents
the number of string characters to be input. If n is not specified, six characters will be accepted.
For example, IN "Enter X,Y or Z", V{S} specifies a string variable to be input.

Output of Data (Numeric and String)

Numerical and string data can be output from the controller using several methods. The message
command, MG, can output string and numerical data. Also, the controller can be commanded to
return the values of variables and arrays, as well as other information using the interrogation
commands (the interrogation commands are described in chapter 5).

Sending Messages

Messages may be sent to the bus using the message command, MG. This command sends
specified text and numerical or string data from variables or arrays to the screen.
Text strings are specified in quotes and variable or array data is designated by the name of the
variable or array. For example:
144 • Chapter 7 Application Programming
LABEL
Acceleration
Deceleration
Speed
Initial length in inches
Cut routine
Wait for start signal
Prompt operator for length in inches
Specify position in counts
Begin motion to move material
Wait for motion done
Set output to cut
Wait 100 msec, then turn off cutter
Repeat process
End program
MG "The Final Value is", RESULT
DMC-1600

Advertisement

Table of Contents
loading

Table of Contents