Mitsubishi Electric MELSEC Q Series Programming Manual page 34

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS
3 - 10
Precaution for use of the H, 2#, 8# and 16#-specified numeric values in word
label and word device operation expressions
When the value handled in operation is in the range H8000 to HFFFF, the
operation result available by ST program conversion differs from the operation
result available by the assignment of a value to a device in the PLC CPU.
Since whether the handled value is a word type or double word type cannot be
judged in the operation result available by ST program conversion, it is operated
as unsigned, but it is operated as signed in the PLC CPU.
<Example of use>
Data1 = -32768;
Data2 = 16#8000;
• ST
Result := Data1 / Data2;
• CPU Result := Data1 / Data2;
Precaution for use of "$" and " ' " in character string type data
"$" is used as an escape sequence.
Two hexadecimal numbers following "$" are recognized as the ASCII code, and
the characters corresponding to the ASCII code are inserted into the character
string.
A conversion error will occur when the two hexadecimal numbers following "$"
do not correspond to the ASCII code.
However, an error will not occur when the characters following "$" are any of the
following.
Representation
$$
$'
$L or $1
$N or $n
$P or $p
$R or $r
$T or $t
Example: Value := "$'APPLE$' $$100";
Precaution for binary, octal, decimal, hexadecimal and real number
representations
In binary, octal, decimal, hexadecimal or real number representation, "_
(underscore)" can be used for ease of identification. "_" is ignored as a numeric
value.
Example: 2#1101_1111 8#377_1 16#01FF_ABCD 22_323 1.0_1
(When K, H or E is specified, "_" cannot be used.)
-32768 / 32768 = -1
-32768 / -32768 = 1
Symbol/Printer Code Used in Character String
$
'
Line feed
Change line
Page scrolling
Carriage return
Tab
3 - 10

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents