Справочник Пользователя для Mitsubishi Electronics FX

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-89
5.8.8
PR (FNC 77)
Operation:
Source data (stored as ASCII values) is read byte
by byte from the source data devices. Each byte is
m a p p e d   d i r e c t l y   t o   t h e   f i r s t   8   c o n s e c u t i v e
destination devices D
+0 
to D
+7
). The final two destination bits provide a strobe signal (D
+10
,
numbered in octal) and an execution/busy flag (D
+11
, in octal).
Points to note:
a) The source byte-data maps the lowest bit to the first destination device D
+0. 
Consequently
the highest bit of the byte is sent to destination device D
+7. 
b) The PR instruction may be used ONCE on FX units fitted with CPU versions earlier than
3.07. FX units with CPU ver3.07 or later and all FX
2 C 
units can operate TWO PR
instructions. This instruction should only be used on transistor output PLC’s. The PR
instruction will not automatically repeat its operation unless the drive input has been turned
OFF and ON again.
c) The operation of the PR instruction is program scan dependent. Under standard
circumstances it takes 3 program scans to send 1 byte. However, for a faster operation the
PR instruction could be written into a timer interrupt routine similar to the one demonstrated
for HKY on page 5-82.
d)8 byte operation has the following timing diagram. It
should be noted that when the drive input (in the
example X0) is switched OFF the PR instruction will
cease operation. When it is restarted the PR instruction
will start from the beginning of the message string.
Once all 8 bytes have been sent the execution/busy flag
is dropped and the PR instruction suspends operation.
e) 16 byte operation requires the special auxiliary flag
M8027 to be driven ON (it is recommended that
M8000 is used as a drive input). In this operation
mode the drive input (in the example X0) does not
have to be active all of the time. Once the PR
instruction is activated it will operate continuously
until all 16 bytes of data have been sent or the value
00H (null) has been sent. Once the operation is
complete the execution/busy flag (D
+11
, octal) is
turned OFF and M8029 the execution complete flag
is set.
Mnemonic
Function 
Operands
Program steps
S
D
1
PR
FNC 77
(Print)
Outputs ASCII
data to items
such as display
units
T, C, D
Note: 8 byte mode (M8027=OFF)
uses 4 consecutive devices
16 byte mode (M8027= ON) uses 8
consecutive devices
Y
Note: uses
10
consecutive
devices.
PR:
5 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
FLAGS
Operation
Complete M8029
X0
D300
PR
[ D ]
[ S ]
Y 0
F X - 6
!
T0
T0
T0
X0
Y0 - Y7
Y10
Y11
(D+0 - D+7)
(D+10)
(D+11)
Note:To=scan time, see note c.
T0
T0
T0
X0
Y0 - Y7
Y10
Y11
M8029
(D+0 - D+7)
(D+10)
(D+11)
Note:To=scan time, see note c.