3 - 15 3 - 15
3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS
(a) Index modification
Index modification is indirect address specification using the index register.
When the index register is used, the device number is (directly specified
device number) + (index register contents).
[Description example]
(* The target D device number is changed for the numeric value in Z2
*)
(* When 1 is in Z2, the target device number changes from D(0+1) to D1. *)
Z2 := 1;
D0Z2 := K0;
D1
(* 1 is assigned to index register Z2 *)
(* K0 is assigned to D0Z2 *)
(b) Bit specification
By specifying the bit No. of a word device, it can be used as a bit device.
D0.1
Word device
Bit No.
[Description example]
D0.0 = TRUE;
(* Bit 0 of D0 device is turned ON. *)
W0.F = FALSE;
(* Bit 15 of W0 device is turned OFF. *)
(c) Digit specification
By specifying the 4 bits, 8 bits, 12 bits, etc. of a bit device as a single digit,
word data or double word data can be handled by the bit device.
K4X0
Bit device
Digit specification
[Description example]
K4X0 := D0;
(* 16 bits are used from X0 device as integer
type (INT) and D0 is assigned. *)
Wtest := K1X0;
(* 4 bits are assigned to word type label
Wtest from X0 device. *)
Dwtest := K5X0;
(* 20 bits are assigned to double word type
label Dwtest from X0 device. *)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......