
289
Part 4 Commands
STRH (Convert character string; hexadecimal)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Optional Optional STRH Column
number
Data CC
[Function] Copy to the column specified in operand 1 a hexadecimal character string converted from
the data specified in operand 2.
Only the integer part will be adjusted to the length set by a SLEN command.
If the data exceeds the specified length, it will be cut off at the length set by a SLEN
command.
If the entire data has been converted within the length set by a SLEN command, the output
will turn ON.
(Note)
If the data specified in operand 2 is a negative value, eight columns will be required to
covert the entire data.
[Example]
SLEN 5
Set a format consisting of five integer digits.
STRH 1
255
The following values will be set in columns 1 to 5:
1
2
3
4
5
F F
LET
1
10
Assign 10 to variable 1.
LET
102
987.6543 Assign 987.6543 to variable 102.
SLEN 2.3
Set a length consisting of two integer digits and three
decimal digits.
STRH *1
*102
The following values will be set in columns 10 and 11:
10 11
D B
“.3” in the SLEN command and “.6543” in variable 102,
which are the decimal part, will be ignored.
The integer part is expressed as ‘3DB’ in hexadecimal.
Since the length is two digits, however, “3” in the third
digit will be cut off.
290
Part 4 Commands
VAL (Convert character string data; decimal)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Optional Optional VAL
Variable
number
Column
number,
character literal
CC
[Function] Convert the decimal data in the column specified in operand 2 to a binary and assign the
result to the variable specified in operand 1.
Conversion will be performed for the length set by a SLEN command.
If a character-string literal is specified in operand 2, conversion will be performed for the
entire length of the literal.
(Note)
Keep the converting length to 18 characters or less.
[Example]
SCPY
10
‘1234’
Set ‘1234’ in column 10.
SLEN
4
Set the converting length to four bytes.
VAL
1
10
Assign 1234, which is a binary converted from ‘1234’ in
column 10, to variable 1.
LET
1
100
Assign 100 to variable 1.
LET
2
20
Assign 20 to variable 2.
SCPY
20
‘1234’
Copy ‘1234’ to column 20.
SCPY
24
‘.567’
Copy ‘.567’ to column 24.
SLEN
8
Set the converting length to eight bytes.
VAL
*1
*2
Assign 1234.567, which is a binary converted from
‘1234.567’ in the content of variable 2 (column 20) to
the content of variable 1 (variable 100).
293
Содержание X-SEL PX
Страница 1: ...Operation ManualSeventh Edition X SEL Controller PX QX Type Tenth Edition ...
Страница 2: ......
Страница 8: ......
Страница 14: ......
Страница 39: ...15 Part 1 Installation Reference Circuit Diagram Surge absorber Solenoid valve Controller 0 V 15 ...
Страница 410: ...383 Appendix 386 ...
Страница 452: ...425 Appendix 5 428 ...
Страница 559: ......