Home
AD51-S3 - User`s Manual
Contents
1. A A A AAA 9 1 9 2 Battery Changing Procedure eee ee ee een er ee rir 9 2 APPENDICES ccc rere rec e n n HH 1 APP 12 APPENDIX Differences between AD51 S3 and 051 e n APP 1 APPENDIX2 Special Function Module Buffer Memory Address Tables nnne APP 2 APPENDIX GPP HGP Display Control Codes APP 7 APPENDIX 4 GPP HGP PHP Key Codes and Character Codes nnn APP 8 APPENDIX 5 Storing the AD51E Memory Data into ROM Using the A6WU nn APP 11 APPENDIX 6 External View enbs ttossoospeesoseevsevecosvveseooeecettescevececessevocecoseosevceseceoocveceeocesene APP 12 IB NA 1 INTRODUCTION MELSEC 4 1 INTRODUCTION The AD51 S3 intelligent communication module referred to as AD51 has two RS 232C and two RS 422 interfaces and allows multitask processing of BASIC programs User application programs running in the AD51 allow the follow ing functions 1 The A series peripheral devices can be shared The A6GPP intelligent graphic programming panel GPP A6HGP LCD handy graphic programmer HGP or A6PHP plasma handy graphic programmer PHP started up by the SW AD51P system disk SW AD51P can be used the an I O console of the AD51 and allows AD51 programs and data to be stored on disk and ROM GPP only The VT 220 terminal can also be used as I O console The above indicated units may be connected as shown below BASIC Program Data Connection Example
2. 3 The AD51 S3 has system data transfer mode which allows system data to be transferred from 4F00 4FFF to 8000 80FF of channel 1 This mode allows system data to be stored onto ROM APP 1 IB NA 66189 A APPENDICES APPENDIX 2 Special Function Module Buffer Memory Address Tables The following tables list special function module buffer memory addresses specified by the AD51 using system subroutines SATR and SATW For full information on the buffer memory see the corresponding module manual 1 A68AD analog to digitat converter module Address nae from AD51 Buffer Memory Assignment Address for FROM TO Instruction 8 lower bits lower bits 8 higher bits Number of cannes 8 3 CH1 averaging time com sw averaging time co ee _ averaging time count sea 8 8 CHS averaging time coum e S CHE averaging time coum e s 7 CHT averaging time eum 9 m 8 He averaging time cum s s 3 omwgmrompu vawe 39 e Oooo 1 _ digital output value o 9 CHS digital output vae 4 digital output vae 5 o o ooo z gt 2 A62DA digital to analog converter module Address Se
3. Sets time check period to 60 600m sec 140 A 0 Sets data destination head address to variable A 150 FOR 0 TO 2047 STEP 64 160 Z ZWR2 2 2802 Sets head step number of sequence program to be read 170 Z ZWR2 2 F806 A Sets data destination head address 180 Z CALL 0 808A 2 800 Reads sequence program 185 IF Z 0 PRINT ERROR 2 GOTO 180 Checks for errors in SAAR execution 190 A AF128 Adds 128 64 steps to head address of area to be read 200 NEXT 210 Z ZWR1 2 F810 Defines PC station number as host 220 Z ZWR2 2 F814 128 eene Sets read byte length to 128 230 Z ZWR2 2 F818 60 o Sets time check period to 60 600msec 240 FOR 1 0 TO STEP 80 250 Z ZWR2 2 F811 260 Z ZWR1 2 F813 0 270 Z ZWR2 2 F816 000041 Sets data destination head address 280 Z CALL O 8090 2 F810 Reads parameters 285 IF Z 0 PRINT ERROR 2 280 Checks for errors in SAPR execution 290 NEXT 300 END A EE Sets parameter read head address o 38 ormP 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 2 Sequence program write Program example Program to write the main sequence program and parameters from the AD51 to the PC CPU Channel 2 E000 to EFFF Sequence program 2K steps Channel 2 D000 to DBF
4. 1 to 24 Column specification 1 to 80 Example To specify line 5 and column 10 Line specification Column specification Note The LOCATE command counts the line and column starting at 0 If LOCATE 0 0 is executed code ESC 1 1 H is transmitted to the VT220 APP 10 NA 661 APPENDICES APPENDIX 5 Storing the AD51E Memory Data into ROM Using the AGWU The AD51E internal memory and buffer memory data can be stored into the ROM with the AGWU P ROM writer unit connected with the PC CPU For the operating procedure see the AeWU Operating Manual The addresses must be set as follows when the AD51E data is written to the ROM using the AeWU pousse Esci AD51E Addresses Addresses Set by ASWU Programming data 4F81 4FDO 4 81 to 4FDO Common area 60004 to 67 60001 to 67FF 80001 to 80001 to FFFFu 80001 to FFFFu 10000 to 17FFF Channel area 8000 to DFFFx 18000 to 1DFFF 80001 to DFFFu 200001 to 25FFF vam em Data may only be stored to the ROM if the AD51 is connected with the A1 E A2 E A3 E A1N A2N A3N or A3HCPU APP 11 IB NA 66189 A APPENDICES APPENDIX 6 Externa View 4 2 0 17 51 53 8 INDICATOR RESET BARE 1 PINOD LNOD 29402 INOO MEMORY PROTECT 4 r i 2 D N so OPTION 9205 8 WOH 4 2 0 17 106
5. Licet uisu le 2 3 2 2 System subroutines TP TARE A ROA RRR CAU RR RC CR RUGGED ARRA CERO RUE QUEE Pr Fe Cd 3 6 3 3 Software Configuration TP VITA nw bg E 3 9 3 4 Memory Map eessssscsossosscosctoseseescvoseosecocsecooseosccceecoonosove 3 10 3 4 1 configuration Besocsevocssoosceceecsooceoncecseseeseoseeeeeeceveeee eee T rere eee eee eee ee ee 3 10 3 4 2 Memory map with ROM loaded PPP m VENE E EORR IN UE DAS 3 11 3 4 3 Storing System data on ROM eR HMM Hee e oso0sscsocovseooccccceooe 3 13 om 4 1 4 11 x EA TTE STELE TETTETETT 4 1 Peer eee Te eee ee eee eee eee 4 2 4 5 tri KE bre E REI TREE 4 5 rrr rer rrr rrr rrr Terre rere eee ee ees 4 7 3 ek nerve 4 7 4 3 4 Setting system data transfer e e e nnne tenter 4 8 4 3 5 ROM installation 256 S62 E rrr rrr rrr rr rrrrrr rrr rrr rerr rrr rrr rrr rr rr eee eee 4 9 4 3 6 Loading the battery cece etme mene eee eer ene ee eres eee reeset 4 11 NA 66189 5 WIRING Qeeesobtesssesesseeesssosesosseeseeeesstoeetocveconpeoevvosveescesecerevecesossonstoseceecopooveeseeoooocove 5 1 5 3 5 1 Wiring Instructions 5 1 5 2 RS 232C Connection 5 1 5 3 RS 422 Connection 6 66 5 2 6 AD51 PROGRAMMING NOTES en errr rrr eer eee rere eee eee eee 6 1 6 12
6. 6 AD72 positioning module X axis positioning start data Error reset Y axis positioning start data Monitoring area X axis positioning data Y axis positioning data X axis parameter Y axis parameter X axis zeroing data Y axis zeroing data 7 AJ71C24 S3 0 to FF 1006 to special application area 11 6 661 APPENDICES MELSEC 4 APPENDIX 3 GPP HGP Display Control Codes Fus __ Demi Command tine teed Garage reum and ine fed CR LF codes 00 oa Eme anster trom externa doves code bisats wanster trom externa Dco coe xr inate escape sequence esc Back space Cursor back one spece ES eoe 080 ESC Y 59n Cursor addressing Set cursor position absolutely line specification code 20 to 9F LOCATE column specification code 204 to 9F sop ______ ao Display Control Code List APP 7 IB 66189 A APPENDICES APPENDIX 4 GPP HGP PHP Key Codes and Character Codes 1 GPP HGP PHP key codes 0 _____ 1 ojo 1 o 2 2 B R gt 1 BREAK 2 S c 4 j cm
7. e g printer computer _ general purpose terminal 7 ur pensat ge goru YRS 5 Tee AC300R4 ii RS 422 cable K7PRE ce KDBIPRo ds os Js Intelligent GPP Handy graphic 2 TO PPE 4 1 5 51 Swo GPPU 3 5 inch floppy disk General purpose CRT _ Fig 2 3 Peripheral Device Configuration The console select switch must be set to determine which programming terminal is to be used 1B 66189 A 2 SYSTEM CONFIGURATION 2 2 Applicable A Series Systems The ADS1 can be used with the following CPU modules Applicable mote A0J2CPU A1ECPU 4 A2NCPU A2CPU A2ECPU gt A3ECPU The AD51 loaded into any slot on the Dace unit with the following precautions 1 When using the AD51 with the or A58B extension bases _ those without power supplies select the power supply for MELSECNET data link System Applicable models 1 Pott A2NCPUP21 R21 i A3NCPUP2T R21 A3HCPUP21 R21 0 2 P23 R23 AT E CPUP21 R21 A2 E CPUP21 R21 AS EICPUPZU R21 local station only the main base unit in accordance with the CPU User s manua
8. M IB 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU in voa 4 Module number of special function module on MELSECNET remote station The module number of the special function module used on a MELSECNET remote station depends on the link parameters set to the MELSECNET master station ME 9 x 15 4 0 44 30 0 r2 _6 10 17 500 65 00 15 e ise zte se tes zo sar oso toe 2207286 000 0 addresses of XN Y Y remote 30 50 70 station to to to Special fonction Output Output module module module Remote 1 0 Power station 1 supply AJ72P25 module Y Y X Y Y Y VO addresses 400 420 430 450 470 set in link to to to to to parameters 41F 42F 44F 46F 48F Special function module number H44 7 32 IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC AA 7 5 2 BASIC program examples The following BASIC program examples use system subroutines SATR batch read and SATW batch write to access the special function module buffer memory The program examples use channel 1 For full information on the system subroutines see the GPC BASIC Handbook 1 Batch read from buffer memory SAT
9. Master station gt local station Transmission time period equivalent to LRDP instruction processing time 1 scan time of station used with AD51 X 2 Master station gt remote station Transmission time period equivalent to instruction processing time 1 scan time of MELSECNET master station X 2 Read 2 marked as 3 when communication is made to the corresponding station for the first time after power on or CPU reset Read 2 as 1 from the second communication on when the number of stations communicating is 64 or less Factor of transmission time delay Transmission time obtained from any of the above ex pressions should be doubled if the command executed requires two scans for transmission e g device R write Transmission time should be multiplied by the number of stations monitored 1 if the other link stations are monitored by the A6GPP For more information on data link see the Data Link System User s Manual Example Reading local station device memory with the AD51 loaded on the MELSECNET master station Conditions L lt LS M M 80ms 1 10ms Transmission time MX 4 041X4 M X 2 80 X 4 10 X 4 80 X 2 880 where MELSECNET master station scan time 1 MELSECNET master station link refresh time LS link scan time L MELSECNET local station scan time On some conditions a considerable delay will occur for data transm
10. SAEM1 M dn iu the device specified in monitor data Key O Indicates available Table 7 4 System Subroutines and Functions 2 Extension file registers The empty area of the memory cassette has been defined for use as extension file registers in groups of 8K points 16K bytes To use this area as extension file registers the SW UTLPC FN1 utility program must be stored to the micro computer program area of the memory cassette The utility program automatically defines the empty area in blocks of 8K points as extension file registers For full information on the utility program see the SW GHP UTLP FN1 Operating Manual 7 22 _ IB 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MIELSEC fA 3 Extension file register block numbers When the empty area is defined as extension file registers block numbers are automatically allocated in groups of 8K points in accordance with the used CPU memory cassette program capacity etc as shown below Block n Memory Memory cassette cassette empty area capacity eee __ 8K points X l 9 blocks max register Block 2 Block 28 Extension file register Block 11 Block 10 For more information see Section 4 8 2 in the SW _ GHP UTLP FN1 Operat ing Manual 7 23 JB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 4 Valid block numbers The fo
11. 1 Difference between PRINT and LPRINT commands PRINT Used when the printer is connected to the console channel channel 1 or 3 set with DIP switch 16 or the channel specified with ZODV LPRINT Used when the printer is connected to the channel specified in the printer setting 2 Sharing of a single printer between tasks When several tasks are sharing the use of a printer ensure that interlock flags are provided in the work area to prevent two or more tasks attempting to access the printer simultaneously 6 6 NA 6618 6 AD51 PROGRAMMING NOTES MELSEC AA 3 Note that with printers that use the CR code 0D to initiate printing KGPRE K7PRE etc writing a comma after the statement in the PRINT or LPRINT command stops the AD51 from sending the CR code Printing is therefore not initiated 4 Notes on the use of the KD51PR The KD51PR may be connected to either of the two AD51 RS 232C ports When using the KD51PR note the following a The KD51PR will print if data is sent from the AD51 while it is printing or during paper feed This may be avoided by using the program shown in Example 2 Example 1 shows a program which repeatedly prints the letters ABCDE and the resultant KD51PR print out sxExample 1 s s sssuasuesuekessFeskunsautuus e uEKse sees USC TES Use of KD51PR in 2K buffer OFF buffer full set mode BASIC program ____ data and
12. Value of Exponential to base e Gen rates 1 when value of mathematical expression is 0 4 and generates 0 when the value is not 0 Arith San vase Pe metic operator i i IB NA 66189 4 PRE START UP PRO emma operator COM oe Negation NOT Logical operator Logical product AND Logical sum OR Exclusive logical sum EXOR Table 3 2 BASIC Command List Where commands have several options indicates as etc only those shaded may be used the AD51 IB 66189 A 4 PRE START UP PRO MELSEC AA 3 2 2 System subroutines System subroutines are machine code programs used for special AD51 functions for example PC CPU transactions etc They already written in channel 0 of the AD51 at specified address locations System subroutine operation is initiated by using the CALL command in the BASIC program System subroutines on the AD51 are shown in Table 3 3 Initializing the system subroutine 1 The system subroutine is called from the GPC BASIC program using the CALL command 2 The format of the CALL statement is as follows A CALL variable 1 variable 2 variable 3 variable 4 Variable 1 Always 0 All system subroutines are located in channel 0 Variable 2 Head address of system subroutine in channel 0 see table 3 3 Variable 3 Variable for
13. 100 A Head address for system subroutine PUT data 110 0 FF n8 Defines PC station number as host 120 A 1 22 seen n Specifies block 2 130 B F002 n Sets indirect variable head address 140 R0100 n Sets head device to be read using acter string variable 150 FOOT nM Sets indirect variable head address 160 0 16 Sets the number of points to be read as 16 170 C 1 E000 Sets destination head address for data 180 2 60 Sets time check period to 60 600ms 190 Z CALL 0 58080 1 A Calls system subroutine SAER 200 IF Z 0 PRINT ERROR 2 GOTO 190 n Checks for errors in SAER execution 210 END POINT 1 When specifying the head device using a character string variable define the number of points to be read after setting the head device Reason The character string variable overwrites the bits at the end of the data with 0 This would delete the number of points data if this was written first The time check period in line 180 should be set in accordance with the number of scans required for processing given in Section 3 8 after taking into account any delays which may occur due to other devices accessing the PC CPU 16 SSS ee IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A 2 Batch write to extension file registers SAEW 3 Example
14. 7 15 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 3 Data write to any PC device data memory SADT Program example 1 Program to write on off data to the following random bit devices Switch on Y115 switch off M340 Switch off B24C switch on L875 100 A E000 n Head address for system subroutine IN PUT data WO FOR MEN TOS Sets character string variable head es address for destination device 140 E100 nn Sets indirect variable head address 150 0 0115 Sets device name 0115 160 5 1 Ge are Care Source data for Y115 170 A 1 M0340 veee Sets device name M0340 180 C 11 0 ae nale vel Curiis mis noui w Source data for M340 190 2 BO2Z4C nnnm Sets device 024 200 17 0 UCM ERR EAT RUNE EHE PPS TO OR VN Source data for B24C 210 A 3 L0875 Sets device name 10875 220 23 1 nes Source data for L875 230 BS E200 99999999999 Sets indirect variable head address 240 0 FRc Defines PC station number as host 250 1 ai CIEN IU ei RR RC Yi v V LU Specifies bit write 260 4 Specifies 4 pieces of data to be written 270 B 2 E100 Sets source data head address 280 70 errr Sets time check period to 70 700msec 290 2 8081 1 B Calls system subroutine SADT 300 IF Z 0 PRINT
15. Can multi task be started YES Has multi task been set NO Set and start multi task YES Multi task setting data NO is error free Correct multi task setting data and restart multi task YES Set memory protect of programming data to OFF and start multi task YES Take corrective action relevant to Error message display error message Refer to Section 9 1 NO Specific task is not executed YES NO Time required until completion Check if start condition has been set correctly in multi task setting Check if interlock etc has been pro vided for other tasks and flags Examine BASIC program Since access is made to PC by sever al tasks waiting time takes place 8 10 IB NA 66189 A 8 TROUBLESHOOTING 8 3 6 CRT troubleshooting CRT data is corrupted Is AD51 correctly connected to the cansole eem YES Has console been NO connected to channel specified with DIP switch SW16 YES Has console NO connection channel been Open console channel opened YES Specify console connection channel with ZODV NO Open AD51 s connection channel or Is communication mode re set console communication correct mode YES YES Is connected channel closed Open or stop closing channel NO NO The console should be started before Has console been started before AD51 the AD51 YES NO
16. ERROR 2 GOTO 290 nnn Checks for errors in SADT execution 310 END 4 16 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU Program example 2 Program to write numerical data to the following random word devices 0567 lt 0 W187 751 C49 0 R882 lt 1234 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 30 310 A 000 FOR 1 0 TO 3 1 E1OO IX7 NEXT C E100 m MM A 0 00567 A 5 0 MM 1 0882 9 e 12 1234 2 0187 n Q C4H19 29751 nnn A 3 CNO049 TEASE 26 0 Dia Me B 1 4 2 E100 died Z CALL 0 8081 1 IF 240 PRINT ERROR Z GOTO 290 m END 7 17 Sets indirect variable head address Character string variable head address for destination device Sets indirect variable head address Sets device name D0567 Sets source data for D567 Sets device name R0882 Sets source data for R882 Sets device name W0187 Sets source data for W187 Sets device name CNO049 Sets source data for CN49 Sets indirect variable head address Defines PC station number as host Specifies word write Specifies 4 pieces of data to be written Set
17. Without terminal resistor POINT Both switches should be either on or off 4 7 IB NA 66189 A 4 PRE START UP PROCEDURES MELSEC A 4 3 4 Setting system data transfer Set the DIP switch SW17 to ON or OFF as indicated below depending on whether or not the system data is transferred from the ROM of channel 1 to the system data area at power on System data is transferred from channel 1 addresses 80004 to 80FF4 to system data area addresses 4 00 to 4FFFu eod TS aes ae ae When the system data exists in channel 1 address range 8000 to 80FF data in 8000 to 8004 is in a specific pattern to indicate that the system data exists Specific pattern SW17 must be set to ON when the system data has been stored on ROM and set to OFF when not stored on ROM 4 8 IB NA 6618 _ 4 PRE START UP PROCEDURES MELSEC 4 3 5 ROM installation E This section describes the installation and settings required for using the ROM The ROM sockets should be empty if ROM is not being used ROM memory loading Do not touch the ROM connecting pins See Fig 4 1 Open ROM socket Place ROM in socket nothing the direction of the blip Push the ROM into the socket and lock Check that ROM is flush with socket Set the shorting pin as indicated below EM u Setting El iH FERRE E 2
18. 1 1 Notes on Character Sets In th s manual some of the characters used may differ from those which appear on the screen depending on the character set chosen i e Japanese English German Swedish The keyboard operations follow the standard for the character set chosen so for example to input with English characters press sFT Key codes are given in Appendix 4 paragraph 3 Key operations for the different character sets are shown below English German Swedish In this manual all examples use the Japanese character set IB NA 66189 2 SYSTEM CONFIGURATION 2 SYSTEM CONFIGURATION 2 1 Overall Configuration 1 Building block type PC POINT _ 1 See 2 when using AJ71C24 S3 on the 558 or 58 exten sion base unit 2 The extension base unit cannot t be con nected with the A32B main base unit without extension connector Fig 2 1 Building Block CPU Configuration 21 Building block Type type CPU module CPU module ROS Main base unit Extension cable Extension base unit NA 66189 A 2 SYSTEM CONFIGURATION 2 Compact type PC Type A0J2CPU CPU module AQJ2COAB A0J2C10B IB NA 66189 A 2 SYSTEM CONFIGURATION 3 Peripherals External device
19. 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A 7 8 2 BASIC program examples The following program examples transfer comments between the PC CPU and AD51 1 Comment read SACR Example Program to read PC CPU comments to the following AD51 memory area 192 comment points 4K bytes Channel 2 8000 to 8FFF 100 Z ZWR1 2 F800 FF Defines PC station number as host 110 Z ZWR2 2 F803 64 Sets the number of bytes to be read as 64 120 Z ZWR2 2 F807 60 Sets time check period to 60 600ms 130 A 8000 Sets indirect variable head address 140 FOR 1 0 TO 4095 STEP 64 150 ZzZWR2Q F801 Sets head address of comments to be read 160 Z ZWR2 2 F805 A ee Sets data destination head address 170 Z CALL 0 8002 2 800 Calls system subroutine SACR 180 IF Z 0 PRINT ERROR 2 GOTO 170 Checks for errors in SACR execution 190 64 nnnm Adds 64 to data destination head address 200 NEXT 210 END 7 44 IB 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A 2 Comment write SACW Example Program to write comments from the AD51 to the PC CPU 100 Z ZWR1 2 F900 FF s Defines PC station number as host 110 Z ZWR2 2 F903 64 eenen Sets the number of bytes to be writ ten as 64 120 Z ZWR2 2 F907 60 ss Sets time check period to 60 600ms 130 A 8000 Sets indirect variable
20. 1 Table 3 4 Memory Map When ROM is Used 3 11 IB NA 66189 A 4 PRE START UP PRO POINT 1 The installation of a ROM shifts the corresponding RAM address range to a different channel e g _ Installing 8K of ROM at channel 1 addresses 8000 to BFFF moves the RAM area to channel 3 addresses 8000 to BFFF 2 Two shorting pins are used to specify RAM or ROM in channels 1 and 2 The RAM area is moved as follows depending on the pin setting in each channel RAM and ROM areas The RAM area changes ROM position channels as though ROM was instatted 3 Only 24K bytes are valid addresses 8000 to DFFF when T6KROM is used The 8K bytes from E000 to FFFF are used in the RAM area and the program in this ROM address range cannot be executed 4 For RAM area memory protect refer to Section 4 3 1 a 34312 1B NA 661 4 PRE START UP PRO MEL SECA 3 4 3 Storing system data on ROM System data e g multitask set data required for program execution of each task may be stored to ROM The system data located in the common area is stored to the first 256 byte area of the ROM instailed on channel 1 Common area 0000 to 4F00 to 4FFF System data area 7FFF Channel 0 Channel 1 8000 to 80 me 81001 System data ROM area RAM area FFFFu FFFFu 1 After the system data is stored on ROM addresses 8100 to FFFF are used as a user mem
21. 4 17 120 4 72 75 5 2 97 Unit mm inch 12 NA 661 IMPORTANT The components on the printed circuit boards will be damaged by static electricity so avoid handling them directly If it 15 necessary to handle them take the following precautions 1 Ground human body and work bench 2 Do not touch the conductive areas of the printed circuit board and its electrical parts with any non grounded tools etc Under no circumstances will Mitsubishi Electric be liable or responsible for any consequential damage that may arise as a result of the installation or use of this equipment All examples and diagrams shown in this manual are intended only as an aid to understanding the text not to guarantee operation Mitsubishi Electric will accept no responsibility for actual use of the product based on these illustrative examples Owing to the very variety in possible applications of this equipment you must yourself as to its suitability for your specific application 66189 A E MITSUBISHI ELECTRIC CORPORATION __ HEAD OFFICE MITSUBISHI DENKI BLDG MARUNOUCHI TOKYO 100 TELEX J24532 CABLE MELCO TOKYO NAGOYA WORKS 1 14 YADA MINAMI 5 HIGASHI KU NAGOYA JAPAN These products or technologies are subject to Japanese and or COCOM strategic restrictions and diversion contrary thereto is prohibited IB NA 66189 A 8901 MEE Printe
22. 6 1 BASIC Program Address Data Besepsoreouveeveekeesesreeseceeeresossoseeveceeoeveeeeeesovesionsneeveseeeceecevee 6 1 6 2 Start Conditions w eeseseseteosessssestubeeesesoseeopoereveseeevoreeesooseseveeeueeeecenvvsveveeseeseeceeeososocesee 6 4 6 2 1 Program runs once after power 6 4 6 2 2 Program runs continuously after power on 6 4 6 2 3 Program runs after an interrupt signal from the PC CPU n 088 6 5 6 2 4 Program runs at preset intervals in real time nn 6 5 6 3 Notes on the Use of BASIC Commands mn 6 6 6 3 1 Key input commands e e 6 6 6 3 2 Printing commands wetvasossseseeeoevoeveecvossseveesoseceveepreseeseeecerseeveeeceveseceeonoseveciceveeoo 6 6 6 3 3 CRT display commands bresseeossosepesossosvesceonosontavensneeeecessceceeteeceeteossensosonseccoooesen 6 8 6 3 4 OPEN and CLOSE commands M 6 9 6 3 5 Z commands Bheseseossesvsveeeeoevevescespeeeoosescvoseeeceeveeeeoscotcesoveveseceooeseetoeseesoseeceveeecsono 6 9 6 4 Transmission Commands to External Device t nnn 6 10 6 4 1 PRINT command n n mmn 6 10 6 4 2 LPRINT command whet osssesseseessosospeeoetorveveeesseveseeeosoveeeeneseteoeesevecesoovevecteveese 6 11 6 4 3 System subroutine SWB sesesesessosesenosassonenusecoesseeosesosoecessossonsesoosoosoesoeoosoecooo 6 11 6 5 AD51 and PC CPU Reset whsespesoeestooevseveeteseveseseseseereeeeseseonosssoeoseeoooeeseeseeseseesevecesesee 6 12 6 6 Notes on BASIC Programming Beesesesesesvssesoseveveseevecrbsoc
23. Additional program head address AOCB 4 Work area head address FFOO 5 Channel 2 BASIC text area Area secured as BASIC text area IB 66189 A 6 AD51 PROGRAMMING NOTES MELSEC 3 The work area must come after the text area and the work area head address must have 00 in the two least significant digits 256 bytes are used for the BASIC interpreter work area starting at the work area head address 4 When two more tasks written in the same channel make sure that the program areas and BASIC interpreter work areas do not overlap each other a Program data will be corrupted in overlapping memory areas b Multitasking results will be invalid if the BASIC interpreter work area for a given task is overlapped by program data from a different task Independent running of that task however is valid BASIC Program Addresses TASK 1 TASK 2 Memory Map 8000 Task BASIC text area task 1 Program head address BO00 Correct Program last address BASIC text area task 2 example Additional program head address DFFF F000 Work area head address F800 BASIC interpreter work area task 1 BASIC interpreter work area task 2 Channel Task BASIC text area task 1 Over Program head address Overlapping area lapping Program last address BASIC text area task 2 program Additional program head address BASIC interpreter area Work area head ad
24. FOOT e nennnnnn Sets indirect variable head address 200 E 0 22 nnnm Sets the number of points to be entered as 2 210 1 nnn Sets destination head address for data 220 2 60 nnne Sets time check period to 60 600ms 230 Z CALL 0 80 6 1 0 Calls system subroutine SAEMO 240 IF Z 0 PRINT ERROR 2 GOTO 230 Checks for errors in SAEMO execution 250 END 5 Monitoring of file registers SAEM1 specified by the monitor data entry SAEMO Example Program to specify and monitor the file registers entered by using the program in 4 100 A FEOO to d ith 230 Z CALLI0 8066 1 D _ Monitor data entry in accordance wit 240 IF Z 0 PRINT ERROR 4 Z GOTO 230 250 F FOOT etree Sets indirect variable head address 260 0 FRc Defines PC station number as host 270 G FOOB Sets indirect variable head address 280 G 0 F100 Sets destination head address for data 290 1 Sets time check period to 60 600ms 300 Z CALL O 8009 1 Calls system subroutine SAEM1 310 IF Z 0 PRINT ERROR Z 300 8 Checks for errors in SAEM1 execution 320 END 7 28 IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 7 5 Special Function Module Buffer Memory Read Write Any special function module buffer memory is accessed by the AD51 as explained below 7 5 1 System subroutines and functions Th
25. Program to write data from addresses E000 EO1F to file registers R200 R215 in block 5 16 points 100 110 120 130 140 150 160 170 180 190 200 210 A nnnm Head address for system subroutine PUT data 0 ol Defines PC station number as host A 1 5 YU Vo ex le SIR LER Ace V ode eSBs Toe OS Specifies block 5 B F002 cheers Sets indirect variable head address R0200 C F007 C 0 21 6 T IF Z 0 PRINT ERROR Z GOTO 190 END Sets destination head device using char acter string variable Sets indirect variable head address Sets the number of points to be written as 16 Sets source head address for data Sets time check period to 60 600ms Calis system subroutine SAEW Checks for errors in SAEW execution Data write to any specified extension file registers SAET Example Program to write 246 to file register R100 in block 5 and 1234 to R8191 in block 7 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 A Sets indirect variable head address A 0 5 EER AEE REE Specifies block 5 A 8 7 Specifies block 7 B FEQ Sets indirect variable head address R0100 MH Sets file register R100 CS 9 Sets indirect variable head address C R8191 6 Sets file register R8191 Sets indirect variable head address D 0 24
26. The buffer memory is accessed by the AD51 using system subroutines SR2 SW2 For details refer to Section 7 2 1 4 The buffer memory is accessed by the PC CPU using the and application instructions For read and write procedures refer to Section 7 2 2 For details of the FROM instructions refer to the ACPU Programming Manual Address Buffer memory area 0000n 0014 002 BFDu BFFu 2 bytes 3 19 66189 A 4 PRE START UP PRO 3 8 Communication between AD51 and PC CPU Any AD51 initiated requests for communication transactions between the AD51 and PC CPU are processed once when the or instruction is executed by the PC The time taken to process a system subroutine and the delay times caused by multiple accessing of the PC CPU are explained in this section 1 The following table shows the number of scans taken by the AD51 to process PC transaction subroutines System Number of Scans Subroutine Required for Processing Batch read Batch write SADW 1 scan 2 scans for device R Test Device random write Bit memo Y Independent of scan Monitor data entry 1 scan for device R only Independent of scan for other devices Bit Monitor SADM1 Word Main Read SAAR 1 scan Sequence Sub program Main Write SAAW 2 scans 1 scan for T C set Analysis request SAPS 2
27. nnn Data destination head address 240 D 1 0 Data destination head address 250 0 2 50 Sets time check period to 50 500msec 260 Z CALL 0 8087 1 Calls system subroutine SADM1 270 IF Z 0 PRINT ERROR 2 GOTO260 nnn Checks for errors in SADM1 execution 280 END 7 20 IB NA 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU Program example 2 Program to specify and monitor the following bit devices and bit devices entered as 16 consecutive device numbers X60 to X6F T80 to T95 contacts C183 present value D260 W175 R700 100 A F000 Sets indirect variable head address 110 A X0060TSO80CN183D0260W0175R0700 e bae a eem V vo v vere Vo a Stores device numbers into work area 120 BS nnn Sets indirect variable head address 130 0 FF AM Defines PC station number as host 140 B 1 9 W HMM Specifies word entry 150 C E802 Sets indirect variable head address 160 0 6 Sets the number of points to be entered to 6 170 1 n M Sets entry data head address 180 C 2 2550 nn Sets time check period to 50 500msec 190 Z CALL O 8084 1 Cails system subroutine SADMO 200 IF Z 0 PRINT ERROR Z GOTO 190 n Checks for errors in SADMO execution 210 D E900 nA Sets indirect variable head address 220 0 0 Defines PC station number
28. setting screen The LPRINT and LLIST commands cannot be used if NOTHING has been selected for the printer type 2 Data transmitted in accordance with the LPRINT command designation is as indicated in Section 6 4 1 3 Data transmitted by the LPRINT command is as indicated in Section 6 4 1 4 The LPRINT command is not controlled on a task basis 6 4 3 System subroutine SWB 1 Transmits data of the specified length from the specified channel 2 The transmission time can be set in increments of 10ms A time out occurs if transmission is not completed data is not stored to the transmission buffer within the transmission period The error status and untransmitted data byte length can be read 3 Transmission data is stored to the AD51 s common area 6000 to 67FF Data in 00 to FF is regarded as an ASCII code and sent unchanged 6 11 IB NA 66189 A 6 AD51 PROGRAMMING NOTES MELSEC 6 5 AD51 and PC CPU Reset The following explains the effects of resetting the AD51 and the PC CPU AD51 reset operation 1 The AD51 processes its programs as though the power has been switched on With multi task start already set Executes multi task Without multi task Displays the mode select menu on the con sole 2 All the AD51 general purpose inputs are switched off 3 During reset there is no accessing of the PC CPU 4 There is no signal by which the PC CPU
29. system data area and user Switches for console chan z 5i memory area IC RAM nel selection memory pro i tect area and multidrop ter E i minal resistance gt CESAREA ru For details refer to Section CH1 RS 422 connector P 4 3 Connects I O console GPP CH3 RS 232C connector Connects console VT220 CH2 RS 422 terminal block Terminal block for multidrop system general purpose RS 422 gow ll RS 232C connector General purpose RS 232C port REMARKS It is necessary to set load before starting operation IB NA 66189 4 PRE START UP PROCEDURES 1 Switch details RUN LED During multi tasking 051 is not multi tasking Will remain off when a single task is RUN Set to RUN to enable multi tasking to be started from the input console Setto RUN to enable a single task to be started by typing RUN during BASIC programming debug ging etc Set to STOP to stop program execution Used to reset an error or to initialize multi tasking Displays a 2 digit error code as appropriate INDICATOR RESET F INDICATOR RESET switch Resets the error code display after the error has been removed The error code will remain if the error has not been cleared When several errors have occurred pressing the reset switch will display consecutive er
30. BET Storage on disk Storage on ROM GPP HGP PHP GPP disallowed GPP HGP PHP GPP HGP PHP for HGP PHP rinter GPP HGP PHP GPP HGP PHP Disallowed Disallowed General urpose I O Disallowed Disallowed console Printer General purpose GPP disallowed console GPP HGP PHP for HGP PHP GPP HGP PHP 1 1 1B NA 66189 A 1 INTRODUCTION 2 MELSEC A Can be used as a sub CPU of the PC CPU The AD51 reads data e g complicated numerical operation function operation from the PC and calculates and stores it as required so that the PC CPU is relieved from processing burden 1 Storage of set value positioning data etc 2 Collection analysis and compensation of measurement data 3 Function operation of sine log square root etc 4 Logging and storage of production data 5 Logging and analysis of inspection data Operation processing BASIC program 3 Can be used as a monitoring module Connected with an I O console GPP HGP PHP or general purpose I O console personal computer and printer the AD51 allows the operating status to be monitored and control data to be printed out 1 Monitor display Indicates the production status oper ating conditions fault definition etc Inputs the production schedule pro duction quantity operating procedure and data setting Prints out the production program production results daily report fault definition pr
31. Intelligent GPP A6GPPE SET Note EE English version EG Germany version Consists of the following Equipped with FDD and printer interface functions Note EE English version EG Germany version UL a System software package for the A6GPP or A6HGP System disk SW 1 7 back up copy provided SW0 GPPU User disk already formatted for storing programs Composite video cable AC10MD Optional cable for GPP external monitor 1m 3 28ft length Genoral purpose VT 220 Display control codes equivalent to VT 220 For program hard copy and data print out KD51PR For printing data Cable between AD51 and A6GPP RS 422 cable AC300R4 3m 9 84ft length z Connection cable between AD51 and printer and for VT 220 RS 232C cable AC30R2 3m 9 84ft length Table 2 1 System Equipment List Continue Handy graphic programmer A6HGPE SET Printer a ES 2 5 M OUIOQe NA 66189 A 2 SYSTEM CONFIGURATION K amp PR R Ink ribbon for K6PRE K7PR R Ink ribbon for K7PRE KD51PR R Ink ribbon for KD51PR KePR Y Printer paper for K6PR Printer paper KD51PR Y Printer paper for KD51PR 232 CON Connector for RS 422 and RS 232C interfaces Table 2 1 System Equipment List Ink ribbon 2 6 IB NA 661 4 PRE START UP PRO 3 SPECIFICATIONS 3 1 Performan
32. Parity bit setting paniy recent Ah m Stop bit setting i Stob USART mode setting Character data Data 7 bits bit setting Data 8 bits Communication XON XOFF control control setting Control with DTR terminal Set CH3 with the front DIP switches SW1 8 Connector pin outs 1821 fA e 1 2202 2P2P 22 2 2 0 1 21 Pi 1724 p 1 FuP WE 3 3 om ee s om eem ow meme 5 senem m m owe 1 1 The maximum transmission speed from the AD51 is 9600 BPS the maximum receiving speed is 4800 BPS 2 When channel 3 has been set as I O console DIP switch 16 set to OFF the AD51 operating system automatically sets the USART mode 4800 BPS parity absent stop bit 1 character data bit 8 3 109 M IB 6618 4 PRE START UP PRO MEL SEC AL 3 6 Interface with Programmable Controller CPU The digital O bus may be used for communication between the PC CPU and the AD51 The following table indicates the function of each signal The drive number will vary depending on the AD51 slot location in the table the AD51 is assumed to be in slots 0 and 1 of the main base unit 1 There are 48 input signals to the PC CPU X00 to X2F from the AD51 Input Number Pu Unused XOF Address 69404 Address 69204 Switched on off by the BAS
33. Procedure IB 66189 A 9 MAINTENANCE MELSEC A The battery is common to all the MELSEC A series Battery storage life is 5 years Total memory back up guarantee period is 130 days Battery used is as follows Description Lithium battery Type and rating Type 3 6V with plug and leads Handling instructions 1 Do 2 3 Do 4 Do 5 Do 6 Do not short not disassemble not burn not heat not solder electrodes not measure voltage with an analog voltmeter 9 3 66186 APPENDICES MELSEC 4 APPENDICES APPENDIX 1 Differences between AD51 S3 and AD51 The AD51 S3 differs from the AD51 in the following points 1 The AD51 S3 allows communication with the other stations in MELSECNET The other stations can be accessed by specifying the MELSEC NET PC No atthe set data head address of the system subroutine which used to access the PC CPU 2 In addition to the AD51 system subroutines the AD51 S3 has the following system subroutines Subroutine 3 Reads data trom extension fis registers of PC CPU 4 SAEW Writes to extension registers of CPU SAEM1 Monitors PC CPU extension file registers specified in monitor data entry Fo sacr comments tom Pc CPU ta Reads dia from specia funcion module SATW Writes data to special function module buffer memory
34. Write the BASIC program using the GOTO command to continue program execution and set the task start condition to POWER Task runs continuously after j Set multi task start condition to power on POWER ON BASIC program GOTO XXX Execution returns to line XXX IB NA 661 6 AD51 PROGRAMMING NOTES 6 2 3 Program runs after an interrupt signal from the PC CPU Set the task start condition to CPU INT CPU interrupt The program is then run when the rising edge of the AD51 interrupt signal is received from the PC CPU For programming information see Section 7 4 1 Write the BASIC program so that END is executed as the final instruction When END is executed the AD51 interrupt condition is reset The interrupt program will not run again until the rising edge of the 0651 interrupt signal is received from the PC CPU Task runs after interrupt j Set multi task start condition to signal from PC CPU PC CPU interrupt BASIC program PC CPU interrupt reset 2 Only one task may be defined as PC interrupt start More than one will generally lead to ORST error 6 2 4 Program runs at preset intervals in real time Select starting condition REAL TIME INT real time interrupt The real time interrupt interval i e the time between interrupt signals should be tonger than the total time taken for the interrupt program to reach the END instruction including t
35. address 190 D 0 292 Sets the number of bytes to be written as 2 200 D 1 nnn Sets source head address for data 210 D 2 960 nn eeer tree eee Sets time check period to 60 600ms 220 Z CALL 0 80DB 1 Calls system subroutine SATW 230 IF Z 0 PRINT ERROR Z GOTO 220 nnm eee Checks for errors in SATW execution 240 END 7 33 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC_ AA 7 6 Read Write of Sequence Program and T C Set Values This section describes procedures for reading and writing PC CPU sequence programs T C set values from the AD51 7 6 1 System subroutines and functions The following system subroutines are used to read and write sequence programs and T C set values 1 System subroutines and functions of ES des State Processing subroutine transaction Reads main sequence program Read cE Reads subsequence program 64 steps Writes main sequence program Write x Writes subsequence program 128 bytes Analysis Causes PC CPU to recognize and check request rewritten parameters Key Available X Unavailable For T C only Sequence program Table 7 2 System Subroutines and Functions Asubprogram may be written while a main program is running and vice versa using appropriate control of M9050 and M9051 The A3N and A3HCPUs are not provided with M9050
36. correction of a protected program switch the memory protect off 8 2 IB NA 66189 A 8 TROUBLESHOOTING 8 2 Error Code List EN Multi task setting error BASIC program error STOP error BASIC The occurance of any error during AD51 operation will cause the appropriate error code to be displayed on the two digit annun ciator Code definitions are as follows Battery is not loaded Load battery Battery voltage E Change battery Although multi task setting is wrong multi task has been executed Grammatical in BASIC program error STOP command has been executed during multi task execution BREAK error BASIC Text end error BREAK command has been executed during multi task execution BASIC program does not end with END GOTO GOSUB ONGOTO ONGOSUB or RETURN command Re set multi task Correct program Remote STOP command or change to END GOTO GOSUB ONGOTO ONGOSUB or RETURN command Task 5 Task 1 Task 2 Task 3 Task 4 Remove BREAK command Task 5 Task 6 Task 7 Task 8 Correct program 66189 8 TROUBLESHOOTING MELSEC eee eee A task has been re started before it ORST error has completed In BASIC a maximum of ten levels of GOSUB or FOR NEXT instructions are allowe
37. errors in SAPS execution Defines the PC station number as host Sets main sequence program Sets the number of steps to be written to 64 Sets time check period to 70 700msec Sets data source head address to variable A Sets head step number of sequence program to be written Sets data source head address Writes sequence program Checks for errors in SAAW execution Adds 128 to sequence program write head address NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 3 T C set values read Program example Program for reading set values of TO to T31 and C64 to C79 to memory addresses B000 to and BO40 to BOSF in channel 2 100 Z ZWR1 2 E700 FF Defines PC station number as host 110 Z ZWR1 2 E701 40 eeen Sets main sequence program 120 Z ZWR2 2 E702 Sets read head step to TO 130 Z ZWR2 2 E704 32 see Sets the number of points to be read to 32 140 Z ZWR2 2 E706 8000 Sets data destination head address 150 Z ZWR2 2 E708 50 Sets time check period to 50 500msec 160 Z CALL 0 808A 2 700 Reads TO to T31 set values 170 Z ZWR2 2 E702 40 Sets read head step to C64 180 Z ZWR2 2 E704 16 Sets the number of points to be read to 16 190 Z ZWR2 2 E706 8040 Sets data destination head address 200 Z CALL 0 808A 2 E700 Reads C64 to
38. execution result of the system subroutine is invalid b Block 9 may be accessed from the AD51 but cannot be accessed by the sequence program c The AD51 is allowed to access all valid register blocks but the sequence program is only allowed to access the number of file register points set in the parameters 7 24 18 66185 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC Al 5 Relation between file registers and block numbers To access the file register in any block specify the required block number and file register device number then execute the required system subroutine Block 0 Block 1 Block 2 we _ R2 Rm D setting Ro in block 0 100 Re in block 1 300 Ro in block 2 400 6 Relation between device numbers and set values Device Number Set Value 7 25 18 NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 4 2 BASIC program examples Some BASIC program examples are given below which use system subroutines SAER batch read SAEW batch write SAET test SAEMO monitor data entry and SAEM1 monitor The program examples use channel 1 Full information on the system subroutines is given in the GPC BASIC Handbook 1 Batch read from extension file registers SAER Example Program to read data from 16 points file registers R100 to R115 in block 2 to addresses E000 to EOTF
39. or ROM RAM or ROM C000n AM area d E 32K bytes n boar n boa E0004 On board On board RAM RAM Lo FFFF amp User memory area Max 112K bytes 3 ne i memory 16 bit Memory channel 0 Fig 3 2 Memory Map POINT 1 The RAM user work area addresses 6000 to 67FF is in the common area and can be accessed by the user programs in any of channels 1 to 4 2 The memory area may be expanded by adding ROM to channels 1 and or 2 3 The buffer address range is 000 to BFF which represents 3K words 6K bytes of buffer memory Each buffer memory address represents 1 word i e 16 bits 8 NA 66189 3 SPECIFICATIONS 3 4 2 Memory map with ROM loaded The user memory area can be expanded by ROM into channels 1 and or 2 Thi memory map will vary as shown below depending on the location and size of the ROMs 8K and 16KROMs may be used RAM 66K byes 6K RAM 66K bytes ROM 0K byte PEE EEA E LA as ROM 24K bytes MER Total 90K bytes 000 000 E000H Channel 1 RAM 66K bytes ROM 40K bytes Total 106K bytes jd Channel 1 Ua Cove RAM 66K bytes RAM 66K bytes RAM 66K bytes ROM 24K bytes ROM 40K bytes ROM 48K bytes Total 90K bytes Total 106K bytes Total 114K bytes 8000H 000 000 000 FFFFH Channel
40. scans Remote run Parameter PC Remote stop PC type mode Batch read Buffer Independent of scan Batch write Batch read Extenslah Batch write 2 scans file Random write register Monitor data entry Monitor Micro computer SAMW 2 scans Bathread SACR Bathread SACR SACR Comment Batch write Batch read SS Batch write 6518 4 PRE START UP PRO MELSECAA System subroutines SR2 and SW2 buffer memory read write allow words 6K bytes to be transferred between the PC CPU and AD51 at one time independently of the or instruction execution in the sequence program 2 Requests for communication transactions with the PC CPU may also come from other sources these are listed below and are processed in the same way as AD51 transaction requests Only one transaction may be processed per PC CPU scan so that a delay of 1 to 5 scans is possible before the AD51 transaction is processed if several of these requests overlap The following list gives the transaction requests in priority order Programmable controller CPU OS program 2 Peripheral equipment e g A6GPP 3 Optical or coaxial data link unit incorporated in CPU module 4 Optical or coaxial data link module in 3 hierarchy system AJ71P22 R22 Processing request from AJ71C24 S3 or second AD51 Hence if continuous processing requests are re
41. switched between RUN and STOP by the AD51 using the following system subroutines Remote RUN Requests remote RUN of PC CPU PC CPU Remote STOP s Requests remote STOP of PC CPU 1 Precautions for remote RUN STOP 1 Note that a remote error is flagged if a remote RUN or STOP signal is given to a PC CPU which has already received a remote STOP or RUN signal from a separate unit e g AJ71C24 S3 2 Remote RUN STOP commands from the AD51 are valid as follows for different CPU key switch positions PC CPU Key Switch Position RUN stop PAUSE STEP RUN Command Remote RUN STOP PAUSE STEP RUN from ADS1 Remote STOP STOP STOP STOP STOP 3 The clearing of data memories on receiving a remote run instruction depends on the states of special relays M9016 and M9017 Special Relay Data Memory State CPU is run without clearing data memory OFF ON Data memory is cleared outside the latch range set in parameters Link image is not cleared ON OFF CPU is run after data memory is cleared Always reset special relays M9016 and M9017 where data memory clearing is not required 4 Resetting the PC CPU during remote RUN STOP control either with the keyswitch or by powering down and up causes the remote signal to be removed and the PC CPU to revert to the mode detected by its key switch 7 48 IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE C
42. system subroutine stored in 0 registers Variable 4 Variable for system subroutine stored in B C registers 3 For information on variable 3 and variable 4 refer to the GPC BASIC Handbooks 4 Before executing the CALL command transfer variables to the work area ___ reme tema Mti sw s an aso moaca o 8 sw ansa eme _____ _ se ase meme sm mmn sos SBF Integer real number SC o m a E mio T T Real number integer SFLTD 32 bit integer 32 bit floating point number 80DEx ho SFIXD 32 bit floating point number 32 bit integer 0 SBD4 BIN 4 digit BCD o 12 SDB4 4 digit BCD BIN 0 SBD6 BIN 6 digit BCD 0 SDB6 6 digit BCD BIN ms 8048 Table 3 3 System Subroutine List Continue 3 6 NA 6618 4 PRE START UP PRO Function BIN addition 24 bits BIN division 24 bits Write to clock element year month day hour minute second Read from clock element year month day hour minute second Discrimination of programmable controller CPU Programmable controller CPU run stop check Remote run of programmable controller CPU Remote stop of programmable controller CPU Receives specified byte length of data sent to specified channel Sends specified byte length of data from
43. 0 END 21 8 NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A an 7 2 Read Write of Buffer Memory The buffer memory can be accessed by both the BASIC program and the sequence program A maximum of 3K words can be transferred with one instruction 7 2 1 Read write with BASIC program The following system subroutines are used to access the buffer memory For details refer to the GPC BASIC Supplementary Handbook Read from buffer memory sm Write to buffer memory Read write retry time The buffer memory cannot be accessed by the AD51 if the PC CPU is already executing a or instruction In this case the AD51 will retry communication according to its retry time setting The retry time is set at 10ms unless changed using the SC2 system subroutine Program example 1 Program to read 256 words from buffer memory head address 200 to AD51 memory head address FO000 100 AS eestor ees Indirect variable head address 110 0 200 Data source buffer memory head address 120 1 F000 Data destination head address 130 A 2 100 Number of words 140 B CALL 0 8000 1 System subroutine 512 reads buffer memory 150 IF B 0 PRINT ERROR GOTO 140 6 Checks for errors in SR2 execution 160 END 2 Program to write data from work area addresses E700 to E77F in the
44. 1 Sequence programs should be read and written in the range set in the parameters PC CPU data may be corrupted if programs are written outside the set range 2 An input data error is returned if the specified para meter read write capacity is outside the allowed range 16 bytes in the AOJ2CPU 3K bytes in the A1 E A2 E A3 E A1N A2N A3N and A3HCPUs 7 34 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC_AA 278 2 T C set values and program addresses Specify T C set values and program step numbers as shown in the following table TO set value T set value to T255 set value CO set value C1 set value to C255 set value Step 0 Step 1 to Step 30719 30K Calculation of specified address Timer Tm FE00 n Counter Cm FF00 n where m device number n hexadecimal value of device number 3 T C set value Read write data of T C set values is expressed in hexadecimal as shown in the following table Specification with Specification with KO 0000s Do K1 00011 D1 to 00024 K32766 K32767 Calculation of set value Km 000 n Dm 8000 2n where m device number n hexadecima value of device number 7 35 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 6 2 Read and write procedures a Parameter data should not be separated from the sequence program when it is read or written by the AD5
45. 1 Use the following procedures 1 Sequence program read Read sequence program from PC CPU The program must be read in blocks of 64 steps Read corresponding parameters Refer to POINT 2 Write of sequence programs Set PC CPU to stop MILD Refer to Write parameters for required program to P 7 Write a parameter analysis request to PC CPU to confirm new parameters Write sequence program to PC CPU O O The program must be written blocks of 64 steps When reading or writing sequence programs always ensure that the parameters match the program Mis matches of parameters and programs will result in misop eration 7 36 rr M M IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A 7 6 3 BASIC program example This section gives the procedure for transferring sequence prog rams and T C set values between the PC CPU and the AD51 1 Sequence program read SAAR SAPR Program example Program to read the PC CPU main program to the following AD51 memory areas Sequence program 2K steps Channel 2 2000 to EFFF Parameter 3K bytes Channel 2 D000 to DBFF 100 Z ZWR1 2 F800 FF Defines PC station number as host 110 Z ZWR1 2 F801 4D 99999 Sets main sequence program 120 Z ZWR2 2 F804 64 eee Sets the number of steps to be read to 64 130 Z ZWR2 2 F808 60
46. 150 FOR 0 4095 STEP 64 160 Z ZWR2 2 F802 en Sets head address of microcomputer program to be read 170 Z ZWR2 2 F806 A ceeeeees Sets data destination head address 180 Z CALL 0 80CC 2 F800 Calls system subroutine SAMR 190 IF 220 PRINT ERROR 2 GOTO 180 nnm Checks for errors in SAMR execution 200 64 9 Adds 64 to data destination head address 210 NEXT 220 END 7 41 IB NA 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 2 Microcomputer program write SAMW Example Program to write the main microcomputer program from the AD51 to the PC CPU 8 Channel 2 E000 to EFFF Microcomputer program 4K bytes 100 Z CALL 0 8030 FF 70 Checks PC CPU RUN STOP status 130 1 Z 1 LOCATE 5 10 PRINT CPU RUN GOTO 100 7 Indicates whether the CPU is running 120 IF Z 0 GOTO To error processing ILE Detects any error in SKC execution and moves to a suitable part of the program 7 130 Z ZWR1 2 2000 FF Defines PC station number as host 140 Z ZWR1 2 F001 40 Sets main microcomputer program 150 Z ZWR2 2 F004 64 Sets the number of bytes to be writ ten as 64 160 Z ZWR2 2 F008 60 ee eee Sets time check period to 60 600ms 170 A nn Sets indirect variable head address 180 FOR 1 0 4095 STEP 64 190 Z ZWR2 2 2002 I 5 Sets hea
47. 25 2 o 9 Fig 4 2 Pin Settings Depending on Memories IB NA 66189 A 4 PRE START UP PROCEDURES IMPORTANT 1 Before ROM is installed the shorting pin must be set in accordance with the ROM type used 2 After ROM has been installed setting the shorting pin to RAM may clear the battery backed data 3 ROM installation ROM should be installed after setting the shorting pin in accordance with the ROM type used 4 ROM removal After ROM has been remaved the shorting pin should be set to RAM RAM is built into the unit there is no need to load RAM into either socket The correct direction of the blip on the ROM is indicated on the ROM socket ROM may be loaded into either socket and ROM sizes 27128 27256 may be mixed providing the address ranges are noted When ROM is installed some RAM address ranges change For details refer to Section 3 4 Cover the EPROM window after it has been prog rammed Ensure that ROMs are correctly stored and protected Keep the ROM away from static electricity use anti static foam where possible The shorting pin is factory set to RAM RAM A and RAM B connectors Channel 1 shorting pins are marked RAM A and channel 2 4 10 IB 6618 4 PRE START UP PROCEDURES MELSECAA 4 3 6 Loading the battery The battery is disconnected before leaving the factory to prevent unn
48. 6 eer eee e reece ree ee eee er ere es Sets data written to R100 0 4 1234 n H6 Sets data written to R8191 ES 00 Sets indirect variable head address 0 FF Defines PC station number as host F F001 MM Sets indirect variable head address F 0 22 HMM Sets the number of points to be written as 2 F 1 FEO nn ee Sets destination head address for data 2 60 enm MH Sets time check period to 60 600ms Z CALL 0 80C3 1 E IF 220 PRINT ERROR Z GOTO 260 7 27 Calls system subroutine SAET Checks for errors in SAET execution IB NA 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 4 Defining file registers to be monitored SAEMO Before a given file register can be monitored using the SAEM1 subroutine it must be specified and entered using the following procedure Example Program to specify file register R50 in block 1 and R100 in block 7 100 A FEO0 nnn Sets indirect variable head address 110 A 0 1 digi Dials WSO S nee mn ewe Specifies block 1 120 B FEQ ssc Sets indirect variable head address 130 B RO0050 Sets file register R50 140 A 6 97 e n Specifies block 7 150 C FE07 nnn Sets indirect variable head address 160 C R0100 nnnm Sets file register R100 170 DS nn Sets indirect variable head address 180 D 0 Defines PC station number as host 190 ES
49. 96 nn Sets the number of points to be entered to 6 170 1 re Te eee TERT ER IOC CV Sets entry data head address 180 C 2 29550 n Sets time check period to 50 500msec 190 Z CALL 0 8084 1 Calls system subroutine SADMO 200 IF Z 0 PRINT ERROR 2 GOTO 190 886 Checks for errors in SADMO execution 210 END Program example 2 Program to specify the following word devices for monitoring or bit devices entered as 16 consecutive device numbers X60 to X6F T80 to T95 contacts C183 present value D260 W175 R700 100 A F000 M8 Sets indirect variable head address 110 A X0060TS080CN183D0260W0175R0700 POCO CON ERE TERE OTC Stores device numbers into work area 120 B Sets indirect variable head address 130 BiO FF Defines PC station number as host 140 B 1 W VEU Eds eld ate wa ws Specifies word entry 150 C 802 Sets indirect variable head address 160 C O SGi eiaa Sets the number of points to be entered to 6 170 1 PEPERIT Sets entry data head address 180 C 2 HTO n Sets time check period to 70 700msec 190 Z CALL O 8084 1 B Calls system subroutine SADMO 200 IF 2 0 PRINT ERROR Z GOTO 190 Checks for errors in SADMO execution 210 END 7 19 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE C
50. BASIC program to buffer memory addresses 350 to 38F 100 100 Indirect variable head address 110 0 5350 86 Data destination buffer memory head address 120 1 E700 Data source buffer memory head address 130 C 2 40 Number of data words 140 D CALL 0 8003 1 System subroutine SW2 writes data to buffer memory 150 IF D 0 PRINT ERROR D GOTO 140 n Checks for errors in SW2 execution 160 END 7 6 IB NA 66188 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 4 7 2 2 Read write with sequence program Access to the buffer memory from the PC program is via the FROM and application instructions 1 Read from buffer memory FROM FROMP Format DFROP instructions instruction executing AD51CPU condition down m m 16th VO address of the 051 omitting the least significant digit ES Buffer memory head address of data source KM EON Head device number of data destination D W R m Number of words of data to be read Note that the location specification for the AD51 is different from other special function modules To specify the slot location use the number representing the 16th I O point omitting the modules So for example 1 0 point 120 is represented as 12 Hence if the 051 is located at I O addresses X60 to X8F and Y60 to Y8F n is d
51. C79 set values 210 IF Z 0 PRINT ERROR Z GOTO200 Checks for errors in SAAR execution 220 END 7 39 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 7 7 Microcomputer Program Read Write PC CPU microcomputer programs are read and written from the AD51 in the following procedures 7 7 1 System subroutines and functions The following system subroutines are used to read and write microcomputer programs 1 System subroutine types and functions Number of Points PC CPU State System i Processed per Subroutine Processing PC CPU AD51 During During Transaction STOP RUN Main Reads main microcomputer program Read SAMR Sub Reads sub microcomputer program Wites main microcomputer program 7 079 Writes main microcomputer program Writes sub microcomputer program Key Available Table 7 11 System Subroutines and Functions When the A3CPU or A3ECPU is used a subprogram may be written while a main program is running and vice versa using appropriate control of M9050 and M9051 The A3N and A3HCPUs are not provided with M9050 The M9050 circuit must be deleted if any A3CPU or A3ECPU program is utilized for the A3N or A3HCPU Reason If M9050 is on any program cannot be written during run of the A3N or A3HCPU 2 Microcomputer program read write head address Specify the microcomputer program read write head address using the
52. E NEE ed from AD51 Buffer Memory Assignment Address for FROM TO Instruction 8 lower bits 8 8 higher bits bits digital value PER Oe CH1 voltage set value check code 144 ae ee ee eee CH1 current set value check code 18 w a TDENTUEUEUPY T EN ESO APP 2 NA 6618 APPENDICES MELSE m 3 A84AD analog digital converter module Address Specified from 051 B Assi nt Add for FROM TO Instruction uffer Memory Assignme lower bits Bis ress for i 2 CH4 averaging time count specification Reserved area must not be used Eee Eccc PER Td mr dgwiVO va 3 2 amp 9 che dighal VO vau 3 z amp SCS CHa VO vau 3 _ 2 1 digit 0 vau 1 i internal setting mode fag o 2 1 CH2 internal setting mode ag m w CH1 temperature detection vawe m Oo 1 CH2 temperature detection value 3 n 19 i set value check code 3 amp Write date error w _ 4 cht module code 4 4 2 CH4 module code CH1 temperature setting range 50 offset value CH1 temperature setting range gain vatue 52 53y 33 CH2 temperature se
53. F Parameters 3K bytes 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 E 300 310 320 330 340 350 360 370 Z CALL O 8030 FF 70 IF Z 1 LOCATE 5 10 PRINT CPU RUN GOTO 100 IF Z 0 GOTO eres processing Z ZWR1 2 F000 FF Z ZWR2 2 F004 128 Z ZWR2 2 F008 70 ee FOR 0 TO BFF STEP 80 Z ZWRQ2 2 F001 1 Z ZWR1 2 2003 0 Z ZWR2 2 F006 0000 1 2 8093 2 2000 IF Z 0 PRINT ERROR 7 GOTO V0 0 eee NEXT Z CALL 0 8096 FF 70 IF Z 0 PRINT ERROR Z GOTO 230 e M Z ZWR1 2 F010 Z ZWR10 F011 540 rrr Z ZWR2 2 2014 64 eee Z ZWR2 2 A E000 F018 70 FOR 0 TO 2047 STEP 64 Z ZWR2 2 F012 n Z ZWR2 2 F016 A enn Z CALL 0 808D 2 2010 IF 2 0 PRINT ERROR Z GOTO 330 eememe essor A A 128 NEXT END Checks PC CPU RUN STOP status Indicates whether the CPU is running Detects any error in SKC execution and moves to a suitable part of the program Defines the PC station number as host Sets byte length to be written to 128 Sets time check period to 70 700msec Sets parameter write head address Sets source data head address Writes parameters Checks for errors in SAPW execution Parameter analysis request Checks for
54. FDD access indicator LED turn on Is message FLOPPY ERROR displayed Displayed Check and correct fault as for start up troubleshooting in Section 8 3 2 No display Has FD been inserted Insert FD into FDD to be accessed Not displayed Is message FLOPPY WRITE ERROR displayed Displayed Is the correct drive A or B specified Specify correct FDD Set FD to write enable 1 Note the correct direction for inserting the disk and never force it 2 Formatting a disk clears all the data on it IB NA 66189 A 8 TROUBLESHOOTING 8 3 4 ROM troubleshooting Error during ROM operation Read disabled Verify disabled Write disabled Is message ROM WRITE ERROR is displayed NO Is ROM correctly loaded is ROM correctly loaded 1 Load correctly NO Is write possible with a new blank ROM Is read verify possible with a different ROM YES YES Faulty ROM Faulty ROM Do an erase check Erase or change ROM Consult the nearest sales Consult the nearest sales representative representative 1 Load correctly 1 Is ROM the right direction 2 Is ROM securely loaded in socket 3 15 ROM socket lever set correctly 8 9 NA 661 8 TROUBLESHOOTING 8 3 5 Multi task troubleshooting Multi task not executing properly NO
55. IC program and the contacts used in the sequence program Known as General purpose inputs Switched on to indicate an 51 CPU fault Unused 3 17 NA 66189 A 4 PRE START UP PRO MELSEC_AA 2 There are 48 output signals from the PC CPU to the AD51 May be used by the PC CPU as extra internal relays M Address 68201 Address 68004 Switched on off in the sequence program and read by the BASIC program known as General purpose outputs This output may be used to start one task in the AD51 designated as an interrupt program by its task start condition Unused 1 Input X1D is switched on when an error is detected by the AD51 hardware This signal may be used as an interlock in the PC sequence program to control PC accessing of the AD51 buffer memory i e instructions Switching output Y29 on will start the task which has its start condition specified as interrupt from ACPU The start condition is defined during multi task setting Output signals Y2A to Y2F are used by the operating system and must not be switched on or off IB NA 66189 4 PRE START UP PRO MELSEC 4 3 7 Buffer Memory The AD51 uses a buffer memory for data communication with the PC CPU The buffer memory is not battery backed 1 Buffer memory addresses are 000 to 3K words See the memory map in Section 3 4 2 Buffer memory data is made up of 16 bits per address 3
56. Moves to specified line number Table 3 2 BASIC Command List Continue 3 2 NA 66189 3 SPECIFICATIONS Moves to specified subroutine Returns from subroutine i Judges result of expression Input from keyboard Assigns input from keyboard to variable Assigns value of expression to variable Moves cursor position Prints out data Moves to subroutine in line number specified by value ui ONGOSUB of expression eam ONGOTO Moves to line number specified by value of expression auja gt command Reads 1 byte data from specified memory address POKE Writes 1 byte data to specified memory address Opens specified RS 232C RS 422 channel Displays data on screen 5 Underline Type when the console is GPP HGP Type B when the console is VT 220 Resets underline used after ZCOFF Type A when the console is GPP HGP Type B when the console is VT 220 ZCRV Reverses character color on CRT screen Reads year month day hour and minute Changes input console ZMOV Transfers data from memory to memory s Returns the character reversed after ZCRV to its original color Table 3 2 BASIC Command List Continue 3 3 IB NA 66189 A 3 SPECIFICATIONS Program command uae Intrinsic
57. ONTROLLER CPU 2 BASIC program example Program example Program for remote RUN STOP of PC CPU through key inputs 100 110 120 130 140 145 150 160 170 180 190 200 210 LOCATE 20 10 n Specifies cursor position PRINT STOP PC CPU Y N eee Displays message emn Waits for key input IFA Y GOTO 120 Checks key input characters 2 8036 FF 60 Executes remote STOP IF Z 0 PRINT ERROR 2 140 M Checks for errors in SKP execution LOCATE 20 10 n Specifies cursor position PRINT REMOTE RUN PC CPU Y N nanta las sinaos Dislays message Waits for key input IFA Y GOTO 170 nn Checks key input characters 2 8033 60 Executes remote RUN IF Z 0 PRINT ERROR 2 GOTO 190 6 Checks for errors in SKR execution GOTO 100 7 49 IB NA 66189 A 8 TROUBLESHOOTING 8 TROUBLESHOOTING This section lists error messages and troubleshooting procedures 8 1 Screen Error Messages The following messages may be generated during operation of the AD51 with its programming console Display Screen Description Corrective Action 1 Invalid number has been set 2 1 MULTI TASK GO 6 SYSTEM DATA TRANSFER 1 Correct the number has been pressed before multi 2 Set or correct multitask
58. ONTROLLER CPU The SADMO system subroutine Monitor data entry is used for both bit and word device and once entered is valid for all tasks These system subroutine enter the devices specified into the OS area where they remain valid until new ones are entered 5 Monitoring of devices SADM1 specified by the monitor data entry SADMO Program example 1 Program to specify and monitor the following bit devices X7D Y201 M178 B3A0 T46 contact C85 coil 100 A FOOD n Sets indirect variable head address 110 X007DY0201M0178BO3A0TSO46CC085 e eee REL TT LER ER Yd ee VENTRE T Stores device numbers into work area 120 BS Sets indirect variable head address 130 0 Defines PC station number as host 140 1 NOSE PE Qe Specifies bit entry 150 C 802 Sets indirect variable head address 160 C 0 26 n Sets the number of points to be entered to 6 170 nn Sets entry data head address 180 2 50 nnn 8688 Sets time check period to 50 500msec 190 Z CALL 0 8084 1 Calls system subroutine SADMO 200 IF 220 PRINT ERROR 2 GOTO 190 Checks for errors in SADMO execution 210 DS Sets indirect variable head address 220 0 0 Defines PC station number as host 230 D 1 z B ecesoeseoeoevoseseneccepeoeito Specifies bit monitor 230 D 1
59. PROGRAMMABLE CONTROLLER User s Manual Intelligent communication module type AD51 S3 MITSUBISHI ELECTRIC REVISIONS manual number is given on the bottom left of the back cover 1989 IB 66189 First edition INTRODUCTION Thank you for choosing the Mitsubishi MELSEC A Series of General Purpose Programmable Controllers Please read this manual carefully so that the equipment is used to its optimum A copy of this manual should be forwarded to the end User NA APPENDICES IB NA 66189 A CONTENTS 1 INTRODUCTION eS errr rrr rrr rrr rrr rr re eee re re eee eee eee ee ee n tee 1 1 1 6 1 1 Notes on Character Sets m WiesvessessesecosavessoesenasuctessseossseosasecssesssuvaseV eussueenceencoe Vio sa aae 1 6 2 SYSTEM CONFIGURATION Peer rer rer errr errr rere reer ee eee eee eee ee eee eee ee ee ee eee eee Tee T eee 2 1 2 6 2 1 Overall Configuration PEPPER 2 1 2 2 Applicable A Series Systems NICE vi 2 4 2 3 3 Peripheral Equipment TP Oe wala ee 2 5 3 SPECIFICATIONS TP Es AA 3 1 3 26 3 1 Performance pce reece cceccsccencene eeossocescceceosno A 3 1 3 2 Instruction Set 3 2 3 2 1 GPC BASIC S
60. R Example Program to read 4 byte data from buffer memory address 10 944 of the A68AD at VO addresses 80 9F to address 000 100 A Head address for system subroutine IN PUT data 110 0 Defines PC station number as host 120 1 09 Specifies module number 130 B FOO2 Sets indirect variable head address 140 B 0 594 Sets buffer memory head address 150 B 2 0 160 C F005 Sets indirect variable head address 170 4 Ce Sets the number of bytes to be read as 4 180 C 1 E000 Sets destination head address for data 190 2 60 Sets time check period to 60 600ms 200 Z CALL 0 8008 1 A Calls system subroutine SATR E 210 IF Z 0 PRINT ERROR Z 200 Checks for errors SATR execution 220 END 2 Batch write to buffer memory SATW Example Program to write 4090 to buffer memory address 10 114 of the A62DA at I O addresses OA OB 100 A Sets indirect variable head address 110 0 2000 nmn Sets data 2000 to be written 120 B 000 n6 Sets indirect variable head address 130 0 MM Defines PC station number as host 140 1 0B n Specifies module number 150 C 002 n etree es Sets indirect variable head address E 160 C 0 2 10 Sets buffer memory head address 170 C 2 0 180 DS 005 Sets indirect variable head
61. RS 232C for distances up to 15m 2 In the 1 N link configuration the RS 232C port be connected with the host computer by using an RS 232C RS 422 converter between the host computer and 51 1 4 1 INTRODUCTION AA SEC A IB 661 1 INTRODUCTION 6 Communication with other stations in MELSECNET The AD51 loaded on the PC CPU in MELSECNET allows communication with the other stations Master station M CPU module Remote station 3 R3 Link module CPU module Local station 1 L1 2 3 3 5 Local station 2 tier 3 master station L2 m Local station 3 43 PU module CPU module Remote station 2 Local station 1 Link module PC CPUs allowed for communication PC used with AD51 MELSECNET station allowed for com munication Station M master station c 1 Host station 2 All local stations in tier 2 L1 L2 m 3 Remote I O station used with special function module in tier 2 R3 Station L local station c7 1 Host station 2 Master station in tier 2 station M Station local statiorvtier 3 master station essen 1 Host station 2 Master station in tier 2 station M 3 All local stations in tier 21 23 4 Remote I O station used with special function module in tier 3 r2 Station tier3localstation 1 Host station 2 Master station in tier 3 L2 m 66189 A 1 INTRODUCTION MELSEC Z
62. The console should be controlled from one task only Do display control codes meet specifications Use console with suitable display control codes 8 11 n AS GGG PGEBEG D BESEBHEEN NA 661 8 TROUBLESHOOTING 8 3 7 Print out troubleshooting Print out data is corrupted Is AD51 correctly connected to printer Correct wiring YES Is printer connected to channel specified in printer setting NO Has printer NO connection channel Open printer connection channel has opened Has printer NO connection channel been Specify printer connection channel specified with with ZODV ZODV Is printing NO being executed with PRINT Print with PRINT command command Is communication mode NO Open printer channel or re set prin a correct ter communication mode YES YES Is connected channel closed Open or stop closing channel NO NO The DTR signal should be switched 15 control correct off by the printer when its buffer has 5 bytes or more empty YES YES Tray a different printer is this printer OK Printer failure NO Consult the nearest sales representa tive 8 12 NA 66189 A 9 MAINTENANCE 9 MAINTENANCE 9 1 Battery Life When the battery voltage drops the error indicator on the front of the AD51 displays 00 The error can also be read using the SIR sys
63. Transmission buffer Transmission buffer Transmission command executed Transmission data 1 127 Empty area 3 23 bytes gt buffer mand execution is stopped As transmission data cannot be stored to the transmission transmission com IB 66189 4 PRE START UP PRO 2 Data is transmitted in the same order as stored to the transmission buffer when the external device is enabled to receive data by communication control DTR control or Xon Xoff control 3 Data received from the external device is stored to the buffer memory When the empty area of the receive buffer is reduced communication control alerts the external device to receive disable 4 Execution of the receive command INPUT INKEY SRB in the user program transfers data from the receive buffer to the user work area Receive buffer Receive buffer Receive Receive command command executed data 511 Receive data User work area 2 length bytes NA 6618 4 PRE START UP PRO MEL SECA 3 10 Communication Control The AD51 has two types of communication control DTR control and Xon Xoff control Communication control defaults to DTR control Either control may be selected by executing the corresponding system subroutine as follows DTR control Execute SHD Xon Xoff control Execute SHX Channel 2 RS 422 terminal block is not allowed for communica tio
64. a cmr 4 OD T d 5 era s Ej uj v e amp e rjv t v 1 1 1 7 7z Gjw g jw F s ss H x v riz i ir B koI t gt Wr pu em pour F For CTRU _ press and CTRL simultaneously ESC 284 M 40 ESC 289 G 374 APP 8 IB NA 6618 APPENDICES _ MELSEC 4 2 GPP HGP PHP character codes 5 1 1 1 1 1 21 1 t ECHEXKREHSEHENENERESQIRENEKAETEERENEHEN _ 1 1 3 Selected character list A 1 7e B 5c 2 7c 6 40 3 60 j 5b 4 7b a 5d 5 7d APP 9 IB NA 66189 A APPENDICES Escape Sequence ZEEE DEN n Character Character qualification OFF esc 0 m qualification Character highlight ESC 1 7 Move the cursor to Line specification
65. and 1 of the main base unit and that any BASIC program is written in channel 1 7 1 General Purpose I O Read Write The 51 can access the general purpose I O immediately and continuously using the PEEK and POKE commands This eliminates the need to use the data memory read write system subroutines which are only processed when the END or COM instruction is executed in the PC CPU Output Y29 from the PC CPU can be used as an interrupt signal to the AD51 see Section 7 9 aN E _ IB NA 66189 7 1 1 General purpose O addresses The general purpose I O assigned to the AD51 are accessed via the following addresses in the user work area Bit Configuration Command number Reserved for Table 7 1 General Purpose I O Data Configuration 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A 7 1 2 Write to general purpose input To wrote to a specified general purpose input the appropriate bit in the relevant byte of memory must be set or reset The memory addresses for general purpose inputs and outputs are given in Section 7 1 1 This section describes the direct accessing of general purpose I O data using the PEEK and POKE commands The system subroutine SADR may also be used to access this data but system subroutines are only processed after the END or COM instruction has been executed in the PC CPU Write to general purpose inp
66. are Configuration The following shows a block diagram of the AD51 software configuration indicating how the various areas interact Power on Multitask executed Initial setting Storage of user program and data onto disk Storage of user program BASIC interpreter and data onto ROM User program Operation is enabled only in offline TASK 1 to 8 BASIC mode when multitask or BASIC program program is not being executed Fig 3 1 Software Configuration 1 As shown in Fig 3 1 a maximum of 8 user programs may be processed in parallel under the control of the real time monitor 2 Power on interrupt from ACPU and real time interrupt are available as starting conditions for the user program 3 Each task can only be written in BASIC IB NA 66189 A 2819 4 PRE START UP PRO 3 4 Memory Map 3 4 1 Memory configuration The AD51 is a Z 80 based system To expand the memory size from 64K bytes the second 32K bytes are duplicated in additional channels as shown in Fig 3 2 below Bytes with the following head addresses in the User Work area are used for direct accessing of the General Purpose 1 O assigned to the AD51 using the PEEK and POKE commands see Sec tion 7 1 1 BE outputs 2 inputs 60001 to 67FFH 2K bytes RAM user work area 2 Channels 3 and 4 become available 7 When ROM is loaded On board On board A000 On board On board RAM Channel RAM
67. as host 230 1 57 Specifies word monitor T 240 0 1 EAQ0 Data destination head address 250 0 2 50 MK Sets time check period to 50 500msec 260 Z CALL 0 58087 1 0 Calls system subroutine SADM1 270 IF Z 0 PRINT ERROR 2 260 n M Checks for errors in SADM1 execution 280 END The data is stored in the AD51 in the following formats depending on whether bit or word has been specified Bit Example 1 Word Example 2 B7 86 BS B4 B3 B2 B1 BO 87 B6 85 B4 B3 B2 B1 BO eo pedo 5 C85 7 21 IB 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC AA 7 4 Extension File Register Read Write The following procedures are used to access the extension file registers from the AD51 7 4 1 System subroutines and functions The following system subroutines are used by the AD51 to access the PC CPU extension file registers 1 System subroutine types and functions Number of Points PC CPU State System Processing Processed per Subroutine PC CPU AD51 i Transaction Batch Reads data from extension file register for 1 SAER read point SAEW Writes data to extension file register for 1 write point Test during SAET Writes data to any specified extension file random register for 1 point write Monitor Defines the extension file register to be moni data entry tored
68. as written first For full information see Section 2 4 4 in the GPC BASIC Handbook The time check period in line 180 should be set in accordance with the number of scans required for processing given in Section 3 8 after taking into account any delays which may occur due to other devices accessing the PC CPU 712 NA 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC Al Program example 2 Program to read data from 16 points X100 to X10F to AD51 addresses E000 to E001 in word units i e batches of 16 bits 100 A F000 MH Head address for system subroutine IN PUT data 110 0 FF n Defines PC station number as host 120 1 Specifies word read 130 BS F002 Sets indirect variable head address 140 X0100 enm M Sets head device to be read using char acter string variable 150 C F007 e Sets indirect variable head address 160 Sets the number of points to be read as 1 170 C 1 E000 Sets destination head address for data 180 C 2 60 n 8 Sets time check period to 60 600msec 190 2 0 807B 1 Ay Calls system subroutine SADR 200 IF Z 0 PRINT ERROR Z GOTO 190mm Checks for errors in SADR execution 210 END When bit read is specified one byte of AD51 memory is required per bit of data When word read is specified one byte of AD51 memory contain
69. bed below Value of expression variable is converted into a pore 6 digit decimal ASCI code and transmitted to the external device Value of expression variable is converted into a 4 digit hexadecimal ASCII code and transmitted to the external device 2 Value of expression variable is converted into 2 digit hexadecimal ASCII code and transmitted to the external device expression Value of expression variable is converted into a real variable ASCII code and transmitted to the external device Value of expression variable is converted into a decimal ASCII code of specified digits and transmitted to the external device Value of expression variable is regarded as an ASCII code and transmitted unchanged to the external device Data stored in character string variable is regarded as an ASCII code and transmitted unchanged to the external device 3 The PRINT command may be used with ASCII codes 00 to FF Note that 00 and OD are transmitted as indicated below When transmission data is 00x OD is sent When transmission data is 00 0D and OAs are sent The following program should be written when sending OD or OD and OA by the PRINT command 0D PRINT 00 0A PRINT X D 6 10 IB NA 661 6 AD51 PROGRAMMING NOTES MELSEC AA 6 4 2 LPRINT command 1 Transmits data from the channel specified on the printer
70. can know that the AD51 has been reset 5 Any LFROM or instructions executed by the PC CPU when the AD51 is reset will be invalidated 2 PC CPU reset operation 1 All the AD51 general purpose outputs are switched off 2 Resetting the PC CPU disables access by the AD51 to the PC CPU for about five seconds after the PC CPU is set to RUN If the PC CPU is accessed during this period PC DOWN ERROR or TIME OUT ERROR is detected 6 6 Notes on BASIC Programming 1 Before making additions or corrections to the BASIC program or changing the program to its final format with the RUN or COMPILE command set the M PROTECT switch to OFF 2 Before executing multi task remove all STOP and BREAK commands 3 Always RUN or COMPILE the BASIC program after it has been completed The RUN or COMPILE commands change the program into a format suitable for multitasking If the program is not format ted the CPU may misoperate Remember to RUN or COMPILE programs before writing them to ROM 6 12 IB NA 661 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU M LSEC A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU The AD51 occupies 48 points and is provided with 13 digital inputs and 10 digital outputs as well as a word buffer memory The following section describes communication between the PC CPU and the AD51 It is assumed that the AD51 is located at slot 0
71. ce Specifications umeros O Real time interrupt Set in the range 0 01 to 9 99 seconds units of 0 01 second Maximum 114K bytes 64K bytes 2K bytes 48K bytes Common work area Internal memory Two 16KROMs ih a For details refer to Section 3 4 Task start conditions General purpose input 13 points General purpose output 10 points For details refer to Section 3 6 3K words 6K bytes For details refer to Section 3 7 Memory protect 4F00 to 4FFF system data area address range 8000 to DFFF channel 1 to 4 Conforms to EIA RS 422 Channel 1 D shell connector RS 422 Channel 2 Terminal block Interfaces Transmission distance 5500 General purpose I O Conforms to EIA RS 232C Channel 3 4 D shell connector Transmission distance amp 15m RS 232C Performs high speed processing of BASIC s intrinsic func tions trigonometric inverse trigonometic logarithm ex ponential absolute value Year month day hour minute second Read write Clock element 24 hour mode automatic leap year compensation Internal memory lithium battery for back up of real time clock Total back up time 130 days Battery life 5 years AGHGP AGPHP VT 220 Number of VO points occupied Internal current consumption 250 9 84 H X76 2 99 W X120 4 72 Table 3 1 AD51 Performance Specificati
72. ceived from the A6GPP and AJ71C24 S3 communication between the AD51 and PC CPU is only made once every three scans 3 When a system subroutine is called which accesses the PC CPU there is a delay while the PC CPU prepares the appropri ate data During this delay time the AD51 switches tasks to optimize scan time In the example shown below three tasks are executing subroutine which access the PC CPU Task one provides the first processing request to the PC CPU which prepares the requested data During this delay the AD51 switches to task 2 which is unable to pass its processing request to the PC which is still dealing with the one from task 1 The AD51 therefore switches to task 3 for which the same situation exists Only after task 1s request has been fully processed can task 2s request be dealt with Similarly task 3 must wait until task 2 been processed For details of other task switching refer to the GPC BASIC Handbook END END END END Access completed 16 lines 16 lines 16 lines 16 lines completed completed completed completed Unable to give Processing request Task 3 i Unable to give processing Waits after giving 16 lines completed request and waits Processing request Access completed 3 21 IB NA 66189 A 4 PRE START UP PRO 3 8 1 Transmission time in MELSECNET Transmission time T is calculated as follows if data transmission is made to the specified PC CPU which is not used with the AD51 in MELSECNET
73. control codes CR code LF 100 LPRINT ABCDE code are sent from AD51 jo Print control code 03 is sent from AD51 execution of line 120 execution returns to line 100 Data is continuously written to the KD51PR while it is still printing Print result ABCDE A B D E E D D E A C E a naro IB NA 66189 6 AD51 PROGRAMMING NOTES e f Example 2 aa a lg KDB1PR setting 2K buffer ON buffer full set L 4 BASIC program 4 Print data and control codes CR code LF i 100 LPRINT ABCDE code are sent from 51 110 LPRINT 03 1 120 ZTIME 400 4 L Print control code 03x is sent from AD51 130 GOTO 100 L f The KD51PR starts printing after it receives the 03x code The ZTIME instruction allows a time delay before the next set of data is Print result sent 1 LJ ABCDE In this case it takes 4 seconds from 1 time print command to print termination 1 ABCDE ABCDE print 2 seconds ABCDE CR LF line feed 2 seconds i L L t i IR M 4 b When the 2K buffer is set to OFF in the KD51PR any string of character
74. controller CPU Interruption to programmable controller CPU o w sm _____ _____ sc ____ 99e bof saen Res exer mes or FE CPU of PC CPU o 1 SAET Randomly writes data to extension file registers of PC CPU Defines PC CPU extension file registers Monitors PC CPIJ extension file registers C 1 specified monitor data entry o 55 2 SAMR Reads Reads microcomputer program from PC CPU program from PC CPU Reads microcomputer program from PC CPU socca e 2SAMW Writes microcomputer program to PC CPU o soc 57 SACR Reads comments from PC CPU a res oe 47 8002 58 SACW Writes comments to PC CPU Writes comments to PC CPU o 80D5 Reads data from special function module Writes data to special function module Table 3 3 System Subroutine List Where system subroutines have several options indicated as only those shaded id may be used on the AD51 1 System subroutines indicated as are covered in the GPC BASIC Hand books 2 System subroutines marked 1 may only have access to the A3CPU A3NCPU and A3HCPU System subroutines marked 2 may only have access to the A1ECPU A1CPU A1NCPU A2ECPU A2CPU A2NCPU A3ECPU A3CPU A3NCPU and A3HCPU IB NA 66189 4 PRE START UP PRO 3 3 Softw
75. corresponding offset address as indicated below Microcomputer Program Offset Address Step 0 0000 Step 1 00014 to to Step 59391 58K E7FF This address assumes that the microcomputer program capacity has been set to 58K bytes in the parameter NA 661 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A The head address number of bytes processed should be microcomputer program capacity set in parameter 1 byte max Head address number of bytes processed micro computer program capacity set in parameter 1 byte When reading or writing microcomputer programs al ways ensure that the parameters match the programs Mismatches of parameters and programs may corrupt the PC CPU data 7 7 2 BASIC program examples The following program examples transfer microcomputer prog rams between the PC CPU and AD51 1 Microcomputer program read SAMR Example Program to read PC CPU main microcomputer program to the following AD51 memory area Microcomputer program 4K bytes Channel 2 E000 to EFFF 100 Z ZWR1 2 F800 FF Defines PC station number as host 110 Z ZWR1 2 F801 4D Sets main M microcomputer program 120 Z ZWR2 2 F804 64 Sets the number of bytes to be read as 64 130 Z ZWR2 2 F808 60 se Sets time check period to 60 600ms 140 A Sets indirect variable head address
76. d Correct task start condition Stack used is outside the system stack area Check whether the system memory has been accessed by the user program Duplex WAIT error BTWF RAM contents for system s task error schedule have been rewritten RS 422 CH1 511 bytes of received data in receive buffer Receive buffer full error Do not send more than 512 bytes at one time RS 422 CH1 RS 422 CH2 Check cables Send buffer ful error 127 bytes of send data in send Empty the external equipment re RS 232C veive buffer RS 232C 1 CPU has been reset during communication 2 Time out error has occurred dur ing PC accessing by system sub routine 051 program execution not directly CPU error 3 PC CPU error detected by WDT affected and communication has stopped Note Error code 99 is sometimes displayed after an instan taneous power failure 53 70 8 4 1B 66189 8 TROUBLESHOOTING 1 The 051 continues operating in the event of battery error ORST error receive buffer full error send buffer full error or PC CPU error 2 The receive buffer capacity is 511 bytes per channel Overflow data is ignored 3 When data is sent from one task to the buffer memory and the buffer memory becomes full the AD51 switch es tasks After that task has run
77. d address of microcomputer program to be written 200 Z ZWR2 2 F006 A 99999999 Sets data source head address 210 Z CALL O 80CF 2 2000 Calls system subroutine SAMW E 220 IF Z0 PRINT ERROR Z GOTO 210 6 Checks for errors in SAMW execution E 230 64 sn Adds 64 to data source head address 240 NEXT 250 END IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC A 7 8 Comment Read Write Comments are read and written in the following procedures 7 8 1 System subroutines and functions The following system subroutines are used to read and write PC CPU comments from the AD51 1 System subroutine types and functions Number of Points PC CPU State System Processed per Subroutine Processing AD51 During During Transaction STOP Batch read SACR Reads comments 128 bytes Batch write SACW Writes comments Key Available Table 7 12 System Subroutines and Functions 22 Comment read write head address Specify the comment read write head address using the offset address The head address number of bytes processed should be equal to or less than the comment capacity set in the parameter Head address number of bytes processed S comment capacity When reading or writing comments always ensure that the parameters match the comments Mismatches of parameters and comments may corrupt the PC CPU data A S 743 IB 66189 A
78. d in Japan Specifications subject to change without notice
79. data task setting or there is an error in the multitask data Mode select menu BASIC program CANNOT SET address setting Invalid number has been set Correct the number Date and time 1 GPP mode selected without connecting the GPP HGP PHP to CH1 2 Invalid number has been set System data area is memory pro Set the memory protect switch to Mode select menu tected OFF BASIC program address setting GPP mode Correct MEMORY PROTECT ERROR DATA SET ERROR Correct The data indicated on the menu by the number n is wrong Printer setting Correct For ERROR displayed in the TYPE START CONDITION or INTERVAL columns correct the data on the screen For other columns correct the data on the BASIC program address setting screen Multitask setting Value above ERROR is wrong Usually causes by the PC CPU GPP HGP PHP inaccessible to accessing the AD51 buffer memory AD51 buffer too frequently or with too much data STOP the PC CPU AD51 BUS ERROR AD51 COMMUNICATION Communication error between Check cable connection and start ERROR AD51 and GPP HGP PHP up again Memory area is ROM or memory Select RAM area channel or reset ADS1 WRITE ERROR protected memory protect ADDRESS ERROR Address is not in the allowed range Correct Select appropriate character set and use alphanumerics for sy
80. dress work area task 1 Channel BASIC interpreter work area task 2 Task BASIC text area task 1 Over Program head address lapping Program last address BASIC text area task 2 interpreter Additional program head address work Work area head address BASIC interpreter work area task 1 area Channel BASIC interpreter work area task 2 6 2 IB NA 6618 6 AD51 PROGRAMMING NOTES 5 When the system data is stored onto ROM the program head address must be 8100 or a subsequent address because addresses 8000 to 80FF of channel 1 are used as a system data area Setting the program head address between 8000 and 80FF will corrupt the BASIC program and disable normal program execution 2222 sve du we User memory area Channel 1 6 3 IB NA 66189 6 AD51 PROGRAMMING NOTES 6 2 Start Conditions There are 4 types of BASIC program execution formats 1 Program runs once after power on 2 Program runs continuously after power on 3 Program runs after an interrupt signal from the PC CPU 4 Program runs at preset intervals in real time 6 2 1 Program runs once after power on Write the BASIC program so that END is executed as the final instruction and set the task start condition to POWER ON Task runs once after Set multi task start condition to power on POWER BASIC program 6 2 2 Program runs continuously after power on
81. e following system subroutines are used by the AD51 to access the special function module buffer memory 1 System subroutine types and functions Number of Points PC CPU State System gt Subroutine Processing PC CPU AD51 During During Transaction STOP RUN SATR Reads data from buffer memory for 1 byte 128 bytes mon SATW Writes d ff lor ick b write rites data to buffer memory for 1 byte 128 bytes Key Indicates available Table 7 7 System Subroutines and Functions 2 Special function modules and buffer memory addresses Any special function module buffer memory has 16 bit 1 word locations per address Data communication between the PC CPU and special function module is made using the instructions The buffer memory is accessed by the AD51 per address i e in blocks of 8 bits 1 byte The address hexadecimal specified by the AD51 is calculated by the following expression Specified address hexadecimal FROM TO instruction address X 2 in hexadecimal module head address Example AD61 high speed counter module s FROM V TO instruction address 0 present value of CH 1 Specified address _ FROM TO instruction address 0 X 2 head address 82 82 7 29 NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU Buffer Memory Head Address Hexadecimal end wea
82. eccessary battery consumption The battery plug should be connected to pins CON7 on the circuit board before the AD51 is used The red wire is positive and the connector is keyed to prevent wrong connection A 4 11 In A IB NA 66189 A 5 WIRING T MELSEC_A 5 WIRING 5 1 Wiring Instructions AD51 external wiring should be protected against noise 1 Keep cables carrying data at least 100mm 3 94inch away from main circuit wiring high voltage cables and PC input and output wiring 2 Ground shield wires or cable shields at one point only 3 Use M4 solderless terminals for connection to the RS 422 terminal block 5 2 RS 232C Connection RS 232C connection External equipment Fig 5 1 RS 232C Connection Diagram A maximum of 32 stations may be included in the multidrop system with an overall link distance of 500 547 Sg aaa TTI IB NA 6618 5 WIRING MELSEC A 5 3 RS 422 Connection 1 RS 422 connector External equipment 5 2 66189 5 WIRING 2 RS 422 multidrop connection External equipment External equipment as master station AD51 as master station A maximum of 32 stations may be included in the multidrop system with an overall link distance of 500m 547Yd RS 422 multidro
83. ection 8 3 2 See FDD troubleshooting Section 8 3 3 See ROM troubleshooting Section 8 3 4 See multi task troubleshooting Section 8 3 5 See CRT display troubleshooting Section 8 3 6 See print out troubleshooting Section 8 3 7 IB NA 66189 8 TROUBLESHOOTING 8 3 2 Start up troubleshooting Turn power on POWER switch ON No display Initial screen display Display GPP HGP PHP starts nor mal operation Error message No display display 5 Display Display error message column DISK READ ERROR System FD is damaged or corrupted NOT READY NON SYSTEM ERROR System FD is not inserted Wrong FD inserted Turn POWER switch off Press and set POWER switch to simul taneously Is POWER LED off or 2 displayed at top left of screen 1AR MITSUBISHI MELSEC A6GPP display ed at top left of screen Has power fuse blown operstion fault 1AR FDO fault 2AR FDO 8 fault GPP HGP failure Is line voltage within specified voltage Insert system starting FD into FDD or FDO 8 Change fuse Adjust line voltage Return the unit to the nearest sales representa tive with failure details 18 NA 6618 8 TROUBLESHOOTING 8 3 3 FDD troubleshooting Error during FDD operation Does
84. efined as H7 Program example Fig 7 3 shows a program to read the data from buffer addresses 500 to 54F to data registers D100 to D179 in the PC CPU When X13 turns with system configuration shown in Fig 7 2 Slot number 2 10 x20 790 To og YBO xar ver Fig 7 2 Module Configuration Fig 7 3 Buffer Memory Read 7 7 IB NA 66189A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU ff MELSEC AA 2 Write to buffer DTO in structions 10 instruction executing AD51CPU condition d Emm m pers 5 Usable 16th UO address of the 051 omitting KH the least significant digit j Lime Buffer memory head address of data destination EX Head device number of data source A I nme Number of words of data to be written Program example Fig 7 4 shows a program to write data from PC data registers D200 to D263 to buffer addresses 100 to 13F when X1F turns on with the system configuration shown in Fig 7 2 FE Trop s Tes one Fig 7 4 Buffer Memory Write 7 8 nC IB 661 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 3 Device Memory Read Write This section explains how the AD51 communicates with the PC CPU device memory to read present value data and to write new values 7 3 1 System subroutines and device ranges The following sys
85. ene Asn tong mom omnee mue m meu heme Table 7 8 Special Function Module Head Addresses Special Functien Module 3 Special function modules and module numbers The special function module number hexadecimal specified by the 051 is the first two digits of the three digit final 1 0 address of the special function module with respect to the PC CPU a Module occupying one slot such as AD61 A68AD Special function module number 014 b Module occupying two slots and using the first slot as empty e g AD72 A84AD Special function module Special function module number 024 Empty slot 16 32 points points 7 30 NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 4 c Module occupying two slots and using the second slot as empty os i 8 Special function i 2 module Special function module number 01x je 32 i 16 points points 00 20 to to 1F 2F d Module occupying two slots as a special function module and an input module A81CPU Special function module Special function module number 03 64 points Module Number of Module on Slot 0 om eub emos os m Aeris rosorna moam m meme nue Table 7 9 Special Function Modules and Module Numbers Special Function Module tee
86. eseoeseseooeveseoeseseseneoreeecoteeceeceeo 6 12 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 1 7 49 7 1 General Purpose I O Read Write Henn 7 1 7 1 1 General purpose addresses e n n HH 7 2 7 1 2 Write to general pu rpose input CIEN OS VET I e yO oA 7 3 7 1 3 Read from general purpose output men 7 5 7 2 Read Write of Buffer Memory mener 7 6 7 2 1 Read write with BASIC program E ELE E 7 6 7 2 2 Read write with sequence program mnn 7 7 7 3 Device Memory Read Write emen 7 9 7 3 1 System subroutines and device ranges 7 9 7 3 2 BASIC program examples teeter este eee 7 12 7 4 Extension File Register Read Write 7 22 7 4 1 System subroutines and functions Hen 7 22 7 4 2 BASIC program examples HH 7 26 7 5 Special Function Module Buffer Memory Read Write nm 7 29 7 5 1 System subroutines and functions SER WENGE ERAN E 7 ER EN 7 29 7 5 2 BASIC program examples 7 33 7 6 Read Write of Sequence Program T C Set Values n nm 7 34 7 6 1 System subroutines and functions HH 7 34 7 6 2 Read and write procedures e eH 7 36 7 6 3 BASIC program example HH 7 37 IB NA 66189 A 7 7 Microcomputer Program Read Write eee ee ee 7 40 7 7 1 System subroutines and functions menm 7 40 7 7 2 BASIC program examples HH ne 7 41 7 8 Comment Read Write 7 43 7 8 1 System s
87. he time required by other tasks An ORST error is detected if a second real time interrupt signal is given before the interrupt program has ex ecuted its END command For tasks other than the one started by the interrupt signal from the PC CPU Section 6 2 3 any system subroutine must not be executed to access the PC CPU within five seconds after the PC CPU is run A PC down error will occur if the system subroutine is executed within five seconds 6 5 IB NA 66189 A 6 AD51 PROGRAMMING NOTES LOE 6 3 Notes on the Use of BASIC Commands 6 3 1 Key input commands Key inputs INPUT and INKEY commands to the AD51 via one channel as specified by the ZIDV command should only be made to one task Since tasks are executed in order of task numbers any data keyed in to a task can only be read at certain intervals If a key is pressed and more than one task is waiting for data from the specified channel only the first task to execute the INKEY or INPUT instruction will read the key input The other tasks will then continue waiting until a key is pressed while they are being run Task 1 Task 2 100 REM TASK 1 100 REM TASK 2 to to 200 ZIDV 1 500 ZIDV 1 210 A INKEY 510 B INKEY to to Example When both task 1 and task 2 are waiting for key input from channel 1 pressing a key will only write data to one of variables A or B 6 3 2 Printing commands The printing commands are PRINT and LPRINT
88. head address 140 FOR 0 TO 4095 STEP 64 150 Z ZWR2 2 F901 1 sree Sets head address of comments to be written 160 Z ZWR2 2 F905 A Sets data source head address 170 2 CALL 0 8005 2 F900 Calls system subroutine SACW 180 IF Z 0 PRINT ERROR 2 GOTO 170 e MM Checks for errors in SACW execution 190 64 nnm Adds 64 to data source head address 200 NEXT I 210 END 7445 NA 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 9 Interrupt from PC CPU to AD51 The interrupt signal from the PC CPU to the AD51 is valid on its rise i e the AD51 waits for the leading edge of the signal How to use To enable the interrupt facility the relevant task should be set to start at interrupt from PC CPU on the multi task setting screen The AD51 will then run that task when it receives the interrupt signal Once it has been started the interrupt task will operate until the instruction is executed The interrupt is re enabled after the instruction is executed Program example The foHowing P C program will call the designated interrupt task when X01 turns on 051 interrupt Slot number X10 X20 X30 Y40 to to to to to XOF X1F X2F X3F Y4F Y79 Interrupt output AD51 OS interrupt flag Used by O S only Interrupt task processing Fig 7 6 Timing Chart POINT 1 Any interrupt signal given to the AD51 while an interrupt p
89. idual bits Switch on Y80 to Y8F Switch off 90 to Y9F 100 A 00 Head address for system subroutine IN PUT data 110 0 Defines PC station number as host 120 ALT Wi Specifies word write 130 B E802 Sets indirect variable head address 140 0080 n n Sets destination head device using char acter string variable 150 C E807 Sets indirect variable head address 160 2 n Sets the number of words to be written to 2 170 1 000 nnn Sets source data head address 180 C 2 930 n reese reese eens Sets time check period to 30 300msec 190 000 FFFF Generates data to be written to addres 200 002 0 ses E000 to 003 210 Z CALL 0 807 1 Calls system subroutine SADW 220 IF Z 0 PRINT ERROR 2 GOTO 210 8 Checks for errors in SADW execution 230 END When bit write is specified one byte of AD51 memory is required per bit of data When word write is specified one byte of AD51 memory contains 8 bits of data See below Bit Units Example 1 Word Units Example 2 B7 B6 B5 B4 B2 B1 BO ver ves ves ves ves ves vo vor vae vao vec vae ves ves ves B7 B6 B5 B4 B3 B2 B1 BO vor ves ver ve vor vae vec vas ves ve BO is valid and B1 to B7 are ignored
90. ions are allowed BTWF ERROR AD51 STOP Task scheduling RAM data has Check whether the system memory WAIT ERRORI been changed has been accessed by the user rogram AD51 STOP There is a BASIC statement which AD51 STOP TASK NO cannot be translated by the inter Correct BASIC program preter Multitask execution Remove STOP command STOP COMMAND change to END GOTO GOSUB 051 STOP TASK NO STOP command executed RETURN ONGOTO or ONGOSUB command BREAK COMMAND AD51 STOP TASK NO BREAK command executed Remove BREAK command BASIC program does not finish TEXT END with END GOTO GOSUB ONGO Correct AD51 STOP TASK NO TO ONGOSUB or RETURN com mand WHAT BASIC programming mode error detected in BASIC program Correct 1 BASIC programming Program area insufficient ROM OR MEMORY mode PROTECT AREA Program area is ROM or memory PLEASE DO NOT protected Alarm message 2 CORRECT PROGRAM 1 WHAT and HOW are indicated when 1 An undefined command is used 2 A command description format is wrong 3 A line number is not specified on the left of the GOTO GOSUB ONGOTO or ONGOSUB com mand and 4 The RETURN command is used without the GOSUB or ONGOSUB command When this message is indicated never correct the program Correction will corrupt the BASIC program memory area data With this message displayed only LIST LLIST and BYE commands should be used To allow
91. ission to the PC CPU which is not used with the AD51 in MELSECNET Transmission time can be reduced by performing com munication only between the 051 and the PC CPUs used with the AD51 PC No FF and using MELSECNET data link B W for communication with the other PC CPUs 3 22 1B NA 6618 4 PRE START UP PRO 3 9 AD51 Communication Data communication between the 051 and external devices e g computer I O console printer is made using RS 232C and RS 422 Data communication is made via the transmission and receive buffers which are controlled by the OS of the AD51 The transmission and receive buffers are controlled individually for channels 1 to 4 Transmission buffer 2 For CH1 RS 422 Transmission command User program BASIC program Receive command For CH4 RS 232C External device Transmission such as computer console printer Receive Fig 3 3 AD51 Communication 1 When the transmission command PRINT LPRINT SWB is executed in the user program transmission data is stored to the transmission buffer If the empty area of transmission buffer is less than the transmission data length the transmission command execu tion is stopped after as much data is stored to the transmission buffer The remaining transmission data is stored when an empty area is made in the transmission buffer by data transmission to the external device
92. l 2 The AD51 may be loaded into the master station or a local station but not into remote station MELSECNET System The following CPU modules are required for 3 One 051 A0J2C214 e link module may used with the A0J2 The A1 A2 A3HCPUs can 4 The AD51 cannot used d with PC CPUs manufactured in March 1986 and thereafter The name plate shown below indicates the date of manufacture ee 6 03 CER Month CORP BD990D216H01 Year digi of ves accomodate two AD51s or two AJ71C24 S3s or one of each the last slot of the seventh extension stage in an l system i NA 66189 A 2 SYSTEM CONFIGURATION 2 3 Peripheral Equipment The following table lists the peripheral equipment suitable for use with the AD51 Intelligent Main unit RAM Support battery supplied 8KROM 16K bytes for channels 1 and 2 16KROM 24K bytes available to AD51 For details refer to Section 3 4 2 32K bytes for channels 1 and 2 AGBAT For ICRAM support and real time clock Consists of the following models Programming unit with CRT Equipped with ROM writer FDD and printer interface functions SW GPPAEE EG A series system disk SW User disk 3 5 inch formatted AC30R4 Cable for connection of AD51 and A6HGP ACPU AJ71C24 S3
93. llowing block numbers may be used in accordance with the memory cassette and CPU used Memory Valid Block Numbers RAM ROM operation Cassette Invalid Block Numbers Memory Cassette Type A2N ASHCPU A2 E anes mui Deren mma ws suci be mma ema em awn aan arre oy ent ste a ww 12 Up to block 5 Up to 5 Blocks 10 117 18 144 144K bytes Up to block 9 to block 9 Up to block 9 to block 9 Up to block 9 to block 9 Blocks10t028 10 to 28 A2 E A3 E CPU Blocks 10to 28 E Up to block 9 Up to block 9 A3NMCA 24 mas ey 144K bytes Blocks 10 to 12 Blocks 10 to 12 UP to block 9 A2N AGNCPU Blocks 13 to 28 A2 E A3 E CPU Blocks 10 to 28 Up to block 9 Up to block 9 Blocks 10 to 20 Blocks 10 to 20 UP to block 9 Blocks 21 to 28 5 Up to block 9 Up to block 9 A2 E A3 E CPU Blocks 10 to 28 ASNMCA 56 144K bytes Blocks 10 to 20 Blocks 10 to 20 UP to block 9 A3NCPU Blocks 21 to 28 Table 7 5 Valid Block Numbers A3NMCA 40 144K bytes a As the A3NMCA 12 is processed as the A3NMCA 16 and the 18 24 and 40 processed as the A3NMCA 56 specifying an invalid block number does not lead to an error but the
94. mmy byte containing the binary representation of F7 as follows Bit pattern Address 6000s 00000000 F7 11110111 AND result 00000000 The result is written into variable B 120 POKE 6940 B Variable B is written to address 6940 i e the user work area reserved for accessing the gener al purpose I O 130 POKE 6001 The result is also written to address 60018 140 END X1D to 1F cannot be turned on off in the BASIC program The value marked in line 110 of 2 may also be 17 bits 5 to 7 0 If AND operation is performed the same result is obtained 7 4 NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 1 3 Read from general purpose output A similar procedure may be used to read the general purpose outputs using the logical AND operation The work area addresses are given in Section 7 1 1 Note that bits 2 to 7 of address 6820 are reserved for the operating system and should be masked Program example Program for ON OFF monitor of 20 to 27 100 A PEEK 6800 es Reads address 68004 to variable A 110 1 HH Variable set to 1 120 FOR 0 TO 7 130 IF A amp B 0 PRINT ON GOTO 150 Performs AND operation of variable and variable B and if relevant bit is on displays ON 140 PRINT OFF 150 B BX2 nm Shifts the contents of variable B one bit to the left 160 NEXT 17
95. mory protected To set memory protection to the required area use the DIP switches on the front of the unit as described below 1 Memory protect area Areas marked Z in the memory maps below can be memory protected Common area D 4 00 to 4FFFH system data area 6000 to 67FF user work area User memory area Channel Channel Channel Channel Channel 0 1 2 80004 p CLG GY FFFFH RAM area when ROM is installed 1 The memory protect DIP switch number is shown as D to in the above memory map 2 The memory protect DIP switch numbers for a given RAM address range remain unchanged when ROM is loaded although the channel number has changed from channel 1 to 2 or 3 to 4 4 5 IB NA 66189 4 PRE START UP PROCEDURES 2 Memory protect range Protected RAM address ranges are shown below The DIP switch is on when the lever points to the right this is marked on the switch cover mn Protect Range DIP Switch Details EL M Ki Memory address only loaded 3 pen sume swa 1 3 cooo to prem 2 eooo to SF Cave oe eat SW 2 4 cooo to Frm Unused 1 BASIC program address data and multi task setting data is stored in the system data area 4200 to 4FFF 256 bytes Set memory protect with SW1 after starting multi tasking SW1 must be set to OFF when the system data area data has been stored t
96. n control change 1 AD51 transmission The AD51 sends data after confirming that the external device is ready to receive The external device used must be capable of alerting the AD51 to receive disable when there is an empty area of 5 or more bytes in the receive buffer 2 051 receive The AD51 receive buffer has 511 bytes The AD51 notifies the external device of receive disable when the empty area of the receive buffer is 7 bytes or less The AD51 alerts the external device to receive enable when the empty area of the receive buffer is 32 bytes or more AD51 Receive Control External Device Receive Control Receive disable Receive enable External device 051 receive buffer AD51 receive buffer receive buffer Alerts the AD51 to receive dis able when there is a 5 or more byte empty area The external device connected to the AD51 must have a receive buffer and be capable of alerting the AD51 to receive disable when there is 5 bytes or more left as an empty area Any external device that performs communication hand shake in units of 1 byte cannot be connected to the AD51 3 25 IB NA 66189 A 4 PRE START UP PRO 3 10 1 DTR control Performs communication control using the data device ready signal and terminal ready notice signal RS 422 RSA RSB and CSA CSB RS 232C DSR and DTR a The data device ready signal is switched on to send data from the transmission buffer to the external de
97. o ROM Switching the memory protect key to ON protects all areas defined by the DIP switch settings Keep the memory protect switch OFF during BASIC program writing and editing The RAM areas marked and on the preceeding page and the user work area cannot be memory protected IB NA 6618 4 PRE START UP PROCEDURES 4 3 2 Console channel DIP switch SW16 determines which of the two channels CH1 and CH3 is to be used for the programming console When the VT 220 is used SW16 should be switched OFF defining CH3 RS 232C as the programming console port When the GPP HGP is used the switch is generally switched ON defining CH1 RS 422 as the programming console port RS 232C may also be used SW16 CH3 DIP Switch Details RS 422 RS 232C GPP HGP General purpose port General purpose port VT 220 GPP HGP The console setting switch is valid after the AD51 is powered up or reset When the console setting fas been changed reset the AD51 4 3 3 Terminal resistor A terminal resistor is fitted to prevent distortion of the transmis sion signal waveform When a number of AD51s are connected together via an RS 422 link the two end stations should be set N with terminal resistor present the remainder with terminal resistance absent DIP switches SW14 and SW15 are used to set the terminal resistance as shown below r SW14 SW15 i a With terminal resistor
98. of the device number may be specified as spaces 20 4 M and L ranges are specified in the PC CPU parameters however AD51 device memory transactions regard the two as the same 5 Different device ranges apply when using the AD51 with the AOJ2CPU See A0J2 Programming Manual _ _ 110 1B NA 661 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 1 3 Bit word specification a When a system subroutine has been called with bit processing specified one byte of AD51 memory is used per bit This is illustrated below the least significant bit indicates the state of the specified bit device for both reading and writing be Read B7 B6 B5 B4 82 B1BO B7 B6 B5 B4 B3 B2 B1 BO All turn to 0 B1 to B7 data is ON ignored 0 OFF 6 When a system subroutine has been called with word specified and bit devices are to be processed i e in batches of 16 devices then one word of AD51 memory is used per 16 bits This is illustrated below The head device number is X10 and state of this device is indicated by the least significant bit The states of the next 15 bits are stored in consecutive gee bits from Bit B1 to Bit B15 B15 B14 B13 B12 B11 810 BS B8 B7 B6 65 B4 B2 B1 IB 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 7 3 2 BASIC program examples Thi
99. ogram data inspection results and test results The AD51 includes an on board 24 hour real time clock with leap year compensation which allows data to be transferred by the BASIC program so that the time of the day data may be processed easily 2 Keyboard entry 3 Print out 4 Clock function VO console Printer RS 232C 1 2 IB NA 66189 1 INTRODUCTION MELSEC A 4 Data input from bar code reader etc The 051 allows data to be entered from the bar code reader magnetic card reader etc via RS 232C or RS 422 The AD51 can be matched with the protocol of the connected device for communication by the BASIC program 1 Entry of production lot number product name quantity etc 2 Collection of measured values test data RS 232C RS 422 device Bar code reader Magnetic card reader Punch card reader Mark card reader Measuring instrument 5 Connection of AD51 and external device The AD51 has one RS 422 and two RS 232C interfaces for 1 1 link with the external device and one RS 422 for 1 N multidrop link The application programs running in the AD51 allows data to be transferred via the four channels by the sequence program The following examples show 1 1 and 1 N link configurations of the computer and 515 computer P RS 422 interface RS 422 cable AD51 1B NA 66189 A 1 In the 1 1 link configuration RS 422 is used for distances up to 500m and
100. ons Arithmetic and logic unit Power failure compensation 3 1 IB NA 66189 4 PRE START UP PRO MELSEC A 3 2 instruction Set The AD51 is programmed in GPC BASIC In addition to the BASIC commands a series of subroutines are available which can be called from the BASIC program 3 2 1 GPC BASIC commands The following table lists the GPC BASIC commands For full information refer to the GPC BASIC Handbooks The graphics commands described in the GPC BASIC Handbooks are not available on the AD51 AUTO Automatic generation of line number BYE Returns to BASIC program address data screen CONT Resumes program run after BREAK COMPILE Compiles multitask executable program Deletes program from specified line number DELETE to specified line number EDIT Corrects statement in one line EXECUTE Run of program after RUN or COMPILE Key command Displays program on screen KEY G NEW Erases program RENUM Renumbers line numbers RUN Executes program Displays VO console Deletes line Resumes program run after stop and CONT Calls machine language program Clears CRT screen Program command Closes specified RS 232C RS 422 channel E Declares end of program run ND Repeats program run FOR to NEXT GOTO
101. orm e equipment 1 The maximum transmission speed from the AD51 is 9600 BPS the maximum receiving speed is 4800 BPS 2 When channel 1 has been set as I O console DIP switch 16 set to ON the AD51 operating system automatically sets the USART mode 4800 BPS even parity stop bit 1 character data 8 3 14 IB NA 66189 4 PRE START UP PRO MELSEC fA 3 5 2 RS 422 terminal block specifications CH2 Synchronous system Asynchronous system Baud rate setting 300 600 1200 2400 4800 9600 BPS selectable Parity absent Parity bit setting parity yer arty Stop bit setting 9 bi 5 haracter data E Data 7 bits bit setting Data 8 bits USART mode setting Terminal block pin outs Block rminal Signal Send data SDA EIS s C data outside C EI ES E fom outside data Signal ground SG Frame ground FG The maximum transmission baud rate from the AD51 is 9600 BPS The maximum receiving baud rate is 4800 BPS 3 15 IB NA 66189 A 4 PRE START UP PRO 3 5 3 RS 232C connector performance specifications CH3 and 4 mm Spem Console CH3 only computer with RS 232C interface personal computer 300 600 1200 2400 4800 9600 selectable Synchronous system Asynchronous system Baud rate setting 300 600 1200 2400 4800 9600 BPS selectable Parity absent
102. ory area and 8000 to 80FF cannot be used as a user area program area work area 2 After the system data is stored on ROM the RAM area of channel 4 can be used as a program area but that of channel 3 may only be used as a work area 3 With the system data transfer switch ON multitask is executed after the system data is transferred from 8000 to 80FF of channel 1 to the system data area 4F00 to 4FFFu at power on 3 13 IB NA 66189 A 4 PRE START UP PRO 3 5 Interface Specifications 3 5 1 RS 422 connector specifications CH1 mm meam E Connected Unit A6GPP printer with RS 422 personal computer etc Synchronous system Asynchronous system Baud rate setting 300 600 1200 2400 4800 9600 BPS selectable r Parity absent A Parity bit setting L parity present ud Aus bit 1 USART mode setting top bit setting Stop bit 2 Character data bit setting Data 7 bits Data 8 bits XON XOFF control ontrol with DTR terminal Block Signal Sont Diagram Pin Direction Remarks SDA D m Send data 2m SDB outside RDA Receive 330 pe data n outside RDB Data CSA ig Pil terminal ready outside Data set ce ready gen outside mg 25 Signal ground Connect pin 21 to the signal ground of the external equipment Communication control setting Connector pin outs Do not perf
103. p cabling should conform to the following specifications ______ meme 5 3 6618 6 51 PROGRAMMING NOTES MELSECAA 6 51 PROGRAMMING NOTES 6 1 BASIC Program Address Data The following information must be specified before a GPC BASIC program can be written program number program head address program last address additional program head address work area head address and channel For further details on setting the data refer to AD51 Operating Manual The following table indicates the function of each of the addresses Before the BASIC program be written a BASIC text area must be defined as well as an interpreter work area The operating system automatically asigns the additional program head address depending on how much of the BASIC text area is vacant __________ Additional program Head address of vacant area in BASIC text area head address Automatically set by the 0 5 Work area used for BASIC interpreter Fixed to 256 bytes Work area sad address Not available for user Channel for the BASIC text 1 Direct variables A to Z are allotted in the BASIC interpreter work area 2 Use the address range D000 to FEFF for array variables and indirect variables The hatched areas in the example below may not be used Example Channel 2 8000 to FFFF data has been set as follows 1 Program head address 8000 2 Program last address CFFF 3
104. port and clears both AD51 buffers at that port 3 The CLOSE command initializes the AD51 communication control and buffers in the same way as the OPEN command however in this case the port is left in a read write disable state Before using the CLOSE command ensure that the transmit buffer is empty be using subroutine STC Data will be lost if the buffer is initialized while it still contains data 4 OPEN and CLOSE commands are common to all tasks Therefore any channel opened by one task can be used in subsequent tasks without having to repeat the OPEN com mand 6 3 5 Z commands E The ZMOV ZRD1 ZRD2 ZWR1 and ZWR2 commands are not available for AD51 PC CPU transactions Access to the PC CPU data is via system subroutines For details refer to Section 3 2 2 6 8 IB 66189 6 AD51 PROGRAMMING NOTES MELSEC Al 6 4 Transmission Commands to External Device 6 4 1 PRINT command The PRINT LPRINT and SWB commands are used to transmit data from AD51 s RS 422 or RS 232C to the external device Any transmission command is complete when transmis sion data is stored to the transmission buffer Use system subroutine STC to check that the transmission data has been sent to the external device 1 The channel used is determined by the console channel set with DIP switch 16 or ZODV command 2 Data transmitted depends on the PRINT command designation form as descri
105. rn M PROTECT switch off ram set the M PROTECT switch to OFF Connect I O console to ADS1E Connect the I O console to channel 1 or 3 as selected with SW16 GPP HGP or PHP Start up console General purpose W O console Examine task configuration mem Software design ory assignment CRT indication and communication with PC CPU Programming Write program Write software onto disk Always keep a back up copy Set multitask Multitask setting System data stored onto ROM System data is transferred from System data transfer system data area to user area of channel 1 Write programs onto ROM Specify memory protect ranges and set M PROTECT switch to ON Complete IB 66189 4 PRE START UP PROCEDURES Leo MELSEC 4 4 2 Nomenclature For the setting switches refer to Section 4 3 RUN LED Extension memory card con 3 o nector Defines the memory used as Displays a 2 digit error code Lit during multi tasking combinations of RAM 8K as appropriate _ and 4K ROM For details refer to Section 4 3 4 TES RUN STOP key switch AE RUN STOP control switch for i multi task execution and gr INDICATOR RESET switch AD51 reset switch gH Resets error display 2n M PROTECT switch 0 Memory protect switch for ait P
106. rogram is running i e interrupt flag is ON will be ignored See area A in Fig 7 6 2 Only one task may be specified as interrupt start Setting any more generally leads to ORST error IB NA 661 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER MELSEC AA 7 10 Interrupt from AD51 to PC CPU System subroutine SIT causes the AD51 to interrupt the PC CPU and allows AD51 interrupt sequence programs to be executed The AOJ2CPU cannot be interrupted by the 051 The PC CPU has interrupt pointers 116 to 123 which are assigned to interrupt signals generated by special function modules in order of allocation For details refer to the CPU Unit User s Manual and Programming Manual In the system configuration shown in Fig 7 7 when AD51 No 1 interrupts the PC CPU the interrupt program designated by pointer 116 is executed When AD51 No 2 interrupts the PC CPU interrupt program 117 is executed 116 has higher priority Slot number AD51 Interrupt Location Pointer VO X10 X20 X30 X40 X60 X70 Y90 No 2 to to to to to to to to X8F XIF X2F X3F DX e ver Y30 Y40 Y60 Y7O to to to to YSF Y6F number x30 to XSF Y30 to Y5F Fig 7 7 System Configuration and Interrupt Pointers a IB 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 7 11 Remote RUN STOP of PC CPU The PC CPU can be
107. ror numbers in the order that they occured M PROTECT switch Memory protect for system data the data entered during multi task setting and BASIC programming and the user memory The memory protect range depends on the DIP switch settings on the front of the unit For DIP switch details refer to Section 4 3 4 3 IB NA 66189 A _ 4 PRE START UP PROCEDURES 2 Connector details 65 422 connector 2 RS 232 C IRS 422 Set DIP switch SW16 to use this port for programming with the pas Ee mer GPP HGP Set DIP switch 5 16 OFF to use this connector as a general m purpose port DES CH2 RS 422 terminal block 7 Th terminal block is provided for use in n the AD51 8 system maximum of 32 ADSI stations may included in the multidrop Uo nk E i This connector may also be used asa general purpose RS 422 port i CH3 85 2320 connector Set DIP switch SW16 OFF to use this port for programming with the VT 220 or GPP HGP set DIP switch sw16 ON to use this connector as a ene purpose ort IB NA 66189 _4 PRE START UP PROCEDURES MELSEC fA 4 3 Hardware Settings 4 3 1 Memory protect range The maximum user program memory capacity is 114K bytes 48K bytes for ROM 66K bytes for RAM 48K bytes of the RAM area may be memory protected in units of 8K bytes The system data area for multi task setting data etc may also be me
108. s 8 bits of data See below 87 B6 B5 B4 B3 B2 B1 BO B7 B6 B5 B4 B2 B1 BO rne sos os po eoa re coor ro reo oc oe ca eos o 7 13 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 2 Batch write to device memory SADW Program example 1 Program to write on off data to Y80 to Y9F from the AD51 as individual bits Switch on Y80 to Y8F Switch off Y90 to Y9F 100 A E800 110 0 FF HM 120 1 130 802 140 Y0080 150 C E807 160 C 0 32 170 C 1 E000 180 2 30 190 D E000 200 FOR 0 TO 15 210 0 1 220 0 14 16 0 230 NEXT I 240 2 0 807E 1 A 250 IF Z 0 PRINT ERROR Z GOTO 240 260 END 7 14 Head address for system subroutine IN PUT data Defines PC station number as host Specifies bit write Sets indirect variable head address Sets destination head device using char acter string variable Sets indirect variable head address Sets the number of points to be written to 32 Sets source data head address Sets time check period to 30 300msec Generates data to be written to addres ses E000 to Calls system subroutine SADW Check for errors in SADW execution IB NA 6618 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC 4 Program example 2 Program to write on off data to Y80 to Y9F from the AD51 as indiv
109. s D and R to be monitored for 1 point Monitor SADM1 Monitors the device specified in monitor data Table 7 2 System Subroutines and Functions Key indicates available When the 1 A2 E A3 E ATN 2 or A3NCPU is used half the number of points shown above is processed for device X When the 0 2 or A3HCPU is used there is no restriction like above ae ie i 1B NA 66189 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU 2 Valid device ranges for device memory transactions are given below The device range depends on the PC CPU module used See the corresponding CPU User s Manual Bit Devices Word Devices Tord Devic ______ Hexadecimal Hexadecimal internal relay M M0000 to M2047 Decima Data register D D0000 to D1023 Decimal Latch relay L 0000 to 12047 Link register W W0000 to WO3FF Hexadecimal Link relay B 80000 to BO3FF File register R R0000 to R8191 Decimal Step relay S 0000 to 52047 Special register D 09000 to 09255 Decimal Decimal Table 7 3 Valid Device Ranges Zs 1 Bit devices and word devices are differentiated as follows Bit device X Y M L S B F T contact T coil C contact C coil Word device T present value C present value D W R 2 When reading 16 consecutive bit devices as word data the bit device number must be a multiple of 16 3 The 0 in the most significant digits
110. s section gives some BASIC program examples which use system subroutines SADR batch read SADW batch write SADMO monitor data entry SADM1 monitor and SADT test The program examples use channel 1 For details of the system subroutines refer to the GPC BASIC Handbooks 1 Batch read from device memory SADR Program example 1 Program to read data from 16 points X100 to X10F to AD51 addresses E000 to EOOF as individual bits 100 AS 6 Head address for system subroutine IN PUT data 110 0 Defines PC station number as host 120 1 Specifies bit read 130 B 2002 Sets indirect variable head address 140 X0100 Sets head device to be read using acter string variable 150 FOOT Sets indirect variable head address 160 ClO 16 Sets the number of points to be read as 16 170 C 1 E000 nn Sets destination head address for data 180 C 2 560 Sets time check period to 60 600msec 190 Z CALL O 58078 1 A Calls system subroutine SADR 200 IF Z 0 PRINT ERROR Z GOTO 190 8 Checks for errors in SADR execution 210 END 1 When specifying the head device using a character string variable define the number of points to be read after setting the head device Reason The character string variable overwrites the bits at the end of the data with 0 This would delete the number of points data if this w
111. s sent which is more than one line long will lead to an overrun error when the LF code is given The receive buffer is 32 characters long See below 100 LPRINT ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF t 32 characters To overcome this write a comma after the PRINT statement to stop the LF code from being given as below 100 LPRINT ABCDEFGHIJKLMNOPORSTUVWXYZABCDEF 6 3 3 CRT display commands Any commands addressed to a CRT on a given channel should come from one task only There is no management of display commands between tasks CRT display commands CLS ZCON ZCOFF ZNOR ZCRV PRINT LOCATE POINT Any program controlling the display on one CRT should be written in one task only IB NA 6618 6 AD51 PROGRAMMING NOTES MELSEC AL 6 3 4 OPEN and CLOSE commands Note the following precautions when using the OPEN and CLOSE commands 1 The channel specified as that for the console by DIP switch SW16 and the channel selected for the printer on the printer setting screen are automatically opened by the AD51 OS The communication mode for other channels must be set in the user program using the OPEN command These two channels default to closed 2 The OPEN command is used to specify the communication control at the RS 232C or RS 422 port It also initializes the AD51 send and receive buffers Executing this command therefore re defines the communica tion mode for the specified
112. s source data head address Sets time check period to 70 700msec Calls system subroutine SADT Checks for errors in SADT execution NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU The data is stored in the AD51 in the following formats depending on whether bit or word has been specified Device name Data to be written Device name Data to be written Device name Data to be written Sets data to be written to 1 ON 0 OFF 7 18 Device name Data to be written Device name Device name Data to be written IB NA 66185 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC AA 4 Defining device numbers to be monitored Before a given device can be monitored using the SADM1 subroutine it must be specified and entered using the following procedure Program example 1 Program to specify the following bit devices for monitoring i e monitor data entry X7D Y201 M178 B3A0 T46 contact C85 coil 100 A Sets indirect variable head address 110 A X007DY0201M0178B03A0TSO46CC085 nnn BM Stas Odin Olea Dial Stores device numbers into work area 120 B E800 Sets indirect variable head address 130 0 Defines PC station number as host 140 1 HH Specifies bit entry 150 C E802 Sets indirect variable head address 160 C 0
113. specified channel Reads the number of bytes of data received by specified channel Reads the number of vacant bytes in receive buffer of specified channel SHX Controls send receive data of specified channel by Xon Xoff codes Controls send receive data of specified channel by DR terminal Converts all send receive data of specified channel to EBCDIC code No code conversion of send receive data of specified channel Reads the number of remaining bytes in send buffer of specified channel Reads status of specified channel Reads data from buffer memory Writes data to buffer memory Reads data from data memory of programmable controller CPU Writes data to data memory of programmable controller CPU Randomly writes data to data memory of programmable controller CPU Enters data randomly read from data memory of programmable controller CPU Channel Table 3 3 System Subroutine List Continue 3 7 804 eo BIN subtraction 24 bits 8051 UNE M BIN multiplication 24 bits 80544 80574 IB NA 66189 4 PRE START UP PRO E Umummuumam of programmable controtler CPU Reads sequence program Reads sequence program E cm muss CPU 0 Sow Saw rte programmatie coroner CPU INE RENE programmable controller CPU parameters H7 SIT Interruption to pregrammable
114. stem name specification Kana i e Japanese characters CANNOT USE KANA in the system name DISK FULL GPP mode FD capacity exceeded Insert new FD FILE NAME ERROR Invalid file name for file directory or delete function Correct 1 No FD in accessed drive 1 Insert FD FLOPPY ERROR 2 FD is write protected 2 Set FD write protect tab to OK 3 FD is defective 3 Change FD FLOPPY WRITE PROTECT FD is write protected Set FD write protect tab to OK IDENTICAL NAME The same file name exists Change the file name NO FILE Specified file is not on FD ROM ERASING ERROR ROM has not been erased Erase ROM data or use a new ROM 37 _ 1B NA 661 8 TROUBLESHOOTING Display Screen Description Corrective Action 1 Check ROM 1 ROM is wrongly or not loaded 2 Write several times Try again if ROM WRITE ERROR 2 ROM is defective data cannot be written change ROM SIZE UNMATCH ROM capacity is smaller than file lt GPP mode capacity Select appropriate ROM Invalid name has been specified The includes non SYSTEM NAME ERROR alphanumeric character or blank Correct or the first character is not a letter VERIFY ERROR Data unmatched Correct In BASIC a maximum of ten levels STACK ERROR Stack has been used outside the AD51 STOP sot afea of GOSUB or FOR NEXT instruc t
115. tem subroutine After this error message is displayed the battery has a further life of 65 days 1560 hours prre Guaranteed Value Actual Period Back up by battery 130 days 3120 hours 300 days 7200 hours Back up after battery error 65 days 1560 hours Preventitive maintenance guide 1 Change the battery after four years if the total battery back up time during that period has been a maximum of 130 days 2 For back up periods exceeding a total of 130 days in four years calculate the battery life as follows Assume that the power is off for 14 hours 5 days a week and all day for the remaining 2 days per week Under these conditions the power is off for 14 hours X 5 days 70 hours 24 hours X 2 days 48 hours 118 hours per week The total battery life is 3120 hours which at 118 hours per week gives 2 3120 26 4 weeks Approx 6 months Therefore it is necessary to change the battery every 6 months IB NA 6618 9 MAINTENANCE MELSEC_ A 9 2 Battery Changing Procedure 9 1 shows the battery changing procedure Insert new battery into holder and connect battery con nector Load 051 Switch on PC power Battery A6BAT Negative lead wire blue AD51 battery error indicated Battery fault To prevent the loss of program and latched data a capacitor is provided to give 11 minutes RAM back up during battery changes Fig 9 1 Battery Changing
116. tem subroutines are used by the AD51 to access the PC CPU device memory 1 System subroutine types and functions Number of points PC CPU State processed per PC CPU AD51 transaction Processing Reads data from bit device such as Y and M for sit 1 point 256 points SADR Reads data from bit devices such as Y and M for 32 words 16 points 512 points Word Reads data from word device such as 64 points for 1 point Bit Write data to bit device such as Y and M for 1 point Batch Writes data to bit devices such as Y and M for 16 10 words write SADW points 160 points Word Writes data to word device such as D and R for 1 64 points point Device Sets resets any specified bit device such as and memory Bit M and device number for 1 point 20 points Test i Sets resets any specified number of blocks of During SADT sixteen bit devices such as Y and M and device Keo write Word number for 16 points Writes data to any specified word device such as and and device number for 1 point 10 points Defines the bit device such as Y and M to be monitored for 1 point 40 points Monitor data entry Word Defines the bit devices such as Y and M to be monitored for 16 points 20 words 320 points Defines the word device such a
117. the AD51 checks the buffer if it is now vacant the original task is allowed to continue and if it is still full the AD51 will switch to a third task where used This checking and switching procedure will continue for 1 minute if the buffer remains full after which 1 byte of the excess data will be deleted The one minute cycle is repeated until there is no excess data left The 1 minute cycle time may be charged using the SWB system subroutine Possible causes of send buffer full error are as follows O The DTR signal from the external equipment Pin 6 of the RS 232C connector is low O X ON code is not received from the external equipment after X OFF has been received 8 5 IB NA 6618 8 TROUBLESHOOTING 8 3 Troubleshooting MELSEC This section gives simple 051 troubleshooting procedures For PC CPU troubleshooting refer to the PC CPU User s Manual 8 3 1 Troubleshooting flow chart YES CRT displays error message NO Indicator displays YES error code NO YES Error occurs at GPP HGP start up NO Error occurs during GPP HGP FDD operation YES NO Error occurs during AGGPP ROM operation YES NO YES Can multitask be executed NO YES CRT display corrupted NO YES Print out corrupted 8 6 Refer to error list Section 8 1 Refer to code list Section 8 1 See Start up troubleshooting S
118. tting range offset value 34 CH2 temperature setting range gain value 56x 57 35 CH3 temperature setting range 58 offset value B CH3 temperature setting range A gain value CH4 temperature setting range offset value BCH SD CH4 temperature setting range gain value SEn ore APP 3 w IB NA 66189 APPENDICES ADSI Butter Memory Assignment _ _ Preset value write lower ___82 gt O 2 Preset value write middle Preset value write upper Sea poer e ae 687 Present value read middle s Pesem vame etme _ _ Set value read write middle eo Set value read write upper kd CF 4 NA 661 APPENDICES MELSEC A 5 AD71 S1 positioning module Buffer Memory Assignment Address Specified from AD51 Address for FROM TO Instruction X axis positioning start data to 200 Error reset Y axis positioning start data Positioning Positioning Dwell time X axis positioning data Positioning address Positioning Positioning Dwell time Y axis positioning data Positioning address X axis parameter Y axis parameter X axis zeroing data Y axis zeroing data APP 5 IB NA 66189 A APPENDICES
119. ubroutines and functions mee 7 43 7 8 2 BASIC program examples SR Scale Seve Ee M eso eee bs T EE EV E Te ee VEO E VS 7 44 7 9 Interrupt from PC CPU to ADB1 ee nennen hne 7 46 7 10 Interrupt from AD51 to PC CPU wesessesessssHsotesoseaoteoeseoeveceevossecesocesveeceseveseseetevevescecene 7 47 7 11 Remote RUN STOP of PC n HHHHHHHHHH HHHeIHHHg 7 48 8 TROUBLESHOOTING eee eee ee ee eee eee ee eee eee ee ee ere ee er ree 8 1 8 12 8 1 Screen Error Messages ee ee eee ee eee eee eer eee ee ee corer ee eee eee eee eee rr rere 8 1 8 2 Error Code MISCERE 8 3 8 3 Troubleshooting 8 6 8 3 1 Troubleshooting flow chart eresesesossspvvesveepeveveneserveeospoecsrtoesossoseveseeeeeceeecoevoeceecceoos 8 6 8 3 2 Start up troubleshooting whesesss s eese ressesssesees sosothesoetossecessssaseosesopetesesoesosooeoone 8 7 8 3 3 FDD troubleshooting sesusesssessessesesessonsosestevoeseceesossesossoececeoeresosoetbesteovereevevesos 8 8 8 34 ROM troubleshooting 8 9 8 3 5 Multi task troubleshooting oe eee ee eee eet ee eee eee eee eee eee eee ee eer 8 10 8 3 6 CRT troubleshooting eee ee eee eee eee eee eee eee eee eee eer re rrr 8 11 8 3 7 Print out troubleshooting CON nnn Onno nnn nnn nnn nnn nit nt int niet tnt nt tt htt hit int ii iii itty 8 12 9 MAINTENANCE ee ee ee eee ee eee eee eee eee eee eee ee eee eres 9 1 9 3 9 1 Battery LifOccrsset cere e creer E
120. uts Read ON OFF data of general purpose inputs from user memory addresses given in Section 7 1 1 Logical OR operation with appropri Logical operation with ate bit of dummy byte set to 1 appropriate bit of dummy byte set to O Write to general purpose input area 1 i7 7 7 When general purpose I O data is re quired for use in the work area Completion 7 3 IB NA 66189 A 7 COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU MELSEC Program example Inputs X13 and X1B are turned on and off respectively and the resultant on off condition is stored in head addresses 6000 and 6001 1 2 Program to switch on X13 100 A PEEK 6000 Reads address 6000 from the common area This byte is all 0 5 110 B A 08 ere Executes a logical OR operation with address 60001 and a dummy byte containing the binary representation of 8 as follow Bit pattern Address 6000 00000000 8 00001000 OR result 00001000 The result is written to variable B 120 POKE 6920 Variable B is written to address 6920 i e the user work area reserved for accessing the gener al purpose I O 130 POKE 6000 B The result is also written to address 6000 140 END Program to switch off X1B 100 A PEEK 5 6001 Reads address 60014 from the common area This byte is all 0 s 110 F7 eee Executes a logical AND operation with address 60004 and a du
121. vice The data device ready signal is switched off to stop the transmission b The terminal ready notice signal is switched off when the empty area of the receive buffer has become 7 bytes or less The terminal ready notice signal is switched on when the receive buffer empty area increases to 32 bytes or more after the receive command INPUT INKEY SRB is executed in the user program 3 10 2 Xon Xoff control Performs communication control using the Xon code 111 and Xoff code 13 a Transmission is stopped when the Xoff code is received during transmission of data from the transmission buffer to the external device Transmission is resumed when the Xon code is received b When the receive buffer empty area is reduced to 7 bytes or less the AD51 sends the Xoff code to alert the external device to receive disable The AD51 sends the Xon code to notify the external device of receive enable when the empty area increases to 32 bytes or more after the receive command INPUT INKEY SRB is executed in the user program 3 20 SS ea IB 6618 4 PRE START UP PROCEDURES 4 PRE START UP PROCEDURES 4 1 General Procedure 51 system start up Connect battery FERAM data support and real time AD51E 2 The memo map depends on eating Set RAM ROM p RAM ROM assignment Select I O console channel and mul Set DIP switch tidrop terminal resistance Before writing or correcting a prog Tu
Download Pdf Manuals
Related Search
Related Contents
PR® 12D - Peavey Uni-Trend UT60A multimeter Portable Multi-logger "user manual" User Manual - Airlink101 LOGIQ P6 Pro Franklin Brass D2416W Installation Guide HEINE Finoff-Durchleuchter HEINE Finoff transilluminator Sentry360 FS-IP5000-M surveillance camera Copyright © All rights reserved.
Failed to retrieve file