Displaying Variables And Arrays - Galil Motion Control CDS-3310 User Manual

Table of Contents

Advertisement

If the value of the variable result is equal to 999999.999, the above message statement returns the
following:
The message command normally sends a carriage return and line feed following the statement. The
carriage return and the line feed may be suppressed by sending {N} at the end of the statement. This is
useful when a text string needs to surround a numeric value.
Example:
#A
JG 50000;BGA;ASA
MG "The Speed is", _TVA {F5.1} {N}
MG " counts/sec"
EN
When #A is executed, the above example will appear on the screen as:
Using the MG Command to Configure Terminals
The MG command can be used to configure a terminal. Any ASCII character can be sent by using the
format {^n} where n is any integer between 1 and 255.
Example:
sends the ASCII characters represented by 7 and 255 to the Ethernet/serial port.
Summary of Message Functions
function
" "
{Fn.m}
{P1} or {En}
{$n.m}
{^n}
{N}
{Sn}

Displaying Variables and Arrays

Variables and arrays may be sent to the screen using the format, variable= or array[x]=. For example,
v1= , returns the value of v1.
Example - Printing a Variable and an Array element
46 • Chapter 7 Application Programming
The Final Value is 00004.10
The Final Value is 99999.99
The speed is 50000 counts/sec
MG {^07} {^255}
description
Surrounds text string
Formats numeric values in decimal n digits to the left of the decimal point and
m digits to the right
Send message to Serial Port or Ethernet Port
Formats numeric values in hexadecimal
Sends ASCII character specified by integer n
Suppresses carriage return/line feed
Sends the first n characters of a string variable, where n is 1 thru 6.
Instruction
#DISPLAY
DM posA[7]
Interpretation
Label
Define Array POSA with 7 entries
CDS-3310

Advertisement

Table of Contents
loading

Table of Contents