Galil DMC-3425 Outputting Numbers and Strings, Deallocating Array Space, Sending Messages

Models: DMC-3425

1 210
Download 210 pages 53.34 Kb
Page 143
Image 143
Deallocating Array Space

RC1

Start recording now, at rate of 2 msec

BG AB

Begin motion

#A;JP #A,RC=1

Loop until done

MG "DONE"

Print message

EN

End program

#PLAY

Play back

N=0

Initial Counter

JP# DONE,N>300

Exit if done

N=

Print Counter

A POS[N]=

Print A position

B POS[N]=

Print B position

AERR[N]=

Print A error

BERR[N]=

Print B error

N=N+1

Increment Counter

#DONE

Done

EN

End Program

Deallocating Array Space

Array space may be deallocated using the DA command followed by the array name. DA*[0] deallocates all the arrays.

Outputting Numbers and Strings

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:

MG "The Final Value is", RESULT

In addition to variables, functions and commands, responses can be used in the message command. For example:

MG "Analog input is", @AN[1] MG "The Position of A is", _TPA

Specifying the Port for Messages:

By default, messages will be sent through the port from which the data was requested. However, the port can be specified with the specifier, {P1} for the main serial port or {Ea} for the Ethernet handle. ‘a’ will be the handle letter, A through H.

MG {P1} "Hello World"

Sends message to Serial

DMC-3425

Chapter 7 Application Programming135

Page 143
Image 143
Galil DMC-3425 user manual Outputting Numbers and Strings, Deallocating Array Space, Sending Messages