The text of a manual ยท part 6 of 10
Programmable Controller User's Manual, External character display unit type A6FD: 7. PROGRAMMING, pages 28 to 35
Pages 28 to 35 of 60, from Programmable Controller User's Manual, External character display unit type A6FD
The original document is the PDF (2.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Mitsubishi A0J2-E28DT
Page 28
/MELSEC
7. PROGRAMMING 7. PROGRAMMING 7.1 Basic D.isplay Programs
. . . '(1) PR instruction (2) PRC instruction (device comment)
Only devices marked @ are available on the AOJ2CPU.
(1) PR instruction levice revice
Constant Pointer Level
A I Z V K
H
P
I
N
Q c L~ Po w P m p nw
, ;, E= t; 4 g % Z z;= 7
/----D~splay
Carry
Error Flag
M9012
M9010 M9011
0
-
0
0 command
O ~ ~ t p uthe t s ASCII data stored In consecutive source dev~cesstartlng at dev~ce "S" to the s p e c ~ f ~ eserles d of output points.
D~splaycommand
3
OFF -
Executed only once (Al(E), A2(E), A3(E), A3HCPU)
Continuously executed (AOJ2CPU)
.7-1 1% (NA) 66139-A
Page 29
Basic Program
-ASCII code conversion command
ASC
ABCDEFGH
DO
ASC
Program Operation When X I 0 turns on, "ABCDEFGHIJKLMNOP" is converted into ASCll codes and stored into DO to D7. When X I 1 turns on, the ASCll code in DO to D7 is output to YO to Y9. When the AOJ2CPU, the AI(E), A2(E) or A3(E) CPUs are used, 16 consecutive characters are output by this instruction. When the A3HCPU is used the number of output'characters is unlimited, the ASCll string is cont~nuouslyoutput until the code "OOH" is read from the souce data.
Page 30
/MELSEC
7. PROGRAMMING Program Operation Timing ASCll code conversion command
ON
XI0
( A S C ( A B CD E F G H J D O Stores ASCll code "A to H" (8 characters f r o m A to H) into DO to D3.
Stores ASCll code "I to P" (8 character from I to P) Into D4 to D7.
-----
I(
(s executed
$+AI
Continuously executed (AOJ2CPU)
Executed only once (E),;ZIE~,*,~;~
The 16-character ASCll code stored in DO to 7 (8 points) are output from the output unit at head address YO. Outputs used YO t o 9. Output data YO to Y7: ASCll code output Y8: Strobe signal Y9: PR instruction execution flag For the display output tim~ng, refer t o Section 6.1. 1
The data dlsplayed on the A6FD IS shlfted from rlght to left In order until the complete strlng ABCDEFGHIJKLMNOP IS dlsplayed.
I
POINT ( 1. The ASCll codes used for the PR instruction may be generated using the ASC instruction (alphanumeric character t o ASCll code conversion) or may be stored i n the PC device inemory after using t h e List Test function t o load the alphanumeric data into the source data ' registers. 2. Devices t o which the PR instruction is applicable are marked 0. A
Page 31
/MELSEC
.7. PROGRAMMING
.-
Constant Pointer Level , 8 E
X . Y M L B F T C D W R A O A l b Z V K s 0 0 0 0 0 O 0 0 0 0 0 D b e ,v, no a P g v , . ~n a
Word (16-bit) device
Bit device
.
,
Available Device
H
P
I
N
6%;6''
0 0
Carry Flag
Error Flag
M9012
M9010 M9011
0 -
7
0 POINT
% 4
I
Only devices marked O are available on the AOJZCPU.
~ i s ~ l acommand ;
*
. . Outputs the alphanumeric comment ass~gnedto the specified source devlce. Executton cond~tlon -
'
,
0N
,
Display command' '
------------ 1 PRC
.
I
.' ,
I
Executed only once (Al(E), A2(E), A3(E), A3HCPU) Continuously executed (AOJSCPU)
.
>
Basic Program
. SET
Coding
L
FO ,
I
I I 1
.,
I
Number Instrucof S t e m tion
I
Device
1
I SET 1
FO
4
PRC
FO
11
LD
XI1
12
1 RST I
FO
15
END
I
I YO
I
I
I
Program Operation ' When X I 0 is turned on, FO is turned on and, at the same time, the comment-of FO(ASCII code) is output to YO to Y9.
I
In this case, the FO comment ) ABCDEFGHIJKLMNO has already been entered as comment data.
Page 32
/MELSEC
7. PROGRAMMING Program Operation Timing
1-
IS executed
I
Executed only once (Al(E), A2(E), A3(E)1 A3HCPU) JCont~nuously I executed (AOJ2CPU)
The comment (ASCII code) of FO is output from the output unit at head address YO. Used outputs are YO t o 9. Output data YO to Y7: ASCII code output Y8: Strobe signal Y9: PRC instruction execution flag For the display output timing, refer t o Section 6.1 The data d~splayedon the AGFD IS sh~ftedfrom right to left In order until the complete strlng ABCDEFGHIJKLMNOP
POINT
IS d~splayed
I
1. Before executing the PRC instruction, comments must be entered into the PC memory comment area. 2. Only 128 comments (dedicated t o FO t o F127) may be entered on the Al(E)CPU(P21/R21). Only 95 comments (dedicated t o FO t o F94) may be entered on the AOJ2CPU(P21/R21). 3. F coils must be switched on by the OUT or SET instructions only.
Page 33
7.2 Programming Application Examples 1 (For A l , A2, A3CPU)
,
. . _ -
7
In the following program examples the annunciator devices (F) are used t o flag error messages. The annunc~atordevices may be used to queue error codes (in the form of annunciator device numbers) in special function FlFO data registers. The following special function data registers have been used: D9124(stores the number of F coils which have been switched on, up to a maximum of 8.) and D9125 t o D9132 ( A sequence of 8 consecutive special registers arranged as a FlFO table in which the annunciator coil numbers are stored as they are switched on). When the first annunciator coil (F) is switched on, D9124 is incremented by 1 and the F coil number is stored in special data register D9125. Any subsequent annunciator coil switching on which has not alrea'dy been entered into the queue will cause D9124 t o be incremented by 1 and its coil number will be entered into the first empty register after D9125 (up t o D9132).
.
, ,
. (1) Display of annunciator comment using manual reset. f i
In this program, the comment for any annunciator coil which has been switched on is output t o the display. Pressing the reset button on the A6FD causes the next comment i n the queue to be displayed. The program flow chart is shown below. Program 'Concept
I r.
D~splayof next F c o ~comment l from the queue ( c o ~ l numbers stored rn one of D9126 to D9132).
1
7-6
,
'
1
I
I
1
I
Page 34
/MELSEC
7. PROGRAMMING Program Example
I I
P O
I.) Fallure occurence flag
Fallure occurence flag
Pulse generated by MO to read f ~ r s tF number
Manual reset (from A6FD)
*2
Manual reset ~ d d s1 to the ~ n d e x reglster V untll the value In V IS greater than the number of F coils detected. Transfers F toll number to Index reglster 2.
.
,,,, Dlsplays the comment ass~gnedto the F coll. u
=
Resets Index reglster V all F toll comments have been displayed or ~f no F corls have been detected
3 when
K
[>Q1?4O
I
L Program Explanation 1 *I : / >= / ~ 9 1 2 4 KI 1 ] ...... Continuity when the number of detected F coil "on" occurences is one or more. ................ The reset switch is wired to input XO. *2: When the reset button is released, (i.e. XO goes from on to off) a pulse is output on M2. This prevents the PRC instruction from being executed while the A6FD is being reset. *3: >= D91241vj ........ Allows 1 to be added to index register V if the value in D9124 is greater than that In V. (4: MOV I D 9 1 2 4 " I ~...... Moves the contents of data register D9124, indexed by V, (i.e. D(9124 4- V)) to index reaister Z. *5: ~ 0 ' 1 ~ 8] 0......... Displays the appropriate F coil comment on the A6FD wired to outputs Y80 -- Y8F. The F coil number is specified as FO indexed by Z (i.e. F(0-I-Z). "6: < = D 9 1 2 4 1 ~........ ] Checks that all F coil "on" occurences have been processed. If they have, the index register V is reset t o 0, and the program will repeat its operation.
1-
1
I
1
1
-
1 PRCI
1
I
~
Page 35
/MELSEC
7. PROGRAMMING
I Proaram o ~ e r a t i o n1 The following explanation assumes that two F coils have been detected (i.e. the value in D9124 is 2).
1
XO OFF (Manual reset sw~tch)
wl
OFF
(INCIVI
OFF
+I V = l k,
+I v = 2
V = l .
I MOV I D9124' 1 V ]
,
OFF Transfers data In D(9124 4- 1)
,Giq-qq appropriate comment.
1-
OFF
POINT
1
1. Press the manual reset switch t o clear the A6FD display. 2. Only 8 F coil occurences can be stored in the FlFO table , (D9125 t o D9132). Removing an entry from the FlFO table causes all subsequent entires t o move up one place. When the AS(E)CPU or A3HCPU is used, 1 i s subtracted from the contents of D9124 each time the INDICATOR RESET button is pressed. (The INDICATOR RESET button is located on the front of the CPU and is used t o reset the CPU's ASCII display). 3. Provide interlocks i n the PC program t o prevent data output t o the A6FD before its 200msec start-up time has elapsed.
7-8 IB (NA) 66139-A