3 - 10 3 - 10
3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS
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; -32768 / 32768 = -1
• CPU Result := Data1 / Data2; -32768 / -32768 = 1
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
Symbol/Printer Code Used in Character String
$$ $
$' '
$L or $1
Line feed
$N or $n
Change line
$P or $p
Page scrolling
$R or $r
Carriage return
$T or $t
Tab
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.)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......