Displaying Characters On The Screen - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

3 LET'S CREATE AND EXECUTE A PROGRAM

3.10 Displaying Characters on the Screen

OK
PRINT " ABC"
ABC
OK
3 - 32
The PRINT instruction is used to display text on the screen. Since this instruction is
mostly used, '?' is read as PRINT in BASIC.
Example
The text to be printed on the screen is specified after the PRINT instruction.
Items that can be displayed are constants, contents of variables, contents of arrays,
values of functions, and all these items combined with the operands.
Example
PRINT "ABC"
The character constant "ABC" will be displayed.
PRINT A%
The contents of the integer variable A% will be displayed.
PRINT A$+C$
The contents of character variable A$ plus the contents of
character variable C$ will be displayed.
Also, the texts can be displayed continuously by separating them by "," (comma) and
";" (semicolon) with the PRINT instruction.
Examples of using ";" (semicolon) are shown below.
Example
OK
A=100
OK
B=-50
OK
PRINT A;B;A+B
00
-50
50
Contents
Contents
of A
of A+B
Contents of B
As shown above, when a ";" (semicolon) is used, one data is displayed, then the next
data is displayed immediately after it. The only thing to be careful is that the display
method for numeric values and characters are different.
• When numeric values are being displayed, a sign is always shown in front.
When the value is negative, "-"
When the value is positive, " " (A space is displayed.)
• When a numeric value is displayed, a space is automatically inserted after the
value. ( Example above may be easier to understand after this is said.)
Because of this, a space is inserted even if ";" is used to display data
continuously. Text display doesn't have the same characteristics, so they are
displayed continuously without spaces.
OK
?"ABC"
ABC
OK
OK
A$= " ABCD"
OK
B$= " EFGH"
OK
PRINT A$;B$;A$+B$
ABCDEFGHABCDEFGH
Contents
Contents
of A$
of A$+B$
Contents of B$
MELSEC-Q
Using '?' for 'PRINT'
is really convenient.
3 - 32

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents