BASIC Moves Development Studio
06/2005
Danaher Motion
30 Rev
E
M-SS-005-03l
To change printing to
Binary
format, type:
System.PrintMode = BIN
To restore printing to
Decimal
format, enter:
System.PrintMode = DECIMAL
Printing double floating point numbers is not affected by
System.PrintMode
.
As an alternative to
PrintMode
, you can place the keywords Decimal, Hex or
Binat the end of
or
PrintUsing
to print expressions in these formats.
Subsequent print instructions (
?
,
,
PRINTU
, and
PRINTUSING
) are
not affected.
INPB
,
INPW
,
PEEKB
, and
PEEKW
return long values. If you query any of
these functions while in PrintMode decimal, the result is misleading. Change
to Hex or Bin for the correct result.
System.DoubleFormat ,
defined from the configuration file ,
sets the double number
printing format for print of double-type numbers.
System.DoubleFormat = 1 – print in Floating point format ( 132.555 )
System.DoubleFormat = 0 - print in Exponential format ( 1.32555000002 )
Program
Sys.DoubleFormat = 1
End Program
-->?Sys.DoubleFormat
-->1
2.2.13. Flow
Control
Flow control is the group of instructions that control the sequence of
execution of all other instructions. For detailed information on any of the flow
control commands (including examples), refer to the
SERVOSTAR
®
MC
Reference Manual
.
If…Then
is the most basic flow control statement. The syntax of If…Then is:
If
condition
Then
<
first statement to execute if condition is true
>
{
multiple statements to execute if condition is true
}
{Else
<
first statement to execute if condition is false
>
{
multiple statements to execute if condition is
false
}}
End If
where:
If…Then
must be followed by at least one statement.
Else is optional, but if present must be followed by at least
one statement.
There is no Else if
. If you use an If after an Else, you must
place the If on a new line.
Select…Case
is an extension of
If…Then
. Anything that can be done with
Select…Case
can also be done with
If…Then
. Many times,
Select…Case
simplifies programming logic.
On the first line of a Case block of commands, you specify the variable or
expression you want tested. For example:
Select Case I
Tests the variable I for a range of conditions.
You can also select expressions:
Select Case I - M/N