BASIC Moves Development Studio
06/2005
Danaher Motion
28 Rev
E
M-SS-005-03l
With…End With
Simplifies blocks of code, which set a number of parameters on
the same motion element (axis or group). After a
With
is
encountered, all parameters where the element is not specified
are assumed to belong to the element specified in the
With
.
With
is valid in Configuration, Task, or Terminal contexts. The
scope of a configuration
With
is global, whereas the scopes of
both terminal and task
With
’s are limited to terminal and task,
respectively.
To put off the
With
’s effect, use
End With
. A task
With
must be
followed by the
End With
, thus creating a closed
With
block. A
With
block must be closed within the same block it was opened
(i.e., Program, Sub and Function blocks). For example:
A1.VMax = 5000
A1.Vord = 5000
A1.VCruise = 3000
A1.PEMax = 10
A1.PESettle = 0.01
Move A1 100
Can be simplified using
With
:
With A1
VMax = 5000
Vord = 5000
VCruise = 3000
PEMax = 10
PESettle = 0.01
Move 100
End With
2.2.12. Printing
MC-BASIC provides unformatted and formatted printing using the PRINT
and PRINTUSING commands. For detailed information on any of the print
commands (including examples), refer to the
SERVOSTAR
®
MC Reference
Manual
.
The
command (short form,
?
) is used to print expressions from the
terminal window or from your program. If you issue print commands from the
terminal window, they print to the terminal window. If you issue them from
your program, they print to the BASIC Moves Message Log. You can view
the message log by selecting Window, Message Log.
Within programs,
allows you to suppress the carriage return at the
end of a line by terminating the command with a comma or a semicolon.
Semicolon and comma have no effect when added to the end of print
commands from the terminal window.
Print “Hello, “;
Print “ world.” 'Prints:
Hello, world.
When commas are added to print command as separators between
expressions, a tabular
space is placed between the expressions in the
printed outcome.
Print “Hello, “,
Print “ world.” 'Prints:
Hello, world.