Home
5 - GE Intelligent Platforms: Support Home
Contents
1. A COMMREQ arrived Print the data size and then the data The data is shown as bytes in hexadecimal format B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Print COMMREQ data size CMRQ_DATA_SIZE bytes Print COMMREQ data For 1 1 to CMRQ_DATA_SIZE Print 382 asc CMRQ_DATAS I Next I Print Print KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Signal the PLC CPU to send the next COMMREQ NEXT_CMRQ is SYSLINKed and UNLINKed each time through the loop the CPU could use a different status register for each COMMREQ 3 ck ck KK k KK kckck k ck k If STAT PTR gt lt then SYSLINK NEXT CMROS STAT PTR UINT SYSWRITE NEXT CMROS UNLINK NEXT CMRO Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 80 5 81 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK This procedure handles the BKP_MSG interrupt Process messages until no more are available x KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK proc USER_BKP_MSG_PROC Rem Rem Rem Rem Def Local T Rem Type Index Local O Rem Offset Index PROCESS MESSAGE CMRQ HDR C
2. ck ck ck ck Rem ck SEND HDR chr 0 2 Rem initialize message SEND HDRS 8 chr 0A0h Rem message type SEND TXT abcdefghijklmnopqrst SEND UNSOLICITED MSG SEND HDR SEND TXT S Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 88 5 89 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Repeat forever while messages arrive KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Rem Rem Repeat KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK This procedure handles the BKP_MSG interrupt Process messages until no more are available 5 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK proc USER_BKP_MSG_PROC ext Rem Rem Rem Rem Def Local MT Rem Message type Local ER Rem Message error Repeat PROCESS MESSAGE RCV HDR RCV_TXTS If RCV_HDRS then Return MSG COUNTS MSG COUNTS 1 KK KK KKK ck k KKK KKK Ck CK There is a message Put the message type into MSG_TYPE 8 Is the message from the PLC CPU Check the message type for Hexadecimal values 82 83 94 002 003 001 and
3. kk If MSG TYPES amp 10111111b 94h or MSG TYPES OD1h then Print 8 PLC generic response message arrived KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Is the message a COMMREQ Note that the CPU uses the MSG TYPES values 82 83 0C2 and 0C3 hexadecimal only for COMMREQs All four values are detected with one If statement by ignoring the bits which vary B ko ko ko ko ck ck Else If MSG TYPES 6 10111110b 82h then Chapter 5 Advanced MegaBasic Programming GFK 0255K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK 910 The message is a COMMREQ It is assumed to be a NOWAIT id 920 mode COMMREQ Put the data size into CMRQ DATA SIZE If B 930 there are 12 data bytes or less there is no way to know the 940 exact data size unless it is included in the COMMREQ data 950 itself 960 Next copy the COMMREQ data to CMRQ DATAS B 970 ck
4. CMRQ_HDRS 32 Dim CMRQ_TXTS 256 CMRQ_DATAS 256 Dim STAT PTR 8 Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Throw away messages already in the backplane queue Sk ko ko ko ko ko ck ck ck Rem ck Repeat PROCESS MESSAGE CMRQ_HDRS CMRQ_TXTS If CMRQ HDR then Exit ext Rem Rem Assign USER MSG PROC to the BKP MSG interrupt Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Interrupt BKP_MSG end Interrupt BKP_MSG USER_BKP_MSG_PROC Interrupt BKP_MSG on Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Initialize the NEXT_CMRQ as the PLC signal Then wait for Rem COMMREQs in an endless loop ko k ko k ck ko k KKK k kk Rem EXT 080 1 Repeat If CMRQ_RCVD lt gt 0 then CMRQ_RCVD 0
5. ole oe Sk ole oo E ERROR RR e oe oe oe eK OE SK OK RA IR AA ole eoe oe OO EK De OR OK E OK e oe o AKA KEY Delay the first COMMREQ 5 sec 5171 is guaranteed to be off when the PLC transitions to RUN mode i SEEK oS ON SE UE OON EUR MAB EON DEOR DE OR EON DEOR OE OR ORAM EON EON OE OR EK CREB DON OMAR OE OK OON DEOR E OE DOR RON AR OE o E ok RAR CRY gt gt RUNG 8 lt lt T00001 T00001 1 1 TMR S 1 008 CONST PV CV 00005 2 01 gt gt RUNG 9 lt lt T00001 Lr NE UINT T00002 5200107 11 QI MOVE C UINT T00003 CONST 2 CONST IN 00 0107 0 i3 0 00000 LEN 00001 CONST 0002 CONST 00000001 RUNG 10 COMFLT COMMENT RRA ok oleo RK ok ole AKA AE oce oce KK KK koe koe ok ole sk oke koe ok oe sk oe ok oe ok ok ole RR KR AK KR Kok ok ok KR KR KK KR KRY Additional rungs should be added to recover when the COMMREQ FT output becomes active or when the PCM posts a fault to the PLC fault table 5 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK END OF PROGRAM LOGIC Program EXAMPLE C LM90 EXAMPLE GFK 0255K Chapter 3 CCM Operation 3 27 Section 7 PLC System Communications Window
6. 0 eect eee ene eens C 2 Notation Conventions 111001 n C 3 Commands c ur 0 0 00000 C 3 Q executea batch file C 4 B configure LEDs ciere A eaae a ek les C 4 G Clear the PCM 5 tu heat dee ben RRREEMRRO REISEN C 5 D tileDirectory meme Ree ea chem C 5 F show Free memory sssssssse cece eens C 5 G Get hardware ID 0 cee eens C 6 H get PCM firmware revision number 000 e eee eee C 6 I Initialize device reiro censa C 7 T format EEROM device Darre EREE ce cece eee C 9 K Killatask used eee ee ee e ce eb oe e doa C 9 L Eo d orreri eee rotto ed ei ete PE C 10 M create a memory Module 6 66666 6666266 666666666660600 C 11 7 C 11 P request status data 0666 C 12 Q set protection level 0 eee eee C 13 RY RUM erene usps ete me E ME E E a mite d C 14 S Save ceca eR etel E ade ees ad C 15 U reconfigure 9999 C 15 tet t E C 15 Verify a tile WE Wait erroe re LTD ere Et ea C 16 C 16 Y set upper memory limit 666666666666666 660606000002 C 17 xii Series90 Programmable Coprocessor Moduleand Support Software User s Manual N
7. PROGRAMMABLE COPROCESSOR MDL HELP ALT H for Serial Port Restrictions Config Mode CCM ONLY Battery Req YES CCM Enable YES CCM Enable YES CCM Mode SLAVE CCM Mode SLAVE Interface RS232 Interface RS232 Data Rate 0 Data Rate 0 Flou Contrl NONE Flou Contrl NONE Parity ODD Parity ODD Retry Count NORMAL Retry Count NORMAL Timeout LONG Timeout LONG Turnf Delay NONE Turn Delay NONE CPU ID 1 CPU ID 1 D LMSO LESSON imt ONFIG VALID REPLACE 2 8 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 3 Toenter a Memory Expansion board for Series 90 70 systems only press Expansion Board F9 and then Memory F1 The following list is displayed DELETE l CUN o ONERE IT gt SERIES 90 70 MODULE IN RACK 1 SOFTWARE CONFIGURATION Catalog CATALOG DESCRIPTION TYPE 1 1IC697MEM 13 MEMORY 64 KB CMOS EXPANSION EXPMEM 2 1069711715 MEMORY 128 KB CMOS EXPANSION EXPMEM 3 106971121717 MEMORY 256 KB CMOS EXPANSION EXPMEM 4 IC697MEM719 MEMORY 512 KB CMOS EXPANSION EXPMEM lt lt CURSOR TO THE DESIRED CATALOG NUMBER AND PRESS THE ENTER KEY lt lt gt gt PRESS PGDN KEY FOR NEXT PAGE PGUP KEY FOR PREVIOUS PAGE lt lt 1 BUENE imt ONFIG VALID REPLACE 4 Cursor to the desired catalog number and press the Enter key 5
8. ID values Table 5 12 Message Type Rack Slot and ID Values Value of MSG TYPE Data in Decimal MESSAGE TXT Source of Message 130 The PLC CPU senta COMMREQ messagefrom RACK 0 SLOT 1 131 and ID 9 For moreinformation on COMMREOQ messages see Interpreting COMMREO Messages in this section 194 195 148 A genericrequest message completed successfully This completion 212 acknowledgment message from the PLC CPU came from RACK 0 SLOT 1 and ID 7 209 A genericrequest message failed This PLC message came from RACK 0 SLOT 1 and ID 7 128 191 If MSG TYPE is not one of the specific Inclusive Inclusive valueslistedabove abackplane message was received from another PCM or Series 90 smart module 192 255 CO FF No The RACK and SLOT values contain Inclusive Inclusive the physical location of the module which sent the message and the ID valueidentifiesa particular process within the module Forinformation on sending messages to another PCM see Sending Backplane Messagesto Another PCM in this section The next MegaBasic example program shows how to distinguish between COMMREQ messages and the response messages returned by the PLC CPU when the PCM sends a generic request message It is used with the REG CRQ ladder program shown earlier in this section In line 90 the GENERIC PGM package is accessed from the PCM RAM Disk GENERIC PGM must be saved to RAM Disk before the example program
9. ORTE ERA 5 46 READ PEC FPAULT BIT eua ERREUR ep ARR EUR e 5 48 ODED TTY INTE 22e ttc rote eoi rte eto eres 5 49 Section 6 Loading and Storing PCM Data Files Using TERMF 5 50 1 Load erkancmRRiercGmGO Ges bis EST M ERISSUGSd 5 5 S Save i buie 1 vetu e bea dpa ud mos 5 5 D file Directory incase ck dita te teed eee Raed ayy eo and end Pobre mn ets 5 51 X eXterminate file gt epe ze gree eR E NET ET S 5 5 Section 7 Serial Port Setup with IOCTL and PORT CTL BIN 5 52 Serial Port Setup with IOCTL 2222222200 5 52 Serial Port Control Using PORT CTL BIN 5 55 Section 8 Timers and Logical Interrupts 5 57 Timer Interrupts gt 2 te eO DH eo dc qv e dh 5 59 Backplane Interrupts ssssessssseseeeeee eee 5 60 x Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Contents Section9 COMMREOS and Other Backplane Messages 5 64 PROCESS MESSAGE 568662011 666666666666666 666666666600002 5 64 Using the BKP_MSG Interrupt 6 666666666 666666666666660 e 5 66 Interpreting COMMREO Messages 666626666666 666666666660009 5 67 Programming the PLC COMMREO Function Block 5 68 Format of the COMMREO Instruction 006666626666666 666066666000 5 68 MegaBasic COMMREO Command Block 00 cece eee ee 5 71 MegaBasic COMMREQ Example sssseeeeeeee 5 72
10. Internal Command no communications across the serial port Only the slave half of the Q Sequence is supported by Series 90 CCM The Q Response may be set via command 6001 and the slave will respond to a Q Sequence Enquiry received from an external device on the serial port For a description of the Q Sequence refer to pages 4 18 through 4 21 in GEK 25364 3a Data bytes 1 and 2 3b Data bytes 3 and 4 3 20 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 3 21 Table 3 11 COMMREQ Data Block for CCM Commands Explanations for Table 3 10 Description The COMMREO data block begins at the seventh word address 6 of the command block and consists of up to six contiguous words of memory starting at this location To execute a transfer of data between CCM devices one CCM device must request the transfer and the other must comply with the request The device requesting or initiating the transfer is the source the device complying with but not initiating the request isthe target Data may flow from source to target as well as from target to source The Target ID is the identification number of the target device for Series 90 CCM itis the CCM CPU ID number Each PCM port can be configured with a different CPU ID number This number can beassigned using the Logicmaster 90 configuration package Refer to chapter 2 section 2 Configuring the PCM with Logicmaster 9
11. MegaBasic Features Not Supported by the PCM Background processing and network support are not provided by the PCM version of MegaBasic nor is debug mode screen switching The time and date may be read but not changed since clock synchronization is maintained with the PLC CPU Also there are no environment string processing routines for the PCM version of MegaBasic In addition the following statements and functions are not supported in the PCM Command Description Rename Change the name of a file DOS with parameters Execute OSshell level command from the user program Param 2 Param function which resets the disk drive Filedate Return date file last modified Filetime Return time file last modified Dir Display or change currentdirectory Subdir Returnsubdirectory names in a directory Envir Access DOS environment strings Ioctl Test if device supports IOCTL strings Space Return disk space Free Retum a portion of memory to the operating system The IOCTL function can be used to send a configuration string to the PCM serial ports COMI and COM2 as described in chapter 5 Advanced MegaBasic Programming but it cannot be used for any other device Furthermore IOCTL cannot be used to return input strings from any device The DIR command can be used to display the directory contents of various PCM devices but it cannot be used to change the default directory Type DIR to display the PCM s RAM director
12. PIN PIN N 2 3 RD 3 2 TD 4 CTS 5 l 20 DTR PCM 8 nese 8 DCD E gt 20 e 1 SHLD 7 7 GND 25 PIN 25 PIN 25 PIN 25 PIN MALE FEMALE MALE FEMALE Figure A 7 PCM to Workmaster Il Computer or 25 2 Computer Connect the cable s 25 pin male connector to the top serial port female connector on the front of the PCM Then connect the cable s 9 pin or 25 pin female connector to the male 15 232 connector serial port on the selected programming device For more information on these cables refer to the Series 90 70 Programmable Controller Cables PCM to Programmer Data Sheet GFK 0359 A 6 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 85 232 Cables Typical cable wiring for many PCM 165 232 applications is shown in the following illustrations a44245 PIN PIN TD 2 2 li 3 8 Lf m RD 3 NT ES 2 TD 0 PCM BIS 4 8 000 0 9 PCM PORT T 2 DTR 10R2 6 oo 2 DCD 8 ET 4 RTS 0 DTR 20 5 0 GND 7 7 GND Fe 0 SHLD 1 1 suo 0 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE MALE FEMALE Figure A 8 PCM to PCM with Hardware Flow Control RS 232 only 000 PIN PIN e 7 0 w 0 TD
13. ko 980 Print a COMMREQ message arrived 990 CMRQ RCVD 1 000 If ROV TXTS then 010 CMRQ DATA SIZE 12 020 CMRQ DATAS RCV_HDRS 21 12 030 Else 040 CMRQ DATA SIZE len RCV_TXTS 050 CMRQ DATAS RCV TXT 1 CMRQ DATA 512 060 070 080 Next 090 Proc end Backplane Messages to Another PCM A MegaBasic program can send backplane messages to the MegaBasic program in another PCM There are two steps the sending program simply constructs a message in a string variable Then the message is sent by calling the SEND MESSAGE procedure from the MegaBasic PCM extensions The final example in this section shows how to do it No PLC ladder program is used This example clears the backplane message queue and installs the USER BKP MSG PROC procedure just as in the previous examples Then it waits five seconds at line 340 Waiting assures that when two PCMs run this same program at about the same time with suitable changes to the message destinations neither one will send a message before the other is ready If you have two PCMs try it In lines 400 440 a backplane message is initialized and then sent by calling procedure SEND UNSOLICITED MSG The destination rack slot and ID passed to SEND UNSOLICITED MSG are the address of MegaBasic in the PCM where this program will run The message type E0 hexadecimal 224 decimal was chosen to avoid conflict with PLC CPU messages and to be consiste
14. ko Sk 0002 gt gt MOVE MOVE INT INT l l l l CONST IN Q R0001 CONST IN 0 0 00000 LEN 00001 LEN 00001 00001 ONCE EK ERE ER ER ERE KEKE KERB KEK DIS rst COMMREQ 5 0 Sec 5120001 is guaranteed to be off when sitions to RUN mode KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KK KKK ko C NLM90NREG CRQ START OF LD VARIABLE D BLOCK DE START OF P KU 6 Initialize t its status 1 ck ck kk ck gt gt RUNG 5 STEP FST SCN qe CONS 0 CONS 0 60 8 CONST 9 CONST 0 CONST 0 CONST 4 KKKKKKKKKKKKKK Delay the fi the PLC tran KKKKKKKKKKKKKK Program REG_CRO Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 78 5 9 02 20 92 15 46 GE FANUC SERIES 90 30 90 20 DOCUMENTATION v3 00 Regulating MegaBasic COMMREQs lt lt RUNG 7 STEP 0007 gt gt T0001 TMR 105 0 B CONST PV 00050 SROOO1 Ke one ER one 1 1 1 1 1 1 ERR RR AR RARER 5 oe 5 oe 5 55 RR RR RE RRR RR RR RR RR RR RR After the initi
15. CONNECTED ONLY ON PCM s AT THE Figure A 20 PCM or Host Computer to Multiple PCMs 4 Wire Multidrop Note If the PCM is configured for no flow control the jumpering of 5 is not required END OF LINES GEK 0255K Appendix A PCM Cabling Information Appendix Resetting the PLC from a PCM Program b PLC programs can reset any PCM CMM ADC or GDC module by sending a backplane message from a COMMREO function block The reset message produces exactly the same effect as switching PLC power off and on or pressing the module Restart Reset pushbutton for less than five seconds However if the module watchdog timer expires causing the OK LED to go off the reset message will have no effect The COMMREO function block SYSID parameter must be programmed to send the message to the rack and slot where the target module is installed The TASK parameter must be 127 decimal 7F hexadecimal The COMMREO command data block must be initialized as shown below Note that there is never a return status the COMMREQ must be sent in NOWAIT mode COMMREO Data Block Field Value Length 2 WAIT NOWMAITFlag 0 Ignored Status Pointer Memory Type 0 Ignored Status Pointer Memory Offset 0 Ignored Idle Timeout Value 0 Ignored MaximumCommunicationTime 0 Ignored ResetStatus Value 0 Ignored Reset Command Value 4320 Hexade
16. Series 90 CCM memory addressing conventions 3 7 Series Five vs Series 90 CCM memory types 2 3 Series One vs Series 90 CCM memory types 5 3 service request SVCREQ SVCREQ example 3 30 SVCREQ FNC parameter 3 28 SVCREQ PARM parameter system communications window3 28 target memory types 3 2 target sourcememory addresses 3 7 WAIT mode 3 12 CCM status word 3 18 CCM PROG configuration mode CHECK command 4 8 4 9 GFK 0255K BINARIES DOC F 1 BITFUNCS ASM F 1 BITFUNCS BIN 5 50 F 1 BKP_MsG 5 34 5 60 5 61 5 76 5 77 BKP XFER 5 60 5 61 BLINK 5 7 BOLD 5 7 BREAK_OFE 5 55 BREAK ON 5 55 BREAK STATUS 5 55 inicr gpace exceeded error code 120 5 4 Bus receiver module BRM 2 3 Bus transmitter module BTM 2 3 BYE command 5 50 BYTESWAPBIN 5 50 0 C Clear the PCM command C 5 C DN 57 C_LE 5 7 6 Rr 5 7 C UP 7 Cable and connector specifications Cabling A 5 connecting the PCM to the programmer 2 32 RS 232 cables RS 422 RS 485cables A 10 Cabling information PCM A 1 Catalog numbers for expansion memor boards for the Series 90 70 PCM Catalog numbers for Series 90 30 PCM ha CCM COMMREQ data block 3 19 CCM COMMREQ example 3 25 CCM COMMREO status word 3 23 CCM comparisons CCM data Tx Rx failure 6 7 Index Index 2 Index MegaBasic COMMREO command 100 5 71 MegaBasic COMMREQ example 5 72 ra type
17. The COMMREO target ID is invalid Genericmiscellaneouserror Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 Error Code Decimal Hexadecimal 0C OE c A A A A A oo A 1A 1 1E 1F 22 30 41 N 44 45 46 47 7F 11 12 13 14 15 20 21 22 23 24 25 26 29 30 31 34 48 65 66 68 69 0 71 127 3 4 Section 6 CCM COMMREQ Example This example shows a complete PLC ladder program which sends CCM COMMREQs to the PCM The program was developed for Series 90 70 PLCs but it can be used with Series 90 30 PLCs by removing the OK output from the COMMREO function block in rung 9 On the first scan the data for the COMMREQO command block and data block is initialized using the two BLKMOV functions in rung 5 The command block is in R00050 R00055 R00050 the data block length is 4 since the CCM 6110 command requires 4 words of data 61100051 contains 0 for NOWAIT mode The CCM status word is returned in 701500107 since 701500052 is 8 for R memory and 701500053 5 zero based offset 106 R00054 and R00055 are ignored in NOWAIT mode and are simply initialized to zero The data block begins at 61600056 The first word in the data block is the CCM command 6110 single bit write This command requires three additional words of data moved into R00057 R00059 target
18. illegal backplane operation 117 illegal NOWAIT I O operation 119 5 4 improper variable type 114 insufficient memory 103 5 3 invalid IOCTL string 122 5 4 missing argument 100 not enough timers 107 PCM hardware not present 106 remote variable unknown 104 serial port framing 126 5 4 serial port multiple 127 serial port overrun 125 serial port parity 124 task not active 109 too many remote variables 105 5 3 undefined local variable 113 example program exiting from MegaBasic 5 50 exiting the MegaBasic interpreter 4 6 extensions developed by GE Fanuc 4 2 fault table header records Index 9 Local RAMJ1 9 1 11 Logicmaster 90 software 2 6 adding a memory expansion board to the Series 90 70 PCM 2 9 adding a PCM to the rack screen 2 8 6 for the Series 90 30 PCM 1 13 autoconfig of the Series 90 30 PCM D 18 config mode 9 configuration data 9 configuration modes and the PCOP display 2 17 configuration problems 6 8 default configuration for the Series 90 30 PCM 1 13 2 18 I O configuration rack screen PCM configuration modes 2 10 Series 90 30 PCM plug and go operation 1 15 218 Loss of characters 6 6 M create a memory Module command C 11 Maximum communication time 5 71 MBCRC PGM F1 MDE module delete command 0 MegaBasic 4 1 access to PLC fault tables and PLC status 5 21 accessing P 1 and 8
19. is supported only by the Series 90 70 PCM and only for 19200 or 38400 155 422 or 155 485 port configurations PARITY Specifies the type of parity checking Odd Even or None DATABITS 70r8 Specifies the number of data bits per character Use 8 unless text with 7 bit characters will be the only data transferred STOPBITS 1 2 Specifies the number of stop bits per character The normal selection for 300 baud and higher is 1 FLOWCTL H S orN Specifies the flow control method Hardware CTS RTS Software X ON X OFF or None With Hardware flow control RTS is turned on when the port is ready to transmit Then transmission begins when CTS becomes active RTS remains on until the TURNOFFDELAY expiresafter thelast character is sent With Software or Noneflow control RTS is not turned on and transmissionbeginsimmediately Defaultselection Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 52 PHYSICAL 232 422 or 485 Specifies the physical connection protocol for the port RS 232 RS 422 or 145 485 RS 422 is equivalent to RS 485 All Series 90 30 PCMs support RS 232 only on COM1 IC693PCM300 sup ports RS 422 485 only on COM2 Invalid selections are ignored Specifies the type of physical connection 2 half duplex 2wirefor RS 422 485 4 full duplex 4wirefor RS 422 485 P point to point Availablein PCM firmware version 3 00 or later In point to
20. mask The port number parameter specifies the serial port 1 or 2 where errors will be masked The mask parameter contains a set of bits to specify the errors that will be masked 0010H Parity error mask 0020H Overrun error mask 0040H Framing error mask For example 0010H masks parity errors only 0050H masks both parity and framing errors 0070H masks all three Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 56 Timers and Logical Interrupts Using the interrupt handling capabilities in MegaBasic can result in programs with superior response time to external events Note Logical interrupt handling in MegaBasic is described in chapter 9 Advanced MegaBasic Programming Features of the MegaBasic Programming Language Reference Manual GFK 0256 Because the interface between MegaBasic and the PCM operating system relies heavily on MegaBasic logical interrupts it is important that you read this chapter before using any MegaBasic interrupt instructions The MegaBasic language supports 32 software interrupts Of these 8 are reserved for the PCM operating system 16 for user programmable timers 2 to indicate activity on the PCM MegaBasic program s standard input and output channels 1 for communication timeouts 2 for asynchronous reads and writes and 2 for backplane communication The remaining interrupt may be defined by your application program The
21. 1 REFERENCE NICKNAME REFERENCE DESCRIPTION 000099 RO0001 500001 FST SCN Program PCMDEMO C NLM90NPCMDEMO Chapter 5 Advanced MegaBasic Programming 5 111 GFK 0255K 0 01 36 GE FANUC SERIES 90 70 DOCUMENTATION v2 02 gt gt RUNG 7 lt lt MOV IN CONST 2 800020 CONST CONST IN 0 1 00003 0000 00002 LEN 00001 CONST 0039 0039 E T CONST CONST 00024002 00024000 END OF PROGRAM LOGIC REFERENCE NICKNAME REFERENCE DESCRIPTION R0O0001 R00020 Program PCMDEMO C NLM90NPCMDEMO 5 112 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Rem This program displays data from Series 90 70 PLC on attached terminal Rem Access VT100 Dim integer PLC DATA 20 Rem Array for manipulating data Def integer DPR OFFSET Rem 8086 style offset Def integer FLAG OFFSET Rem 8086 style offset Def integer DPR SEG Rem 8086 style segment Rem Clear the screen and print a banner Rem CLS CUR 5 25 Print DISPLAY OF PLC DATA VALUES Rem Get physical address of buffer and convert to segment offset Rem DPR SEG 0A000h FLAG OFFSET 4000h DPR OFFSET FLAG OFFSET 2 Rem Set flag to start transfers and start processing data Rem Fill SEG FLAG OFFSET 1 Repeat While exam DPR SEG FLAG OFFSET 1 Next Rem Check flag For
22. 1 Rem Rem Repeat SYSREAD REG ARRAY Rem Read PLC registers and display them For 1 0 to 7 CUR 9 1 27 Print 5 SR 5I5 BASE REG 4I ATTR REVERSE Print 45 51I5 REG ARRAY I ATTR ext I This is the main processing loop for the register menu Rem Check for input and process if necessary Note that the Rem Input commands used below will cause the display to freeze Rem while the operator is entering data It is possible to handle Rem operator input using the inchr statement or with NOWAIT READs Rem of the keyboard however a fairly complicated state machine Rem would have to be used to figure out what to do when each key Rem is struck Rem EYS inchr 5 1 0 0 Case begin on KEYS Case 1 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 4 30 720 Rem To display new registers first UNLINK with 730 Rem the old registers and SYSLINK with the new ones 740 Rem The SYSREAD at the top of the loop will then 750 Rem read the registers from the new location 760 Rem 710 Print 5 CLR CMD LINES 780 Input 5 NEW REGISTER TO DISPLAY BASE REG 790 UNLINK REG ARRAY 800 SYSLINK REG ARRAY R str BASE 6 515 UINT 810 Print 5 CLR CMD LINES 820 Print 5 CMD LINES 830 Case 2 840 Rem To write a register SYSLINK with the register 850 Rem which is to be written and do a SYSWRITE to write 860 Rem the data Since the
23. Finally here is the example program which sends backplane messages between PCMs Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem This example sends two backplane messages to itself One Rem has less than 16 bytes of data the other has more than 16 Rem Try modifying the program to send messages to other modules Rem and non existent modules or IDs Rem Rem Rem This program uses the MegaBasic bitwise AND operator the binary shift left operator lt lt and the binary shift Rem right operator gt gt Note that variables used as operands Rem for these operators MUST be defined as integers They are Rem available in PCM firmware version 2 50 and later Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Dim RCV_HDRS 32 Dim RCV_TXTS 256 Dim SEND 585 32 Dim SEND TXTS 256 0X F F F X Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Throw away messages already in the backplane queue Sk Rem Repeat PROCESS MESSAGE RCV HDR RCV TXTS If RCV_HDRS then Exit ext Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Assign USER_BKP_MSG_PROC to the BKP_MSG interrupt x Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
24. Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 70 5 71 MegaBasic COMMREQ Command Block The format of the command block is shown below Length address word 1 Wait NOWaitFlag address 1 word 2 Status Pointer Memory address 2 word 3 Status Pointer Offset address 3 word 4 Idle Timeout Value address 4 word 5 MaximumCommunicationTime address 5 word 6 address 6 word 7 Data Block to address 133 word 134 Parameter Description Length The length in words of the application specific data block is the first word in the command block The data block may contain from 1 to 128 words 2 256 bytes of data to be sent to a MegaBasic program on the PCM The length and content of the data are determined by the user The application could for example send the PCM a single word with bits set to enable certain operations on the PCM This would be similar to the control byte in the Series Six ASCII BASIC Module except that 16 bits are available instead of eight Alternatively the PLC could send a 256 byte block of data for the MegaBasic program to process Wait NdWait The Wait NOWait flag should be set to 0 NOWAIT mode While 1 WAIT Flag mode can be used with MegaBasic programs NOWAIT modeis strongly recommended Status Pointer The status pointer specifies the PLC memory location where the PCM programshould return status information Unlik
25. Specifies the typeahead buffer size in characters for the port The port can accept up to one less than this number of characters withoutoverflow before an application reads the port When overflow occurs any additional characters will be lost Any size in the range 64 32750 bytes may be specified but the maximum may be limited by availablesystemmemory Availablein PCM firmware version 3 00 or later DUPLEX 2 4 or p MODE TURNOFF 0 65534 DELAY Default 0 TABUFSIZE 64 32750 Default 320 Defaultselection Any ofthe IOCTL parameters may be omitted If omitted the current value for the parameter is used When a parameter is omitted from the middle of the string the surrounding commas must remain to mark its place For example these statements Open 5 COM2 Ioctl 5 9600 Chapter 5 Advanced MegaBasic Programming 5 53 GFK 0255K set the COM2 port to 9600 baud and HARDWARE flow control with whatever other parameters are currently assigned This statement restores the PCM default settings to the port opened as channel 5 Ioctl 5 19200 N 8 1 H 232 4 0 320 The default physical protocol is RS 232 except for the IC693PCM300 module which can have RS 485 only on port 2 Also note that the physical protocol setting RS 232 for port 1 on the IC693PCM300 IC693PCM301 and IC693PCM311 modules cannot be changed Series 90 Programmable Coprocessor Module and Support Software User s Ma
26. Suppliedby BIOS The capability to type ahead is limited to 15 characters This mode is reliable on everycomputer Itis strongly recommended Suppliedby program The capability to type ahead is expanded to 255 characters This mode is not reliable on all computers and is not recommended Special keys include the function keys ALT keys and keypad keys which have a key binding associated with them Special Key Handling Sentas character sequences from keybindings When a key is pressed theappropriate key binding sets are searched for that key If found the keystrokeistranslated accordingly With TERMF in cursor mode all threesets cursor application and normal are searched in that order Inapplication mode only application and normal sets are searched in normal mode only the normal key binding set is searched Sentas MegaBasic controlcharacters When a key is pressed a search is first performed in a predefined set of MegaBasic key bindings Refer to the MegaBasic Programming Language ReferenceManual GFK 0256 The MegaBasic key bindings are designed to allow the same use of specialkeys for MegaBasic in both the PCM and a personal computer If the keystroke does not match a MegaBasic key binding translationis performed as described in the preceding option sent as character sequences from key bindings Multi character This delay valueisarbitrary and varies among different computer models TransmissionDelay
27. module name and size arguments The size is interpreted as a hexadecimal number The command has no effect if the module already exists If the module does not exist it will be created and initialized to all zeros No checksum protection will be applied to the module it may be freely read and written The location of the module may change after a reset but its contents will remain the same 0 get LED configuration Format 0 This command is used to return the LED configuration for the PCM Two words of binary data are returned The first word holds the configuration of LED 1 and the second holds the LED 2 configuration However TERMF does not display the binary values correctly Note The O command is provided mainly for PCOP and does not return meaningful data when invoked from interactive mode GFK 0255K Appendix C PCM Commands C 11 request status data Format Px This command requires a second uppercase letter x which specifies the type of status data requested The information returned is explained in the following table Option Description PC Show the status of the PCM configuration If the last configuration completed withouterrors the PCM returns the gt prompt If there were errors the PCM returns an error string PD Dump the operating status of PCM at the most recent PCM soft reset When the PCM is soft reset it saves the contents of its task control blocks plus the top 64 words of the
28. 5 5 5 16 5 21 5 34 5 50 5 52 5 57 5 64 5 1 This chapter contains the following sections Description Section 1 lists common error codes from the PCM extensions to MegaBasic Section 2 describes predefined control sequences for manipulatinga VT100compatibledisplay These functions and procedures are located in VT100 41 Section 3 describes definitions and procedures used to access user references not directly supported by the PCM backplane driver and to access data protected by a user password These procedures are found in GENERIC PGM Section 4 describes how to access the PLC and I O fault tables from a MegaBasic program using RD FLT PGM Section 5 describes how to use UTILITY PGM to obtain a variety of PLC CPU data Section 6 describes how to load MegaBasic data files and utility packages in binary form to the PCM using TERMF and the PCM command interpreter Section 7 describes how to change the PCM serial port configuration send and detect serial breaks and use the modem control and status signals of the serial ports inMegaBasicprograms Section 8 describes timer and backplane interrupts Section 9 describes the processing of messages from COMMREQ function blocks and other sources Title MegaBasicError Codes Screen Formatting Commands Accessing P L and Password Protected Data Access to PLC Fault Tables and PLC Status Gathering PLC Information from MegaBasi
29. After selecting the desired memory expansion board press the Escape key to return to the PCM detail screen PCM Configuration Data After selecting the module and the expansion memory the PCM is configured for CCM and or MegaBasic operation from the PCM module detail screen The PCM configuration mode is selected from the Config Mode field on the detail screen To select a different configuration mode repeatedly press the Tab key until the desired mode is displayed on the screen Then press the Enter key Use the Cursor and Tab keys to complete the detail screen for the desired configuration mode and press the Enter key Once the PCM has been configured press the Escape key again to save the module configuration and return to the rack display The display screen should now include the PCM in the slot you selected Complete the configuration procedure for each module you wish to add to the Series 90 PLC rack Once the Series 90 system configuration is complete Logicmaster 90 software is used to store the configuration to the PLC CPU If the PCM configuration has changed since the last configuration store the PCM is automatically reset and restarts using the new configuration Chapter 2 Installing the PCM 2 9 GFK 0255K PCM Configuration Modes Before configuring the PCM with Logicmaster 90 software it is necessary to understand the various configuration modes and how they affect the operation of the PCM Each mode is de
30. CCM Seat Pa 7 Not Supported 9 Diagnostic Status Words 3 9 Diagnostic Status Words The addressing scheme for the Series One PLC differs from that of the Series 90 PLC when accessing I O points Refer to the next section for more information 2 Scratch pad definitions are not the same in the Series One PLC and the Series 90 PLC See table 3 6 for the Series 90 scratch pad layout Diagnostic status words and error code definitions are different in the Series One PLC and the Series 90 PLC See table 3 7 for the Series 90 diagnostic status words and refer to table 3 12 for the Series 90 CCM error code definitions Table 3 5 Series Five Memory Types vs Series 90 CCM Memory Types Series Five CCM Series 90 CCM Memory Type Target Table Memory Type Target Table fe Register Table Input Table 2 3 Ouipar ab 6 Scratch Pad 4 f 6 CCM Scratch Pad Not Supported 9 Diagnostic Status Words 5 9 Diagnostic Status Words The Series Five local and special inputs do not exist in the Series 90 input table All inputs are equivalent and it is up to you to determine their functionality The Series Five local and internal outputs do not exist in the Series 90 output table All outputs are equivalent and it is up to you to determine their functionality For example an output to be used as an internal coil must not be tied to a real output The addressing scheme for the Series Five PLC differs from that of the Series 90 PLC when accessing I O
31. Code 00 1D 1E 1F 1C FF FE FC 80 81 82 H Format This command returns the firmware release number of the PCM The ASCII string returned by the PCM contains a single digit for the major revision number a period and two digits for the minor revision number For example Software revision number is 3 03 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 G H C 6 Initialize device Format device name lt device_initialization_string gt This command sends the specified initialization string to the specified device Currently the two serial devices COM1 and COM2 and the CPU device support this command A space character is required between the device name and initialization string The parameters in device initialization string must occur in the order listed in the table below with no intervening spaces Any number of parameters may be omitted at the right end of the string Parameters to the left of the last one may be omitted but all the surrounding commas must be included Omitted parameters retain their previous settings InitializationString baud rate parity data bits stop bits flow contr ol physical interface duple x mode delay value typeahead size where baud rate 300 600 1200 2400 4800 9600 19200 or 38400 the number of bits per second Note that 38 400 baud is supported only by the S
32. DW_DH_BOT DW DH Se e DW Sus ERASE pnm ERASE mon ET GFK 0255K Serial port status functions INPUT OUTPUT Serial ports four wire full duplex mode input and output to the PCM serial ports point to dez serial port control and status 4 14 two wire half duplex ME Serial ports two wire half duplex mode Series 90 30 PCM autoconfig catalog numbers 1 12 configuration problems autoconfig 6 8 D type connector default Sealine 110 hardware overview memory plug and go operation 1 88 serial connector serial ports 1 12 Ti 12 WYE cable EA Series 90 70 PCM adding expansion memory 2 5 2 9 catalog numbers for expansion memory boards 2 5 daughter board hardware overview 1 9 memory 1 9 option connector 1 10 serial connectors serial ports aoj Service request example 3 30_ FNC parameter 3 28 PARM parameter 3 29 Service request SVCREQ set protection level Q command set upper memory limit Y command eu SET LED statement 4 25 LED number 4 25 operation code 4 25 SGR control string Shared RAM 1 9 Short status records 5 30 SHORT STATUS 5 22 Index Index 16 Index T Target memory types 3 2 memory types not supported 3 2 Series Five vs Series 90 CCM memory types 3 3 Series One vs Series 90 CCM memory types 3 3 Target sourcememory addresses 5 7 Task not active error 6066 3 TERM DAT TERMB 1 3 1 15 4
33. INPUT TABLE EXTERNAL I O INTERNAL COILS AND MEMORY TYPE 3 SHIFT REGISTER POINTS OUTPUT TABLE Figure 3 1 Series One Jr PLC vs Series 90 PLC SERIES a44247 ENES wM SERIES 20 MEMORY TYPE 1 MEMORY TYPE 1 TIMERS REGISTER COUNTERS TABLE MEMORY TYPE 3 B MEMORY TYPE 2 INPUT TABLE EXTERNAL I O REGISTER POINTS OUTPUT TABLE l l l l MEMORY TYPE 3 l Figure 3 2 Series One PLC vs Series 90 PLC GFK 0255K Chapter 3 CCM Operation 3 9 GFK 0255K MEMORY TYPE 3 B MEMORY TYPE2 EXTERNAL I O INPUT TABLE SHIFT REGISTER POINTS MEMORY TYPE3 TIMER COUNTER OUTPUT STATUS TABLE Wu Un mu e d Figure 3 3 Series One Plus PLC vs Series 90 PLC SERIES 844249 SAREE Cu SERIES 90 MEMORY TYPE 1 MEMORY TYPE 1 DATA REGISTER REGISTERS TABLES TIMER COUNTER ACCUMULATORS r MEMORY TYPE MEMORY TYPE 2 EXTERNAL INPUT l TABLE MEMORY TYPE3 TIMER COUNTER OUTPUT UP STATUS TABLE E AN T 244248 ONE PLUS Cu SERIES 90 MEMORY TYPE 1 REGISTER TABLE MEMORY TYPE 1 TIMER COUNTER ACCUMULATORS REGISTERS Figure 3 4 Series Three PLC vs Series 90 PLC Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 3 10 344241 SERIES FIVE SERIES 90 MEMORY TYPE 1 MEMORY TYPE 1 REGISTERS REGISTER TABLE MEMORY TYPE 2 MEMORY TYPE 2 11
34. INPUTS INPUT TABLE MEMORY TYPE 3 OUTPUT TABLE INTERNALCOILS SCRACH PAD LAYOUT DIFFERENT FROM SERIES FIVE MEMORY TYPE 6 MEMORY TYPE 6 MEMORY TYPE 7 NOTSUPPORTED CCM DSW s MEMORY TYPE 9 MEMORY TYPE 9 01 PORT ERROR CODE 02 SUCCESSFUL CONVERSATION 03 ABORTED CONVERSATION 04 HEADER RETRIES 05 DATA BLOCK RETRIES Figure 3 5 Series Five PLC vs Series 90 PLC Notes Relating to Figures 3 1 through 3 5 A TheSeries One and Series Three PLCs have one table for I O The Series 90 PLC has two separate tables one for inputs and one for outputs Depending upon the I O type of the data being retrieved it is necessary to use memory type 2 or 3 instead of just 3 B TheSeries One Series Three and Series Five PLCs use byte oriented addressing 117 start address 3 The Series Six and Series 90 use bit oriented addressing I17 start address 17 GFK 0255K Chapter 3 CCM Operation 3 11 Section 3 Communications Request COMMREQ When a PCM is configured as a CCM master or peer it can initiate CCM messages only when the PLC CPU commands it to do so Communications Request COMMREQ function blocks in the ladder logic program are used for this purpose The PLC CPU uses the parameters of a COMMREO and its associated command block to send a command to the PCM The PCM in turn sends the CCM message that was specified in the command When a COMMREO function block receives power flow the CPU may send a CCM command and
35. IO FLT SPEC data are valid IO REF ADD A three byte field describing the I O reference address where the fault was reported See the discussion of the I O reference address sub record below IO FLT ADD A six byte field describing the physical address of the fault See the discussion oftheI O faultaddresssub record below IO FLT GRP A one byte integer specifying the fault group of the fault IO FLT ACT A one byte integer specifying the action code of the fault IO FLT CAT A one byte integer specifying the category of the fault IO FLT TYPE A one byte integer specifying the type code of the fault IO FLT DESC A one byte integer specifying the description code of the fault IO FLT SPEC 5 21 bytes of fault specific or extra fault data rarely used IO FLT TS A six byte field containing the time stamp when the fault occurred See the discussion below of the time stamp subrecord Referto the Series 90 70 Programmable Controller Installation Manual GFK 0262 for additional terms associated with Series 90 faults GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 29 Short Status Records When using the FLT PRESENTS or FLT CHANGEDS function or when using SYSREAD to update SHORT STATUS or a variable SYSLINKed to SSTAT a short status record is created Field Description 55 NUM CONTROL PROGS Aone byte integer containing the number of control programtaskscurrently defined in the PLC CPU
36. MegaBasic Blink LED Program 16 7777 5 75 Controlling COMMREOs E a E E 5 6 Identifying the Source of Backplane Messages 666 0666666 6666 5 82 Backplane Messages to Another 606 5 86 Section 10 Asynchronous Serial Inputand Output 5 91 NOWAIT OPEN CU 3 ep hi dot dote E a b ROC Ie end ER Lac 5 92 NOWAIT READand NOWAIT 7 5 94 NOW AIT GCDOSBS iier ad oig 5 4 wA Ra Pede 5 96 NOWAIT SEEK 4 bees de ob ee bI Ute eb Bei de e 5 96 NOWATTIZBEAD AHOBT 3 14b etae dp dria ER Edo RR Ret 5 97 NOWAIT_WRITE_ABORT 2 25 0 ducta vu odere bel vota 5 97 Example NOWAIT Program sssssseeeee eh 5 98 Section 11 VME Functions iir rei y rg rh aca Ra 5 100 VME Function Blocks for Communicating with the PCM 5 100 Some Rules for VME Bus Operations in Series 90 70 PLCs 5 101 General VME Information for the PCM 00000 5 101 PCM Dual Port RAM Available for Applications 4 5 102 cece en 5 103 VME Read Function 5 105 gt 0 VMiRead Modify Write Function 0 0660 606666066666066 6066006002 5 107 VME Test and Set Function 606666666666666 666066666066000 0 0000002 5 108 MegaBasic Program Access to PCM Dual 0648 5 109 Section 12 Programming Example using VME Functions 5 110 Section 13 Optimizing Backplane Communication 5 114 Backpl
37. PLC TIME 5 38 PLC TIME AND DATE VALID 5 38 TIME AND DATE OF LAST CPU R ESP VALID 5 38 TIME OF LAST CPU RESP s 38 true false 5 36 UTILITY INIT 5 3645 49 Verify a file command C 15 Vector 4 24 Verify a file V command C 15 Video graphics array VGA VME functions 5 100 genera E information for the PCM 5 101 programming example 5 110 rules for VME bus operations in Series 90 70 PLCs 5 101 VME function blocks for communicating with the PCM METS 5 100 5 100 5 105 example 5 106 VT100 PGM 5 5 F1 functions and procedures 5 6 ATTR ATTRS V VMERMW 5 100 5 107 V V Index X X eXterminate file command XFER REJECT 4 22 Y Y set upper memory limit command icar Index 20 GFK 0255K
38. PROG PRT mode is similar to PCM CFG mode and NONE mode but permits specifying serial port settings which are different from the default However the Logicmaster 90 serial port settings will be overridden by the PCMEXEC BAT or UCDF configuration data if any Typically use of this mode is to insure that port 2 has the same setup when PCM is in factory mode hard reset as when PCM is in user mode soft reset This is useful when developing MegaBasic programs that use port 2 When this mode is selected in Logicmaster 90 software the following PCM detail screen is displayed rack l l E orca 32323 733292931 CNN 011733 7231 o gt SERIES 90 70 MODULE IN RACK 1 SOFTWARE CONFIGURATION Catalog 8 1 PROGRAMMABLE COPROCESSOR MDL HELP ALT H for Serial Port Restrictions Config Mode igi mil Interface 2 Interface 2 Data Rate 0 Data Rate 0 Flow Contrl HARDWARE Flow Contrl HARDWARE Parity NONE Parity NONE Stop Bits 1 Stop Bits 1 Bits Char 8 Bits Char 8 D LMSO LESSON imt ONFIG VALID Parameter Description ConfigurationMode Set to PROG PRT Interface The interface parameter for port 1 of a Series 90 30 PCM is 25 232 port 2 of the 192K and 640K Series 90 30 modules may have an interface value of either RS 232 or RS 485 The interface parameter is not used or displayed for the 160K module IC693PCM300 RS 232 and 25 485 are valid for both ports of the Series 90 70 P
39. R AI or AQ in both the Series 90 70 and Series 90 30 COMMREO P or L in the Series 90 70 COMMREO only SYSID is a hexadecimal value containing the rack and slot location of the PCM to which the COMMREQ is being sent Entries have this format 0 7 rack 1 slot 2 rack slot RS 0 pid If SYSID is incorrectly programmed for a rack and slot which does not contain a PCM or other intelligent module no communications request will be sent the OK output if any will remain inactive and the FT output will become active Note No error occurs if SYSID specifies a rack and slot which contains an intelligent module that is not a PCM Additional examples Hexadecimal Rack Slot Word Value 0 4 0004h 3 4 0304h 2 9 0209h 7 2 0702h IN SYSID Chapter 3 CCM Operation 3 13 GFK 0255K The following table lists the applicable task numbers for CCM Task Number Description 1 CCM on PCM Port 1 2 CCM on PCM Port 2 If the task number programmed for CCM is not valid a COMMREO BAD TASK ID application fault is logged in the PLC fault table This can occur if the TASK value is misprogrammed if the PCM has been hard reset so that CCM is inactive or if the PCM is not configured correctly for the specified CCM task The OK and FT function faulted outputs can provide power flow to optional logic to verify successful completion of the COMMREQ Note that the Series 9
40. R1 is 2 the VME read of the semaphore Occurs on every sweep When R1 contains 3 the program writes 22 bytes to the PCM from R20 using the VMEWRT function block The data is placed at offset 4002h in PCM dual port RAM Note that the semaphore offset 4000h is immediately cleared after the VMEWRT 1 is changed to 2 to permit the operation to be repeated The MegaBasic program sets up variables containing the locations of the data in dual port RAM DPR SEG FLAG OFFSET and DPR OFFSET The program writes 1 to the semaphore location using the FILL statement to start processing data As long as the semaphore value is 1 the MegaBasic program remains in a loop waiting for the PLC to complete its transfer of data When the semaphore becomes 0 the program uses the EXAM statement to move data from dual port RAM to a local MegaBasic array This data is printed to an attached terminal for display 5 110 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 01 05 80 01 36 FANUC SERIES 90 70 DOCUMENTATION v2 02 lt lt RUNG 5 gt gt FST_SCN S00001 lud MOVE INT CONST 1 00002 LEN 00001 l l lt lt RUNG 6 gt gt EQ INT 000099 RO0001 I1 QI C CONST 12 2 CONST AM CONST _ 0039 LEN 00001 00001 CONST ADR Q CONST 00024000 00001 l R00001 I2
41. S CHANGES The word PROCESSING will contiue to blink until the module has completed processing of the new values The HHP will then redisplay the last parameter that had been displayed 20 02 PCM301 lt S DATA RT 2 9600 Notice that the asterisk to the left of PCM301 is gone indicating that the configuration is no longer frozen and that the module is using the new values Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 22 To continue the example suppose that you start changing parameters then realize that you have made a mistake The changes made so far that is since the configuration was frozen can be discarded reverting to the previous configuration Change the baud rate parameter for port 2 to 4800 Press the key sequence R0 02 PCM301 lt S DATA RT 2 4800 Notice that the configuration is frozen and that the actual baud rate being used by the PCM is 9600 the previously configured baud rate To discard the changes Press the key DISCARD CHGS S lt ENT gt Y lt CLR gt N If you press CLR again at this time the discard operation would be aborted Press the aH key 20 02 PCM301 lt S DATA RT 2 9600 The module s configuration is no longer frozen The parameters have the same value they had before we changed the baud rate to 4800 GFK 0255K Chapter 2 Installing the PCM 2 23 Section 4 TERME Installation and Configuration In order to use your
42. To skip some of the intervening parameters before the wait flag and delay values use 1 for these parameters so that the READ PLC FAULT BIT procedure knows what is desired Anexample of the READ PLC FAULT BIT procedure is Access utility pgm READ PLC FAULT BIT 0 1 1 1 NOWAIT 2000 OLD 1 Repeat If OLD Let NEWS PLC FAULT BIT then Next OLD NEWS Print date time Rack 0 fault summary bit 18 If not OLD then Print not Print active Next where a repetitive read of the fault summary bit for rack 0 is set up to occur every two seconds Every time it changes a time stamp message indicating the new state is printed Another example of the READ_PLC_FAULT_BIT procedure is Access utility pgm READ PLC FAULT BIT 0 3 1 3 Print The fault summary bit for module 23 on bus 1 of the Print Genius Bus Controller in slot 3 is PLC FAULT BIT where the fault summary bit for module 23 of bus 1 of the GBC in slot 3 of rack 0 is read and printed Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 48 The UTILITY INIT procedure returns all interrupt linkages and timer setups used by the UTILITY PGM package to the initial state that they were upon initial access to the package This provides a fast way to turn off all timers that may be used by the UTILITY PGM package orto make sure that the interrupt linkages a
43. User s Manual GFK 0487 for information on using PCOP to configure the amount of PCM memory allocated to MegaBasic The following table lists the maximum sizes for RAM Disk and program workspace corresponding to the various PCM memory configurations Note that the program workspace is larger than the RAM Disk space because the program workspace must contain executing programs data variables used by MegaBasic and the PCM extensions while the RAM Disk needs to hold only the MegaBasic program files Table 4 1 Default Program Workspace and RAM Disk Sizes Series 90 70 PCM Default RAM Sizes Mega Basic Option RAM Total RAM Workspace Size Default RAM Disk Size Series 90 30 PCM RAM Size Default Default MegaBasic Total RAM Workspace Size Disk Size 160K 30K 192K 45K 640K 374K 199K Determining the Size of a MegaBasic Program The MegaBasic STAT command can be used to determine the size of a program s code and data as well as the remaining workspace size The value for bytes remaining is the unused workspace available for program and data at that time The SHOW command prints the program and data sizes of all programs loaded into MegaBasic workspace Series 90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K 4 10 MegaBasic Program Packages MegaBasic programs may be partitioned into packages The main program can execute one or more ACCESS statements to
44. and MegaBasic program s in the PCM RAM device are preserved during a PLC power loss by the PCM battery The Logicmaster 90 configuration is preserved by the PLC CPU battery Series 90 70 or power supply battery Series 90 30 Failure to replace either of these batteries when necessary may prevent the PCM from operating normally 1 14 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Section 7 Who Should Use PCOP Everyone who develops MegaBasic applications for the PCM will need to use either TERMF or PCOP See PCM Support Utilities in section 1 of this chapter for catalog numbers and brief descriptions of TERMF and PCOP TERME provides a simple command line interface to the PCM command processor while PCOP provides a menu oriented interface similar to Logicmaster 90 software plus EXPERT mode shortcuts PCOP also provides project folder support for multiple PCM applications Certain PCM configurations are available only from PCOP users who need these configurations must use PCOP Other users may prefer PCOP We recommend PCOP for these users e CCM application developers who need to adjust CCM timeouts and turnaround times in finer increments than the ones provided by Logicmaster 90 configuration must configure the PCM with PCOP Note Beginning with Release 3 00 timeouts and retry counts may be set using COMMREQs to the CCM task Refer to the Series 90 PLC Serial Communications U
45. bus access to be performed AddressModifier Hexadecimal value coded to specify the rack in which the module resides and the access mode of the VME bus access to be performed Address A double word specifying the hexadecimal address of the first word or byte to be accessed It may be a constant or the reference address of the first low word of two words containing the module address The address is based on the rack and slot the module is located Refer to Address Allocation by Rack and Slot in this section OK Power flow output that is true when the function is enabled and completes successfully Q Set to true if the semaphore was acquired Set to false if the semaphore was not available i e was owned by another task When the VMETS function receives power flow a boolean true is exchanged with the data at the address specified by ADR using the address mode specified by AM The VMETS function sets the Q output to true if the semaphore false was available and acquired When the operation is successfully completed the VMETS function passes power to the right through the OK output For information on PCM module addressing using address and address modifier codes refer to General VME Information for the PCM presented earlier in this section For more information on Series 90 70 PLC programming refer to the Logicmaster 90 70 Programming Software User s Manual GFK 0263 and the Series 90 70 Programmable Controller Referenc
46. is then printed at the home position along with text to show that the attributes had been turned off 50 Access vt100 pgm 100 A ATTRS ATTRIB OFF BLINK BOLD Working 5 200 Print CURHOMES AS I think Note The TERMF terminal emulator supports the use of color selection control strings using parameter values 30 37 and 40 47 to select the foreground and background color GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 11 The ATTR statement formats and prints an SGR control string to a VT100 terminal or other compatible display device The optional list of parameters specifies the desired attributes for the following text to be displayed on the VT100 device The list of attributes that may be specified includes the constants ATTRIB OFF BLINK BOLD UNDERSCORE and REVERSE When all parameters are omitted the resulting control string turns all attributes off on the VT100 device The format of the ATTR statement is xxx ATTR pl p2 Argument Description Aninteger number specifying the desired attribute number 1 p2 The desired attribute number 2 In the following example the VT100 screen is cleared the attributes set to bold and underscore some text is printed at the home position and then the attributes are turned off Access vt100 pgm CLS ATTR BOLD UNDERSCORE Print GE Fanuc Automation N A ATTR In the next example the operation that was performed in
47. range 0 to 8 SS PROGRAMMER FLA4GS Aset of boolean flags indicating which control program taskshaveprogrammerscurrently attached to them Spare Resered Abytes SS_CONTROL_PROG_NUM Aone byte integer number indicating which control program the MegaBasic program is currently attached to range 1 to 7 1 means not currently attached toa controlprogram SS_PRIV_LEVEL The current privilege level of the MegaBasic program for accessingmemory in the PLC CPU SS_SWEEP_TIME Atwo byte integer WORDS containing the time interval from the end of the second most recent PLC sweep to the end of the most recent sweep This value is in 100 microsecond increments it is zero when the PLC is not running a user program SS_PLC_STATUS Atwo byte set of boolean flags and bit fields describing the current status of the PLC CPU Using the MegaBasic bit numbering convention the following bit fields are defined 0 1 Enable Disableswitchsetting 1 Disable outputs 0 Enableoutputs 1 1 Programmer attachment present flag 1 Thereisa programmer attachment for the indicated control program number 0 There isno programmer attached to that controlprogram 2 1 I Ofaulttableentry present flag This flag is alsoreturned by the FLT PRESENTS function 1 Thereisa fault record inthe I O fault table 0 Thereisno fault record in theI O fault table 31 PLC fault table entry present flag This flag is alsoreturned by the FLT_PRESE
48. type Y and respond to the prompts for register number RGB value and color name If the settings are correct as displayed type N Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 30 Local Configuration File If you frequently use more than one TERMF or PCOP setup you can save each configuration in its own file You can specify the local configuration file by naming it when you invoke TERMSET as follows TERMSET new filename For example to switch between using an EGA and monochrome display type COPY DEFAULT DAT TERM EGA TERMSET TERM EGA and modify the default settings to use your EGAdisplay When you exit from TERMSET these settings are saved to the file TERM EGA Then create a file named TERM MON to describe the monochrome display by typing COPY DEFAULT DAT TERM MON TERMSET TERM MON Whenever you need to change your configuration to the EGA setup type COPY TERM EGA TERM DAT PCOP TERMF Or for the monochrome monitor type COPY TERM MON TERM DAT PCOP TERME You could also specify which file to use when you invoke TERMF or PCOP as follows TERME TERM EGA or PCOP TERM EGA or TERME TERM MON or PCOP TERM MON GFK 0255K Chapter 2 Installing the PCM 2 31 Connecting the PCM to the Programmer Cables for connecting the PCM to a display terminal or personal computer are described in appendix A PCM Cabling Information To connect
49. 1 3 G Get hardware ID command C 6 Gathering PLC information from MegaBasic programs GEN TESTPGM GENERIC DOC 5 16 F 1 GENERIC PGM procedures CHG PRIV 5 1645 17 GFK 0255K eXterminate file X command 5 51 C 16 F F show Free memory command C 5 Fault table entries PLC e 3 Fault table header records CLEAR TS 5 28 FLTS SINCE CLEARS 528 NUM FLTS 5228 NUM READS Fault tables access to PLC fault tables and PLC status fault table header records I O fault address subrecords I O fault table records I O reference address 5122000168 5 32 roblems with fault table access 5 33 PLC fault address subrecords 5 32 PIC fault table records time stamp subrecords 5 32 Features not supported by the PCM MegaBasic 48 File descriptions TERME F 1 BITFUNCS BIN F 1 BYTESWAPBIN CLEANUPBAT CRUNCH EXE F 1 DEFAULTDAT F 1 EXAMPLES DOC F 1 GEN TESTPGM F 1 GRAPH PGM F 1 INSTALL DOC F 1 MBCRC PGMF 1 PORT CTL BIN F 1 PRN FLTPGM READ FITPGM F 1 README DOC F 1 SAMPLE PGMIF 1 TERM DAT TERMEEXEJF 1 Index Index 6 Index serial connectors serial ports on the Series 90 30 PCM fit serial ports on the Series 90 70 PCM io Br fined LEDs USER1 and USER2 1 6 USERI and USER2 watchdog timer what you will need WYE cable I Initialize device command C7 I O configuration rack screen D 6 I O fault address subrec
50. 1 to indicatehigh priority Asaruleof thumb all messages that do not require single sweep response time should be sent low priority However high priority does not in itself guarantee that transfers complete in one PLC sweep Message Type Used by the receiving task to aid in decoding the message The message type depends on the source of the message See Identifying the Source of BackplaneMessages below Source Identifies the sender of the message The two upper bytes starting at offset 10 are unused The two lower bytes are formatted as follows 16 10 9 5 4 1 7 bits 5 bits Abits Rackand slot numbers are used to identify a given module in the Series 90 PLC system ID identifies a particular program or software process on the module For messages to other PCM tasks IDs 1 and 2 are used by CCM on ports 1 and 2 respectively and ID 3 is used by MegaBasic Destination Identifies the destination of the message When MegaBasic receives it the ID value is 3 and the slot and rack values correspond to the location of the PCM Reserved The data in these fields varies Chapter 5 Advanced MegaBasic Programming 5 65 GFK 0255K Using the BKP_MSG Interrupt COMMREO messages and messages from another smart module are sometimes referred to as unsolicited communication because they are not requested by the PCM These messages arrive at unexpected times However the arrival time of all backplane messages is somewhat unp
51. 11 l 2 OHNE INNEN ONU ONE OC OST RACK 1 gt SERIES 90 70 MODULE IN RACK J SLOT SOFTWARE CONFIGURATION PROGRAMMABLE COPROCESSOR MDL HELP ALT H for Serial Port Restrictions Catalog 8 1 Config Mode YES SLAVE CCM Enable CCM Mode Interface RS232 Data Rate 0 Flou Contrl NONE Parity ODD Retry Count NORMAL Timeout LONG Turn Delay NONE 1 CPU ID YES SLAVE CCM Enable CCM Mode Interface 2 Data Rate 19200 Flow Contrl NONE Parity ODD Retry Count NORMAL Timeout LONG Turn Delay NONE CPU ID 1 ONFIG VALID Battery Req YES D LMSONLESSON IR Parameter Description ConfigurationMode Setto CCM ONLY Battery Required Specify whether a battery is required Choices are YES or NO CCM Enable Specify whether the port is to be configured for use as a CCM port Choicesare YES or NO CCM Mode This parameter displays the availability of ports for CCM access Choices are SLAVE PEER or MASTER Interface The interface parameter for port 1 of a Series 90 30 PCM is 15 232 port 2 of the 192K and 640K Series 90 30 modules may have an interface value of either RS 232 or 145 485 The interface parameter is not used or displayed for the 160K module IC693PCM300 RS 232 and RS 485 are valid for both ports of the Series 90 70 PCM Data Rate Data rate bits per second or bps for the port Choices are 300 600 1200 2400 4800 9600 or 19200
52. 2 PORT 1 85 232 RTS I 85 232 DTR PORT 2 PORT 1 85 232 CTS I 85 232 DCD PORT 2 NO CONNECTION I 85 232 RTS PORT 2 SIGNAL GROUND I 85 232 DTR PORT 1 PORT 1 85 232 DCD I 85 485 SD B PORT 2 PORT 2 85485 SD A I 85 485 RTS B PORT 2 PORT 2 RS 485 RTS A I 85 485 CTS B PORT 2 PORT 2 RS 485 CTS 4 I TERMINATION RD PORT 2 666090000000 PORT 2 TERMINATION CTS 996000900009 S 85485 RD B PORT 2 PORT 2 RS 485 RD A Figure A 2 Serial Port Pin Assignments for the Series 90 30 PCM AWYE cable is supplied with each Series 90 30 PCM The purpose of the WYE cable is to separate the two ports from a single physical connector i e the cable separates the signals In addition the WYE cable makes cables used with the Series 90 70 PCM fully compatible with the Series 90 30 PCM The WYE cable is 1 foot in length and has a right angle connector on one end that connects to the PCM On the other end it has a dual connector with one connector for port 1 and the other for port 2 Appendix A PCM Cabling Information A 3 GFK 0255K 244357 RS 232 TD PORT2 88 232 CTS PORT 2 RS 232 RD PORT 2 RS 232 DTR PORT2 RS 232 DCD PORT 2 88 232 RTS PORT 2 RS 232 DTR PORT 1 RS 485 SD B PORT 2 RS 485 RTS B PORT 2 RS 485 CTS B PORT2 TERMINATION RD P
53. 2 3 Figure 3 1 Series One Jr PLC vs Series 90 PLC lsssssseseeeesssee eee 3 9 Figure 3 2 Series One PLC vs Series 90 PLC aae Ma E E eE EA 3 9 Figure 3 3 Series One Plus PLC vs Series 90 PLC 266266606 666666666606062 006200200000000 e 3 10 Figure 3 4 Series Three PLC vs Series 90 PLC 2 6066666 666666666062000 eee eens 3 10 Figure 3 5 Series Five PLC vs 501108 90 21 07 eee eens 3 11 Figure A 1 Serial Port Pin Assignments for the Series 90 70 PCM rene A 2 Figure A 2 Serial Port Pin Assignments for the Series 90 30 601 cece ee eee A 3 Figure A 3 WYE Cable Connections for the Series 90 30 PCM 0 6 cece eee eee A 4 Figure A 4 PCM to Workmaster Computer 0 0 00 66666 lee A 5 Figure A 5 PCM to PC AT Personal Computer 66666666 666666666666206 062620000000000 A 5 Figure A 6 PCM to Cimplicity Model W Computer 2 0 6 A 5 Figure A 7 PCM to Workmaster II Computer or PS 2 Computer 0 0 6666 666666666606666 060000 A 6 Figure A 8 PCM to PCM with Hardware Flow Control RS 232 only A 7 Figure A 9 CCM2 to PCM RS 232 only III ee A 7 Figure A 10 PCM to OIT with Hardware Flow Control RS 232 1 0000 ee eee A 8 Figure A 11 PCM to OIT without Hardware Flow Control RS 232 1 sees A 8 Figure A 12 PCM to a 5 Pin Device Full Hardware Flow Control 2222200000 A 9 Figure A 13 PCM to a 5 Pi
54. 2 l1 3 RD 0 o9 RD 3 2 TD ez 20 0 PCM 0 RTS 4 Jed 4 0 85 2 0 ien Eg 0 CTS 5 icu 5 CIS E gt 0 0 CCM PORT 0 7 DCD s 8 0 0 0 DTR 20 Ez 20 DTR gt 0 0 GND 7 7 KW 0 0 0 3 SHLD 1 J m 0 0 jo SI REN ME RH 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE MALE FEMALE Figure A 9 CCM2 to PCM RS 232 only GFK 0255K Appendix A PCM Cabling Information A 7 a44234 PIN PIN 0 TD ON 3 RXD e 2 0 pru n TEN M ll esie 00e o 0 0 CTS 5 4 RTS 0 0 PON 0 DTR 20 _ 7 0 DTE 09 5 ers 0 CONNECTOR 0 0 DCD 8 TI 4 20 DTR 0 0 0 GND 7 7 GND 0 gt 0 0 sup 1 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE FEMALE MALE Figure A 10 PCM to OIT with Hardware Flow Control RS 232 only 844239 PIN PIN 0 TXD 3 x X lt 5 3 RD Lf 0 0 3 c RXD 2 ri 1 2 TD LI 0 0 EN 0 05 94 CTS 5 a E 4 RIS L 22 00945 DCD 8 E D ap CIS 5 1 BM DCE connector 50 PTR 20 peiie 8 DD 0 2 58 ER o 0 GND 7 7 GND LI 0 0 0 1 SHLD gt 9 0 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE MALE FEMALE Figure A 11 PCM to OIT without Hardware Flow Control RS 232
55. 3 PBMEMS is the request code used to read L memory ACC CODES 1 is used for L memory 19 is the offset from the beginning of L memory to L20 1 is the number of L registers to read and 123 is a code that the MegaBasic program can use to recognize the PLC response message for this request if PROCESS MESSAGE returns more than one message Note that SMSG TEXT is shared from the GENERIC PGM package and is the actual text string sent by SMSG_WTEXT 220 SMSG_TEXT 1 8 GEN MSG chr 0 230 SMSG TEXT 9 5 LMEM chr 0 330 SMSG WTEXT R PBMEM ACC CODES 1 In the next example the SMSG WTEXT procedure is used to write P15 P19 GEN MSG is the PLC program name folder name W TMEM is the request code needed to write P memory ACC CODE 2 is used for P memory 14 is the offset from the beginning of P memory to P15 5 is the number of P registers to write and 26 is the handle Note that a block name is not necessary for P memory 220 SMSG TEXT 1 8 GEN MSG chr 0 225 SMSG TEXT 9 SEND P 330 SMSG WTEXT W TMEMS ACC CODES 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 20 Section 4 Access to PLC Fault Tables and PLC Status READ FLT PGM provides access to the PLC and I O fault tables from a MegaBasic program In addition PRN FLT PGM and TEST FLT PGM explain how to use the fault information supplied by READ FLT PGM PRN FLT PG
56. 5 22 IO FLT TBL 10_FT 5 22 IOFA_RACK 5 22 IORA_SEG 5 22 PLC_FAULT_HDR PLC_FLT_TBL PLC_FT PLCFA_RACK SHORT_STATUS 5 22 SS NUM CONTROL PROGSS TS_SEC 5 22 READ_PENDING 4 22 READ_PLC_CPU_ID 5 35 5 45 READ PLC FAULT BIT 5 48 READ PLC RUN STATUS 5 35 5 43 READ PLC STATUS 5 35 5 39 READ PLC TIME AND DATE 5 35 5 41 READ_RECEIVED 4 22 READ TIMEOU1 422 README DOC F 1 reconfigure the PCM U command Remote variable unknown error code 104 5a Request codes for PLC memory types 5 19 request status data P command Reset blinks user LED1 or LED2 6 1 the PCM from a PLC program B1 GFK 0255K SHOW command show Free memory F command C 5 Showing PCM data files using TERME 5 50 50 SMSG_TEXT 5 16 SMSG WTEXT 5 16 5 18 Soft 10806 1 3 4 3 Specified devices 55 CONTROL PROG NUMS 5 30 55 NUM CONTROL PROGS 522 SS PLC STATUSS 5 30 SS PRIV LEVELS 5 30 SS PROGRAMMER FLAGS 5 30 SS_SWEEP_TIME 5 30 STABLE 4 22 Standard devices standard non privileged access type 5 101 STAT command 4 10 STAT HIST 4 23 STAT TIME 4 23 Status history 4 23 Status pointer 5 71 Status pointer memory type 3 17 Status pointer offset 3 17 Status time 4 23 Status variable sSSTAT 4 16 Status words diagnostic STOP statement 4 6 Storing PCM data files 0 String constants 5 6 5 7 CURHOMES A
57. 5 41 GFK 0255K Another example of the READ PLC TIME AND DATE procedure is Access utility pgm Repeat READ PLC TIME AND DATE If PLC TIME time 1 8 then Print time mismatch Next where the PLC time and date are read in wait mode and then compared with the current local time hours minutes seconds only A message is printed out if they don t match Note that the two time values generally won t match once a second at the time of the second s tick Caution This operation is not a recommended procedure since reading the time of day as fast as possible from the PLC CPU may have an adverse impact on the PLC sweep time Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 42 READ PLC RUN STATUS The READ PLC RUN STATUS procedure allows the user to get the PLC run status from the short status data from the SRP This data is obtained either in a wait for data mode default or a NOWAIT mode In NOWAIT mode the user must check the PLC RUN STATUS VALID flag to determine when the data has actually arrived in the PLC RUN STATUS variable In NOWAIT mode the user can specify a repeat delay time so that the PLC run status is read and updated on a continuing basis When the delay time is specified as something other than 0 0 as fast as possible the TIMER3 interrupt is used to supply the delay between repeats of the read request The fo
58. 99 S b 09107 RIS 22 25 TERMRX Oo S esa nr 4 RTS Si E 0 CIS 23 8 DCD 0 S port 0 SSI I 0 0 RT 24 5 CTS 0 MP 20 DTR 901 Md las ov 7 B 7 ov 6 SI 0 j SHLD 1 1 SHLD tur 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE 120 OHMS FEMALE MALE Figure A 16 PCM to OIT without Hardware Flow Control RS 422 RS 485 844233 PIN PIN aw nn 0 SD A 9 XX can sr 24 RXD 9 0 1 SD B 21 25 0 0 RD A 13 23 TXD 0 0 POM RD B 25 XX z 9 09 RTS A 10 12 CTS 0 PORT o RTS B 22 2 13 CTS 9 DCA 2 UM RT 27 0 878 10 0 L 1 RTS o 0 0 etsa f 5 05 CTS B 20 0 0 ov 7 7 ov 0 0 o sup 1 wi VJ o oa LL Lj 25 PIN 25 PIN CONNECT 120 OHMS 25 PIN 25 PIN FEMALE MALE INSTALL TERMINATING RESISTOR MALE FEMALE Figure A 17 PCM to Series One Series Three DCA RS 422 RS 485 A 12 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K a45362 SD RD A SD RD B SHLD GND OTHER DEVICE OTHER DEVICE SD RD A SD RD B SHLD
59. CPU For general information on the SVCREO function refer to the Series 90 70 Programmable Controller Reference Manual GFK 0265 The SVCREO function block can be used to set the system window as follows enable EE 55522 FNC Specifies the PLC service to be requested The value used to set the system window is 4 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 3 28 PARM Specifies the memory location of the parameter block It may be any word oriented user reference R AI AQ P or L The parameter block used to set the system window consists of two byte values in a single word High Byte Low Byte Mode Value in ms The mode value 0 requests LIMITED mode which permits the window to use as much time as required to process messages up to the specified limit value Message processing which is not completed within the time limit is deferred until the next PLC sweep Time limit values from 0 to 255 milliseconds in 1 millisecond increments may be specified The time limit value 0 prevents the PLC CPU from receiving any messages from PCMs or other intelligent modules For information on other system window modes refer to the Series 90 70 Programmable Controller Reference Manual GFK 0265 The following table shows the minimum system window time values which will not degrade CCM performance for various CPU models in a PLC which contains one PCM but n
60. Communication between the PLC CPU and the PCM occurs during a portion of the PLC sweep called the system communications window or system window In particular the CPU can receive COMMREQ response messages from the PCM only during the system window In Series 90 30 CPUS the system window time is fixed The rest of the information in this section applies only to Series 90 70 PLCs Series 90 70 System Communications Window The system window in Series 90 70 PLC CPUs is normally allowed as much time as necessary to process every message to the CPU from every intelligent module in the PLC This mode of window operation called RUN TO COMPLETION mode allows the most efficient communication possible However some time critical PLC applications require a limit for the system window time The system window mode and time in Series 90 70 PLC CPUs can be changed by Logicmaster 90 70 configuration software and by the PLC program Using Logicmaster 90 70 configuration software is the simpler and faster method However if the PLC program must guarantee that the system window is set to the desired configuration or if the window configuration must change to accommodate different conditions then the program must configure the system window The remainder of this section describes how to use the SVCREO function block to adjust the system window PLC Service Request SVCREQ The SVCREO function block may be used to request a number of services from the PLC
61. FLIPGM Functions and Procedures see READ FLIPGM Shared Definitions and Constants eese UTILITY PGM Package Procedures ssssssssssseeeel eee UTILITY PGM Package Shared Constants and Variables 2 20 PCM Interrupts and Associated Defaults 2 2 0 0 666666666660666 ccc eee Structure of Backplane Messages 6 660666660666062 62 062062020000000 nes Backplane Message Fields arcieri ccc ERE Ph Message Type Rack Slot and ID Values n 0 PCM Address Allocation by Slot and Rack for Standard Non Privileged Access 39H hex G 1 9 G 2 P G 3 T G 3 3 0 4 Port 1 Pin Assignments RS 232 Synchronous Serial Mode Operation Port 1 Pin Assignments RS 422 Synchronous Serial Mode Operation Port 1 Control Registers cere o eR Le ead are ED AH ET Pura ada res Serial Controller Port Assignments 6066 666666666666060 626026200200000 e Synchronous Clock Source 6 1 5 1 666066666666666 eee eee Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 Table 1 1 Table 1 2 Table 1 3 Table 2 1 Table 2 2 Table 2 3 Table 2 4 Table 3 1 Table 3 2 Table 3 3 Table 3 4 Table 3 5 Table 3 6 Table 3 7 Table 3 8 Table 3 9 Table 3 10 Table 3 11 Table 3 12 Table 3 13 Table 4 1 Table 5 1 Table 5 2 Table 5 3 Table 5 4 Table 5 5 Table 5 6 Table 5 7 Table 5 8 Table 5 9 T
62. Flow Control Type of flow control to be used for the port Choices are HARDWARE or NONE Parity Type of parity to be used for the port Choices are NONE or ODD Retry Count Retry counts for CCM mode Choices are NORMAL or SHORT Timeout Length of timeouts used for CCM on the port Choices are LONG MEDIUM SHORT or NONE Turnaround Delay Turnaround delay time to be used for CCM on the port Choices are NONE 10 ms 100 ms or 500 ms CPUID Address of the port on a multi drop network This value is used to calculate the backoff delay upon an inquiry collision in peer mode The range of values allowed in this field is 1 to 254 A different value must be selected for each CCM device on the network Defaultselection Chapter 2 Installing the PCM BASIC Mode BASIC mode is not supported in PCM firmware version 2 04 or earlier Attempting to use it will result in an Unsupported feature in configuration fault for the PCM in the PLC fault table When BASIC mode is selected the PCM automatically runs a MegaBasic program named BASIC PGM if it exists CCM operation is not started on either port When this mode is selected in Logicmaster 90 software the following PCM detail screen is displayed l l l 7231 01733 CNN orca 32323 INNEN ONERE 1 gt SERIES 90 70 MODULE IN RACK 1 SOFTWARE CONFIGURATION Catalog 8 1 PROGRAMMABLE COPROCESS
63. I 0 to 20 Exam DPR SEG DPR OFFSET I 2 6210 DATA I Rem Copy data Next I Fill DPR SEG FLAG OFFSET 1 Rem Clear flag For 1 0 to 10 Rem Print data CUR I T8 27 Print REGISTER 515 1 20 o 515 PLC DATA I Next Next GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 113 Section 13 Optimizing Backplane Communication Backplane Processing for the Series 90 70 PCM The backplane communication channel between the Series 90 70 PCM and the PLC CPU consists of a high speed parallel VMEbus using a 16 bit wide data path On the PCM side there are two queues for messages from the PCM to the PLC CPU and two queues for messages from the CPU to the PCM The four queues may contain as many as 32 messages 16 going in each direction MegaBasic SYSREAD and SYSWRITE statements as well as many of the MegaBasic utility packages described in this chapter send service request messages to the PLC CPU Messages from the PCM to the PLC CPU are processed during the PLC system communication window which opens once per PLC program execution sweep If the system window is configured for run to completion mode the default the CPU processes all of the requests in the PCM s two outgoing queues during each sweep As each message is processed a response message is sent back to the PCM Messages from the CPU to the PCM include both responses to PCM messages and the messages sent by PLC COMMREO function blocks Incoming messages a
64. LED does not blink or the Ready or gt prompt is not displayed either the connection from the programmer to the PCM is bad or the programmer hardware is defective Cycle power on the programmer to make sure its serial port hardware is fully reset Problems with the programmer are very rare When they do occur they can often be fixed with a power cycle If your programmer is a computer type TERMF DEFAULT DAT or PCOP DEFAULT DAT again If the LED still does not blink when a key is pressed there is a problem with the cable or the programmer serial port hardware 1 PCOP Does Not Go Online MegaBasic Application Does Not Run If you are not using PCOP skip to step 4 below If PCOP does not go online when the PCM is running and port 1 has been assigned through configuration to MegaBasic CCM initiate a hard reset by pressing the Restart Reset pushbutton continuously for 10 seconds If the PCOP screen had gone blank or was displaying data from a MegaBasic program press ALI Z A PCOP screen should be displayed and PCOP will go online after a delay of up to 10 seconds If PCOP continues to go to TERMF after the hard reset and you have version 2 02 of PCOP you should upgrade PCOP To work around this problem disconnect the PCM cable from the PCM and press ALT Z again Wait for PCOP to display NO COMM Use the Enter key to get PCOP past the initial banner page then reconnect the PCM cable 1 Series 90 Programmable
65. Load command described in appendix C PCM Commands to load them to the PCM RAM Disk If it exists PCMEXEC BAT is always run on power up and a soft reset regardless of whether or not PCOP has stored User Configuration Data UCDF to the PCM Although PCMEXEC BAT can be thought of as a configuration tool its function is different from the UCDE A UCDF can define the entire operating environment of the PCM while PCMEXEC BAT is limited to defining the environment for application tasks Do not attempt to use botha PCMEXEC BAT file and UCDF configuration data There are subtle interactions between them which can prevent the PCM from operating as expected The most common use of the PCMEXEC BAT file is to run application programs Batch file commands can also be used to configure the user LEDs on the PCM and set the serial port communication parameters as described in appendix C PCM Commands Another way to create a PCMEXEC BAT file on the PCM RAM Disk is to use MegaBasic This example creates a file to run BASIC EXE with standard input standard output and standard error redirected to the NULL device Type the statements below with no line numbers so that MegaBasic will execute them immediately Open 5 PCMEXEC BAT Print 5 R BASIC EXE TEST PGM NULL NULL NULL D20000 Close 5 GFK 0255K Appendix D PCM Batch Files D 3 Appendix Example MegaBasic Program E The following program is a MegaBasic test program Rem
66. MEGABASIC BACKPLANE INTERFACE TEST ROUTINES Rem TEST PGM Rem Define local variables to be used during backplane testing Def integer INTVBL1 Def integer INTVBL2 Def integer SUCCESS Def real REALVBL1 Def real REALVBL2 Rem Define STATUS Structure Struct integer CUR STAT integer STAT HIST integer STAT TIME Dim STATSTRS 12 STABLE 1 EAD PENDING 2 RECEIVED 3 TIMEOUT 4 PENDING 5 RECEIVED 6 TIMEOUT 7 11 EJECT 12 0 irst make sure that all parts of CPU memory can be accessed 9100 5 P 91001 5 P 0001 5 P M001 12345 P TO01 12345 P SAI1 12345 PLC AQ1 12345 heck to make sure that SYSTATUSS function works correctly STAT Display Results of MegaBasic Test Program UCCESS 0 then Print Print 060828810 Test Program Completed Successfully Else Print ee Print MegaBasic Test Program Failed SUCCESS Failures Detected End GFK 0255K E 1 GFK 0255K 1 PLCLOC SUCCESS 1 Series 90 Progrmmable Coprocessor Moduleand Support Software User s Manual November 9 1 Print CPU WORD ACCESS FAILURE FOR PLCLOCS D ACCESS SUCCESS FOR PLCLOC UE IN CPU WORD ADDRESS 2101005 IS INTVBL2 SUCCESS SUCCESS PLCLOC Rem Define The CHECKPLC Procedure CHECKPLC PLCLOCS PATTERN TVBL1 PLCLOCS SYSTATUSS INTVBL1 U R CUR STAT gt lt STABLE TVB
67. MegaBasic workspace copy on the PCM Then when development is complete CRUNCH the application and save it to the PCM RAM Disk The total PCM memory used by both the RAM Disk and MegaBasic workspace copies of the CRUNCHed version will be about equal to the workspace used by the unCRUNCHed version CRUNCH does not work with MegaBasic programs in ASCII text file format Before you can CRUNCH an ASCII text program you must load it to MegaBasic and then save it to the PC The syntax of the command is CRUNCH filename lt newfilename gt where filename is the unCRUNCHed program and lt newfilename gt is the CRUNCHed version for example CRUNCH old pgm new crn CRUNCH prompts you for various option choices CRUNCH EXE has an encryption option which uses a cipher or scrambling technique to prevent unauthorized users from reading or modifying programs This feature can be used with PCM MegaBasic programs however the main program may not be encrypted A CRUNCHed unCRUNCHed main program can access subprograms or packages that are CRUNCHed or CRUNCHed and encrypted Make sure that you save your source program in a safe place before CRUNCHing or encryption There are no unCRUNCH or decryption utilities CRUNCHed and encrypted MegaBasic packages cannot be loaded to MegaBasic workspace using the MegaBasic LOAD command They must be loaded to the PCM RAM Disk using TERMF or PCOP See chapter 5 section 6 Loading and Storing PCM Dat
68. O fault records the reference address has this structure Integer Description IORA SEG Aone byte user reference indicator with the following typical decimal values 160 70 Inputtable oI 18or 72 Output table Q 10 Analoginputtable AI 12 Analogoutputtable AQ IORA ADD Atwo byte integer WORDS with range 1 to maximum table size 5 32 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K I O Fault Address Subrecords In the I O fault records the fault address has this structure Integer Description IOFA RACK e integer indicating the rack number for the source of the ault IOFA SLOTS 2 C NUS integer indicating the slot number for the source of the ault IOFA_BUS 2 C NUS integer indicating the bus number for the source of the ault IOFA BUS ADD t Ri integer indicating the bus address for the source of the ault IOFA PT OFFSET 0 PUR integer WORDS indicating the offset for the source of the fault If the fault is slot related the lower level parts of the fault address bus bus address and point offset may be set to 1 Known Problems with Fault Table Access There are several known problems with fault table access in early versions of the PLC CPU firmware for the Series 90 30 and 90 70 PLCs PLC Description Series 90 70 PLC The fault entry present bits in the PLC status word are not cleared if t
69. PCM 301 IC693PCM301 supports an optional EEROM device Attempting to format an invalid device produces this message Unknown device Killa task Format gt task id This command stops the specified task and frees the resources it was using The task is unlinked from all associated modules all link counts are decremented Timers used by the task are cancelled pending ASTS are discarded pending I O is aborted open files are closed and memory used by the task is returned to the operating system The task ID argument must be in the range of 4 OF hexadecimal If it is not or if the task is not active the PCM responds with the error message Can t terminate task Note PCM firmware version 2 51 or earlier limits the task number to a range of 4 7 GFK 0255K Appendix C PCM Commands C 9 Format lt options gt pc filename pcm filename This command directs the PCM to load the file specified by pc filename to pcm filename inthe PCM RAM Disk The file names are not case sensitive If the optional pem filename is omitted the PC file name will be used without any device or file path prefix If the file already exists in the PCM it will be overwritten If pc filename has the extension EXE and the file begins with a valid MS DOS relocatable EXE file header the PCM will attempt to convert the file to an absolute load image in RAM Two optional qualifiers may be specified with the
70. RESPONDING TIME OF LAST CPU RESP DATE OF LAST CPU RESP TIME AND DATE OF LAST CPU RESP VALID PLC RUN SIATUS PLC RUN STATUS VALID PLC CPU ID PLC CPU ID VALID PLC FAULIT BIT PLC FAUIT BIT VALID 5 38 READ PLC STATUS The READ PLC STATUS procedure gets the PLC status word from the short status data from the PLC CPU s Service Request Processor SRP This data is obtained either in a wait for data mode default or a NOWAIT mode In NOWAIT mode the user must check the PLC STATUS WORD VALID flag to determine when the data has actually arrived in the PLC STATUS WORD variable Also in NOWAIT mode the user can specify a repeat delay time so that the PLC status word is read and updated on a continuing basis When the delay time is specified as something other than 0 0 as fast as possible the TIMER1 interrupt is used to supply the delay between repeats of the read request The format of the READ PLC STATUS procedure call is xxx READ PLC STATUS wait flag delay where both parameters are optional and if omitted a single read of the PLC status word takes place in wait mode The wait flag is normally programmed with the NOWAIT constant 1 or true from the PCMEXT 214 package that is accessed automatically by the MegaBasic program The delay parameter is only used if NOWAIT mode is active and is the minimum number of milliseconds that the UTILITY PGM package will wait before rereading the PL
71. Rem of eight registers at a time The user can change the value of Rem 8 register or display a different group of registers No error Rem checking is done and the display freezes while the operator Rem is entering data Rem Def proc DO REG MENU Rem Local BASE REG Sets which registers to display Local WRITE REG Used for writing to PLC Local WRITE DATA Used for writing to PLC Local I General purpose loop counter Local s ES Used to write command line Local _CMD_LINES Used to clear command line Dim integer REG ARRAY 7 Used for reading PLC GFK 0255K Chapter 4 MegaBasic 4 29 GFK 0255K Rem Rem The following few lines draw the static part of the register Rem menu screen using the same format as the main menu Rem CLS ATTR CUR 4 10 Print 5 DW DH TOPS Print 5 REGISTER DISPLAY R 5 10 int 45 DW DH BOTS int 5 REGISTER DISPLAY R 20 20 int 5 1 DISPLAY NEW REGISTERS RY 215 20 int WRITE A REGISTER EXIT TO MAIN MENU 5 ENTER NUMBER Rem Build some strings for handling the command line Rem LINES ATTRS BLINK 4 ENTER NUMBER ATTRS ATTR_OFF LINES CURS 24 24 32 CURS 24 24 CLR Rem SYSLINK the REG ARRAY variable with 581 in the PLC Rem The SYSREAD command below will then copy the 8 registers Rem starting at 5521 to REG ARRAY Rem SYSLINK REG ARRAY R1 UINT BASE REGS
72. These commandsare restricted to MASTER and PEER INITIATOR CCM modes Chapter 3 CCM Operation 3 19 Subrange 6000 6099 6100 6199 GFK 0255K The following table lists the valid command words and the required parameters for each For more detailed information and examples of each command refer to the Series Six Data Communications Manual GEK 25364 Table 3 10 COMMREQ Data Block for CCM Commands Data Block Words X indicates Required indicates NotUsed Source Data Command Memory Command Block Word Address Description Size Word7 Word 12 Set Q Response 12 6001 SLAVE mode only 3 words 1770H x 3a X 3b Clear CCM Diagnostic 6002 Status Words 1 word 1771H Ll Read CCM Diagnostic 6 words Status Words to 2words 6003 SourceRegisters unused 1772H Software Configuration 1 15words 6004 See Serial Communication User s Manual 1774H GFK 0582 for details Read from Target to 6101 Source Register Table 6 words 17D5H Read from Target to 6102 Source Input Table 6 words 17D6H Read from Target to 6103 Source Output Table 6 words 17D7H Read Q Response to Source Register Table 4 X x X X 6109 17DDH 6110 Single Bit Write 4words 17DEH Write to Targetfrom 6111 Source Register Table 6 words 17DFH x x X X X Write to Targetfrom 6112 Source Input Table 6 words 17E0H Write to Targetfrom 6113 Source Output Table 6words 17E1H x x x x x 1 2
73. WRITE TIMEOUT Timer to start a new write has expired but the previous write request has not completed 0008 WRITE FINISHED Variable is waiting to be refreshed with the latest MegaBasic value so that the new contents can be written to the PLC 000B NO CPU No response from the CPU Status code 000B is an error code that occurs when the PLC does not respond to the PCM within 10 seconds of the PCM s request This generally indicates the PLC CPU is not functioning 000C XFER_REJECT Error response from the CPU Status code 000C is an error code that occurs when an invalid transfer request passes the PCM serror checking but is stopped by the PLC The most common reason for this is that a transfer to a PLC data area exceeded the bounds of that area For example if the PLC has 8K of register space a transfer of any length to R9000 would result in a status of 000C as would a 4 byte transfer 0 2 4 22 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Status History The STAT HIST contains information on what has happened to the variable since the last time the status was checked The status history contains several bit flags which are set upon various events Consequently it may be more convenient to deal with it as a bit string rather than an integer The status history is defined as follows 5 0 Read occurred Write occurred Read timed out before transfer
74. Write timed out before transfer PLC timed out during transfer PLC returned error during transfer Reserved all zeros Each time one of these events occurs the corresponding bit in the status history is set The bits are cleared each time the SYSTATUS function is called The timeout bits may be used with repeated backplane transfers to verify that a repeated transfer is occurring at the designated rate If either the PLC or PCM is delayed longer than the frequency value specified ina SYSREAD or SYSWRITE statement the read or write timeout bit is set This is particularly useful when sampling PLC values to ensure that the sampling is taking place at the designated rate Status Time The STAT TIME field of the status record may be used to find out the last time a variable was transferred This time is the number of milliseconds since the beginning of the current day counted from 0 00 00 000 midnight Each read or write in a Series 90 70 PCM takes about 3 milliseconds of internal processing time on the PCM plus 10 microseconds for each byte of the transfer If the type of PLC variable is different from the MegaBasic variable type additional time is required to convert each byte Transfers in Series 90 30 PCMs are slower If several variables are transferred as often as possible and the PLC sweep time is small it is possible that the PCM may spend most of its time transferring data the MegaBasic prog
75. again 1 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K s If you are using TERME reload BASIC PGM and other application files to the RAM Disk and attempt the operation again MegaBasic Program Save Versions Earlier Than 2 50 1 Ifthe PCM isin FACTORY mode a hard reset has been performed or no user configuration information is available MegaBasic occupies almost all of the available memory in the PCM A save to the RAM Disk in this situation could cause an insufficient memory error since not enough room has been reserved for a RAM Disk 2 Save the program to the PC hard disk by typing SAVE PC filename to ensure that your work is not lost You may load the program later by using the PCOP Utility functions or by typing LOAD PC filename in MegaBasic 3 Exit MegaBasic by typing BYE 4 Configure the PCM for BASIC using PCOP Take note of the MegaBasic RAM size assigned to MegaBasic but do not change this value at least initially If program development is still in process do not select to start the program on reset this is selected later when program development is more complete 5 Load the configuration to the PCM 6 Initiate a soft reset of the PCM by pressing the Restart Reset pushbutton for less than 5 seconds Re enter MegaBasic if desired and continue with program development If a start on reset had been selected use CTRL C to interrupt the program and
76. block has the following structure adress word adress 1 word 2 address 2 word 3 address 3 word 4 address 4 word MaximumCommunicationTime address 5 word 6 address 6 word 7 Data Block through address 11 word 12 Information required for the command block can be placed in the designated memory area using the MOV or BLKMOV function block GFK 0255K Chapter 3 CCM Operation 3 15 When entering information for the command block refer to these definitions Data Block This word contains the number of data words starting with the CCM Length command number at address 6 word 7 to the end of the command block inclusive The data block length of CCM commands ranges from 1 to 6 words Each CCM command has its own COMMREQ data block length Wait No Wait This word selects whether or not the program should wait for CCM Flag communications to be completed For Enter No wait 0 Waitforreply 1 The flag bit is stored in the least significant bit LSB at address 1 word 2 The rest of the word is filled with zeros If the command block is programmed using integer values this is taken care of automatically Caution Itis recommended that the COMMREO WAIT NOWAIT flag be set to NOWAIT Otherwise CCM communication time can significantly degrade the PLC sweep time If WAIT mode is used the sum of the maximum PLC sweep time plus the longer of the two COMMREO timeout values must be no larg
77. block in CPU version 4 4 or later to change the window to LIMITED mode In Series 90 30 CPUs LIMITED mode is fixed at 6 milliseconds SVCREQ Examples The following ladder program rung sets the Series 90 70 system window to LIMITED mode and the time limit to the value in the low byte of R00010 whenever contact 901100001 is active M0001 ll AND SVC WORD REQ l l l l CONST I1 QI ROO11 CONST FNC 0098 LEN 00004 00001 0010 2 RO011 PARM This ladder program rung sets the Series 90 30 system window mode to LIMITED mode whenever contact M00001 is active The window time is fixed at 6 milliseconds M0001 l MOVE 800 INT REO CONST 11 7 0 CONST FNC 00001 00000 LEN 00004 520010 PARM 3 30 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K 4 1 MegaBasic This chapter contains information on developing and running MegaBasic applications in the Series 90 PCM A PCM with firmware version 2 50 or greater may be configured for BASIC or BAS CCM operation using Logicmaster 90 configuration software PCMs with firmware version 2 04 or lower must be configured for BASIC using PCOP and other PCMs may be configured using PCOP One of these methods must be used before the PCM can be used for MegaBasic Refer to chapter 2 section 2 Configuring the PCM wit
78. changes are discarded at this time we will lose the change we made to the mode parameter That is the configuration would revert to CCM ONLY which is what it was before the configuration was frozen Since we have more parameters to edit Press the key RO 02 PCM301 lt S MODE PROGRAM PRT Again the asterisk indicates that the module s configuration is still frozen and the edited changes are not yet being used by the module To display the baud rate parameter for port 1 Press the key sence R0 02 PCM301 lt S DATA RT 1 19200 Notice that the asterisk remains to the left of the module s name This indicates that the module s configuration is still frozen It is possible to edit this and other parameters at this time however none of the changes will be used by the module until they are saved as indicated below Chapter 2 Installing the PCM 2 21 GFK 0255K To change the port 1 baud rate to 9600 Press the key R0 02 PCM301 lt S DATA RT 1 9600 To display the baud rate parameter for port 2 key six times R0 02 PCM301 lt S DATA RT 2 19200 Press the To change the port 2 baud rate to 9600 Press the key R0 02 PCM301 lt S DATA RT 2 9600 To save the edited changes that we have made Press the WRITH key SAVE CHANGES S lt ENT gt Y lt CLR gt N If the CLR key is pressed at this time the SAVE operation will be aborted Since we do want to save the changes Press the y key PROCESSING
79. consideration for NOWAIT I O programming occurs when a PC is attached to the PCM and is being used as both a file server and a terminal In this case the PC device and the COM port to which it is attached should not be accessed in NOWAIT mode unless it is certain that file traffic and terminal traffic do not occur at the same time Otherwise terminal traffic will interfere with the file server protocol Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 96 NOWAIT READ ABORT The NOWAIT READ ABORT statement is used to prematurely stop any NOWAIT_READs that are active on a particular channel If interrupts are being used for the NOWAIT RD handling an interrupt will be generated to signal the completion of the NOWAIT READ The error field ofthe PROCESS READ statement will indicate that the transfer was aborted The current length of the string will indicate how many characters were received before the abort Typically an application will program a timer at the beginning ofa NOWAIT READ If the timer elapses before the NOWAIT READ completes then the application stops the NOWAIT READ witha NOWAIT READ ABORT The format of a NOWAIT_READ ABORT is NOWAIT_READ ABORT lt channel handle gt All NOWAIT_READ operations active on the channel will be aborted by this statement NOWAIT_WRITE_ABORT The NOWAIT_WRITE_ABORT statement is used to prematurely stop any NOWAIT_WRITEs that are acti
80. continue development debug MegaBasic Data Size The PCM defaults the MegaBasic workspace size to the values given in table 4 1 in chapter 4 MegaBasic If an insufficient memory error is reported on an attempt to load a program to the MegaBasic workspace you may need to increase the RAM allocated to the MegaBasic workspace either by upgrading the memory board Series 90 70 PCM or PCM model Series 90 30 PCM or by changing the allocation setting The setting can be adjusted either by editing the PCMEXEC BAT file see appendix C PCM Commands or by using the PCOP utility An alternative solution if the program is too large for the RAM size available on the PCM is to CRUNCH the program This saves program storage space in the PCM RAM Disk Refer to chapter 4 MegaBasic for information on CRUNCH EXE Note Crunching removes comments and extra white space Be sure to keep a copy of the original program for documentation and maintenance purposes GEK 0255K Chapter 6 TroubleshootingGuide 6 5 Run Mode Errors If an application does not run when the PCM is placed in RUN mode with a soft reset it may be due to an insufficient memory error Place the PCM in PROGRAM mode by pushing the Restart Reset pushbutton for 10 seconds manually starting MegaBasic and manually run the program to see additional error messages reported by MegaBasic Loss of Characters MegaBasic Tx Rx Failure 1 For CCM refer to the information following this se
81. control character sequences from the PCM Choices are ENABLED or DISABLED If display is enabled control sequences are visible but have no effect If display is disabled control sequences perform their intended functions Controls character width and color monochrome features of the display Range is normally 0 3 and 7 Recommended values are 3 Color display video adapter type 1 2 3 or 5 7 Monochrome display video adapter type 4 or 6 Specifies whether TERMF will honor the Set 132 column escape sequence lt ESC gt 3h Choices are ENABLED or DISABLED It is recommended that you disable this feature unless you havea display adapter and driver software that interpret one of the two video modes listed above to display a 120 or 132 column screen If you enable this selection a second option allows you tospecify which display mode represents your long lines displaymode This selection is valid only for EGA VC adapters with the capability of using a user loaded character font for textdisplay The four font selections are 1 Normal font in ROM This allows for 25 lines of text per screen 2 Double dot fontin ROM This allows 43 to 50 lines of text per screen 3 Userspecified 256 character font This allows 10 to 60 lines of text per screen and up to 256 user defined characters 4 Userspecified 512 character font This allows 10 to 60 lines of text per screen and up to 512 user defined characters in
82. data 5 16 accessing PLC data 4 15 accessing the PCM s LEDs 4 25 additions or extensions created by GE Fanuc advanced programming 5 1 al serial input and output 5 91 backing up your program 4 5 backplane interrupts BASIC PGM 4 3 4 5 changing the MegaBasic workspace size CHG_PRIV 5 17 commands GFK 0255K MegaBasic Rx failure 6 6 modifying existing BASIC programs MS DOS version of MegaBasic 4 2 NOW AITI O statements example NOWAIT program 5 98 BE c m 5 97 NOWAIT WRITE ABORT 5 91 5 97 optimizing backplane communication 5 114 PCMEXEC BAT 14 11 6 5 PLC fault address subrecords 5 32 PLC fault table records 5 28 printing a MegaBasic text file 4 9 PRN FLIPGM 521 5 22 procedures BREAK OFE5 55 BREAK ON 5 55 CHECK CPU HEALTH 5 3645 46 CHG PRIV DIR ON READ PLC CPU ID READ PLC RUN STATUS READ PLC STATUS READ PLC TIME AND DATE RTS OFF RTS ON UTILITY INIT 5 49 program packages programming example using VME functions 5 110 programming examples 4 26 pro ag the PCM in MegaBasic 4 2 programming the PLC COMMREQ function block 5 68 RDEL 4 READ FAULT TBL READ FITPGM 5 22 repeated transfers of a MegaBasic variable SAMPLE PGM saving data through a power cycle or reset 4 6 screen ROMS commands 5 5 VT100 PGM GFK 0255K features not supported by the PCM 4 8 FLT_CHANGED FLT_PRESENT
83. data coherency 4 24 NOWAIT variable name Index Showing data 1165 0 PCOP screen goes blank or PCOP locks Storing data files up troubleshooting 62 PIC fault table entries 6 3 using TERMSET to configure TERME reset blinks user LED1 or LED2 6 1 226 TS_DAY TERMEEXE F 1 TS HOUR 5 32 TERMSET 3 2 26 2 31 6 9 TS MINS 5 32 TERMSETEXE F 1 TS MONS TESTBAT TS_SEC TEST FLTPGM 5 22 F1 TS YEARS Text editor using a text editor to create MegaBasic programs es U Time of day clock disabling synchronization messages C 8 U reconfigure the PCM command C 15 Time stamp subrecords 5 32 UCDF user configuration data 1 1312 10 structure Undefined local variable error code 113 TS_DAY TS HOURS TS MINS UNDERSCORE 5 7 TS MONS UNLINK statement 4 15 4 19 4 24 TS SECS 5 32 mee TS YEARS Unsolicited communication User configuration data UCDF 1 13 TIME AND DATE OF LAST CPU RESP VALID l SIME ASEULAST CPI RES User defined LED indicators 4 25 User defined LEDs USER1 and USER2 Timer interrupts pom User installed PCMEXEC BAT and TIMER1 5 39 HARDEXEC BAT files D 3 TIMER2 USER BKP MSG PROC 5 72 5 76 7 5 83 5 86 5 87 TIMER3 5 43 USERI TIMER4 5 46 5 49 1 USER2 TIMER5 5 48 Na Utilities PCM support for personal Timers 5 57 D Too man EI variables error code UTILITYDOC F 1 105 53 UTILITYPGM Troubleshooting 6 1 1
84. eens PCM Configuration Modes n Logicmaster 90 Configuration Mode 0 060000000000 eee Autoconfig Default Configuration Values 26 66666666 666666666666060 6 6606060002 Memory Types Supported by Series 90 CCM 1 662666660660066 eee eee Memory Types for the CCM Single Bit Write Function 6110 sna Series Six Memory Types NOT Supported by Series 90 00 1 00 eee Series One Memory Types vs Series 90 CCM Memory Types 00000 e ee ee Series Five Memory Types vs Series 90 CCM Memory Types 006066666666066 6606002 Scratch Pad Memory Allocation ssssseeee CCM Diagnostic Status Word Definitions sss Target SourceMemory Addresses 6266 666666666666060 626062002000000 eee Unit Lengths of Series 90 CCM Memory Types 60 606666660666606 eee eens COMMREO Data Block for CCM Commands COMMREQ Data Block for CCM Commands Explanations for Table 3 10 Series Six CCM Commands NOT Supported by Series 90 CCM CCM Serial Port Secondary Error Codes High Byte of Diagnostic Status Word 1 7 Default Program Workspace and RAM Disk Sizes 0 2 cece eee MegaBasic Error 01080 aae ee eee a Ee yh VT100 PGM Functions and Procedures 666626666 666666666660660 00600000000 Integer and String Constants 22211111 4 1 Request and Access Codes for PLC Memory Types 606666 666666666666060 6600002 READ
85. fast as possible the TIMER2 interrupt is used to supply the delay between repeats of the read request The format of the READ PLC TIME AND DATE procedure call is xxx READ PLC TIME AND DATE wait flag delay where both parameters are optional and if omitted a single read of the PLC time and date takes place in wait mode The wait flag is normally programmed with the NOW AIT constant if used at all The delay parameter is only used if the NOWAIT mode is active and is the minimum number of milliseconds that the UTILITY PGM package will wait before rereading the PLC time and date Anexample of the READ PLC TIME AND DATE procedure is Access utility pgm Access vt100 pgm READ PLC TIME AND DATE NOWAIT 5000 OLD PLC TIME AND DATE VALID CLS Repeat While OLD PLC TIME AND DATE VALID Next Print CURS 12 30 PLC DATE PLC TIME 1 5 CURS 24 OLD PLC TIME AND DATE VALID Next where the READ PLC TIME AND DATE procedure is used to set up a read of the time and date every 5 seconds Then the screen is cleared Every time the time and date is updated the date and the hours minutes part of the time is displayed in the center of the VT100 style screen Due to the slow update rate no attempt was made to insure that the time and date string variables are time coherent It is assumed that any processing in this case printing can be done before the next update arrives Chapter 5 Advanced MegaBasic Programming
86. file type Insufficient memory The PC file name may begin with a device name If there is no device name the default device PC is used to load the file A PC disk drive and file path specification may be included in pec filename as shown for the MegaBasic LOAD command in chapter 4 MegaBasic However if a PC disk drive is specified the PC device must also be explicitly specified for example L PC A MYFILE BIN The file name is not case sensitive S Save Format S pcm filename pc filename The S Save command causes a file named pcm filename in the PCM RAM Disk to be saved to a PC file If the optional pc filename is omitted the PCM filename will be used and the file will be saved to the current directory on the current disk drive If the file does not already exist on the PC it is created otherwise the existing PC file will be overwritten The pc filename mayincludeaPC disk drive and or file path as described above for the L Load command D file Directory Format D This command prints the names of the files in the PCM RAM Disk It returns no errors X eXterminate file Format X file name This command deletes a file named file name in the PCM RAM Disk An error is reported if the file is not found or is in use The specified file is deleted immediately There is no confirmation prompt nor is there any method for recovering a deleted file Note See appendix C PCM Commands
87. for an extended period of time the battery should first be disconnected However if it is to be stored as a spare for a running application you may wish to retain memory by leaving the battery connected 2 Connect the battery to either battery connector on the module If an old battery is present connect the replacement battery to the unused battery connector before disconnecting the old battery The tab on the connector should face to the right away from the module surface 3 Press down firmly to lock the battery connector in place but do not force the battery connector into place Do not discard the lithium battery in a fire Do not attempt to recharge the battery Do not short the battery The battery may burst burn or release hazardous materials Manufacturer s instructions are available upon request Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Battery 1 6 Serial Connectors The serial connectors on the PCM are used to communicate with external devices such as operator interface terminals bar code readers and programming devices The Series 90 70 PCM has two serial connectors each one supports both RS 232 and 135 485 operation The serial ports are identical and either port can be used for most applications The two ports are configurable for different communication parameters Note RS 485 is basically compatible with RS 422 devices Series 90 30 PCMs
88. from communicating with the CPU or BRM and must be eliminated This is not true of the Series 90 30 PLC system where empty slots are permitted 5 Ifthe PCM is a master on the network or initiating peer has the PLC ladder programming COMMREQ been done Is the PLC CPU in RUN mode If so have you checked the status word return from the CCM COMMREQ See chapter 3 CCM Operation If you see the entry other module software faults in the PLC fault table ensure that each COMMREO is not enabled until the previous COMMREQ has completed 6 Ifthe PCM is a slave or non initiating peer is the Port LED USR1 or USR2 blinking when the enquiry is sent from the initiating side If not check for a communications failure as described above Is the initiating device properly programmed 7 Ifsome CCM communication is obtained but a failure is occurring during part of the communication try selecting a different set of timeouts retries td value in Logicmaster 90 software or PCOP or fine tune the values using PCOP 8 Ifthis does not work call the GE Fanuc Hotline GEK 0255K Chapter 6 TroubleshootingGuide 6 7 L6 Configuration Problems Confirm that the PCM is in RUN mode that is it was powered up or placed in RUN mode by a soft reset to initiate the configuration If the PCM was hard reset most recently the configuration is not used a gt is returned to lt ENQ gt To begin the configured action initiate a soft reset of the PC
89. function at any time The forms of these statements are SYSREAD variable name NOWAIT frequency SYSWRITE variable name NOWAIT frequency status string SYSTATUSS variable name Parameter Description VariableName The name of the local MegaBasic variable In the SYSREAD statement this argument is the destination in the PCM for data to be read from the PLC CPU In the SYSWRITE statement itis the source for data to be written to the PLC CPU Any type conversion specified in the SYSLINKcommand that associated the MegaBasic variable with the PLC data is performed NOWAIT When this option is used the MegaBasic program continues to execute following the SYSREAD or SYSWRITE command rather than wait for the CPU to respond with the data The NOWAIT option is highly recommended fortime critical PCM applications A MegaBasiclogicalinterrupt is generated when the transfer has completed This allows the program to handle backplane traffic asynchronously with MegaBasicprogramexecution Refer to chapter 5 Advanced MegaBasic Programming for more information on backplane interrupts The SYSTATUSS function can then be used to determine when the data has arrived and if there are any errors This mode is useful when the CPU response time is long or when data is being transferredcontinuously When NOWAIT is not specified NORMAL or WAIT mode the MegaBasic program waits until the CPU has transferred the data before c
90. functions ATTRS BREAK_STATUS 5 55 CHECK_BREAK 5 55 CTS_STATUS curs 5 61 5 9 INTERRUPT 5 60 IOCTLS MV CURS NOWAIT READ 6 6 NOWAIT IO OUTPUT SYSTATUSS gathering PLC information from MegaBasic programs GEN TESTPGM GENERIC DOC 5 16 GENERIC PGM getting started with the MegaBasic interpreter HARDEXEC BAT I O fault address subrecords 5 33 I O fault table records I O reference address subrecords 5 32 input and ut to the PCM serial ports interfacing to the PCM hardware and Series 90 CPU 4 13 INTERRUPT statement 5 57 interrupts n with fault table access 5 33 loading and saving MegaBasic programs loss of characters 6 6 MegaBasic application does not run 6 2 Me ae blink LED program example 75 MegaBasic COMMREO example 5 72 MegaBasic program access to PCM dual port RAM MegaBasic program and data size Index Index 10 Index MegabBasic application does not run 6 2 MegaBasic operation 1 2 MegaBasic program packages 4 11 MegaBasicTX RX failure 6 6 MegaBasicPasswords 5 17 MegaBasicService request processor 5 18 MegaBasicSet graphic rendition SGR control string Memory insufficient memory error on the Series 90 30 1 on the Series 90 70 PCM 1 9 request and access codes for PLC memory types 5 19 Memory addressing 3 7 data length 3 8 target addresses 3 7 Memory types me
91. have a single serial connector that supports two ports One port has a fixed interface Port 1 uses RS 232 operation only The 160K PCM IC693PCM300 is restricted to using RS 485 on port 2 All other Series 90 30 PCM modules may select either RS 232 or RS 485 operation on port 2 The serial ports on almost all versions of the PCM are connected to electrical ground within the PLC Serial communication must be limited to distances of 50 feet 15 meters unless ground isolation is provided by an external device Failure to observe this caution may result in damage to the PCM or communicating device The serial ports on Series 90 70 PCMs using PCMA3 or newer hardware have limited isolation from electrical ground These ports can withstand 200 volts DC plus instantaneous peak AC between any serial port connector pin except shield and PLC frame ground This level of isolation is not adequate for many applications for example communication between devices on different power systems or where serial cables are exposed to intense electromagnetic fields For applications like these an external optical isolation device should be installed in the serial connection A WYE cable is supplied with each Series 90 30 PCM The purpose of the WYE cable is to separate the two ports from a single physical connector i e the cable separates the signals In addition the WYE cable makes cables used with the Series 90 70 PCM fully compatible with the Series 90 30
92. ignore it If a valid status pointer type was received add the offset to STAT PTRS Remember that the offset value in the COMMREQ is zero based add 1 to it The trim function removes the leading space which str adds when it converts numbers to strings ck ck ck ko k ko If STAT PTR gt lt then STAT STAT PTRS trim str STAT PTR OFFSET 1 Print The COMMREQ status pointer is STAT PTR 1 Repeat Next Proc end Chapter 5 Advanced MegaBasic Programming GFK 0255K Identifying the Source of Backplane Messages The PROCESS MESSAGE statement processes backplane messages from three sources COMMREO function blocks in the PLC program messages from the PLC CPU in response to generic requests and messages sent by another PCM or Series 90 smart module If your MegaBasic program can receive more than one of these message types it will need to examine each message to identify it All backplane messages contain two fields which can be used to identify them message type and source Here is a MegaBasic program fragment showing how to ext
93. installation there may be additional files in these directories Any files that are not listed in appendix F may be deleted from the hard disk in order to conserve storage space 3 The CLEANUP batch file in the PCOP directory may be used to delete unnecessary files To use it be sure that the hard drive where TERMF is installed is the current drive Then type the following at the MS DOS prompt CD PCOP CLEANUP 2 24 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Adding the PCOP Directory to the MS DOS Search Path The MS DOS operating system in your computer uses a search path to find programs that are not in the current directory The PCOP directory should be added to the search path so that TERMF and TERMSET can be used without typing the name of the directory where they are stored The MS DOS PATH command may be used to determine what directories are currently in the search path The PATH command can also be used to add the PCOP directory to the search path To determine what directories are currently in the search path type path at the MS DOS prompt and press the Enter key MS DOS will display a list of the directories separated by semicolons in the current search path on your computer s display If no search path has been defined the words No Path are displayed on the screen 1 the PCOP directory is not already included in the search path it should be added The s
94. is the problem continue with step 4 4 Reconnect the cable to the PCM If the programmer has more than one serial port be sure the cable is connected to COMI Set the programmer serial port to the PCM default settings To do this when using a computer as the programmer type TERMF DEFAULT DAT atthe MS DOS prompt and press the Enter key 5 Press and hold the Restart Reset pushbutton for 10 seconds to initialize the PCM to its factory default settings 6 Press the programmer Enter key while watching the USER1 LED for serial port 1 or USER2 LED for serial port 2 Each time the key is pressed the LED should blink If the PCM has been configured by Logicmaster 90 in BASIC or BAS CCM mode the Ready prompt should also be repeated on the programmer screen otherwise the gt prompt should appear If the LED does not blink or the Ready or gt prompt is not displayed either the connection from the programmer to the PCM is bad or the programmer hardware is defective 7 Cycle power on the programmer to make sure its serial port hardware is fully reset Problems with the programmer are very rare When they do occur they can often be fixed with a power cycle If your programmer is a computer type TERMF DEFAULT DAT again If the LED still does not blink when a key is pressed it is likely that there is a problem with the cable See appendix A PCM Cabling Information for information on PCM cables Occasionally problems occur with
95. listing of PRN FLT PGM for examples of the use of these structures TEST FLT PGM provides an example of the use of READ FLT PGM and PRN FLT PGM Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 22 READ FAULT TBL The Read Fault Table READ FAULT TBL procedure enables entries from either fault table to be read into a user supplied string The read performed by READ FAULT TBL is not destructive so that other users e g Logicmaster 90 software may read the same fault table entries The user supplied string must be at least 42 bytes long one fault record length The maximum number of fault records that may be read from the I O fault table is 32 Up to 16 fault records may be read from the PLC fault table The actual number of faults read from the table can be determined by looking at the NUM READS field of the appropriate header string IO FAULT HDR NUM READ or PLC FAULT HDR NUM READS depending on the selected fault table after using the READ FAULT TBL procedure The format for using the READ FAULT TBL procedure is xxx READ FAULT TBL str select start num Parameter Description String Thestring where the procedure puts the fault record s read from the PLCCPU Select IO FLT TBLor PLC FLT TBL Thedefaultis IO FLT TBL Start Thestarting fault record number to begin reading the fault table The defaultis 1 the first entry Number The number of fault reco
96. load additional packages into the MegaBasic workspace This feature permits a logically related collection of variables procedures and functions to be grouped together in a package The main program can then have a more compact easily understood structure The cost of storing multiple packages in the PCM is at most a few bytes per package The RAM Disk space needed to store several smaller packages is about the same as the space for the equivalent larger one The length of MegaBasic packages including the main program is limited to 64K bytes MegaBasic complains if you attempt to load a longer program in either ASCII text or processed format Consequently programs larger than 64K bytes must be divided into two or more packages Only the main program and the package which is currently executing need to be in MegaBasic workspace The DISMISS statement can remove a package from the workspace when its work is done making room for another package This technique permits significantly larger PCM applications because all the code does not have to be in MegaBasic workspace at once For more information on packages see the MegaBasic Programming Language Reference Manual GFK 0256 Changing the MegaBasic Workspace Size Under certain conditions it may be desirable to change the division of the PCM memory between MegaBasic workspace and RAM Disk For example if the MegaBasic program is fairly small but uses a lot of data you may want to use le
97. made using the input OP If byte data is specified only the lower 8 bits of MSK are used The result is then written back to the same VME address from which it was read When the operation is successfully completed the VMERMW function passes power to the right through the OK output For information on PCM module addressing using address and address modifier codes refer to General VME Information for the PCM presented earlier in this section Chapter 5 Advanced MegaBasic Programming 5 107 GFK 0255K VME Test and Set Function The VMETS function can be used to handle semaphores located in the dual port RAM of the Series 90 70 PCM The VMETS function exchanges a boolean true 1 for the value currently at the semaphore location If that value already was true then the VMETS function does not acquire the semaphore If the existing value was false the semaphore is set and the VMETS function block has control of the semaphore and the use of the memory area it controls The semaphore is cleared and ownership relinquished by using the VMEWRT function to write false 0 to the semaphore location The format of the VMETS function block is enable mI EM function OK logic address modifier semaphore acquired module address Parameter Description Enable Power flow input that when true enables the execution of the function Type Function type either byte or word to select the corresponding type of VME
98. may be configured to indicate serial port or backplane activity or they may be manipulated directly by a user program The default configuration is that USERI flashes when there is activity on port 1 USER2 flashes when there is activity on port 2 The configuration of the PCM LEDs cannot be changed with Logicmaster 90 software However it may be done with a PCMEXEC BAT file if your PCM has firmware version 2 50 or greater See appendix D PCM Batch Files for information on PCM batch files and appendix C PCM Commands for information on the B Configure LEDs command The PCOP configuration editor can also be used to give control of the LEDs to a MegaBasic program see GFK 0487 The SET LED statement is used by the MegaBasic program when an LED is configured to be under the control of MegaBasic This utility can be used to set an LED s state to ON OFE BLINK ONCE or BLINK CONTINUOUSLY The format of the SET LED statement is Set led led number operation code Parameter LEDNumber Description The number of the user configurable LED either 1 or 2 The state of the LED The four states are Operation Code 1 Turn LED on 2 Turn LED off 3 Blink LED once 4 Blink LED continuously If the LED is not configured to be under MegaBasic control the SET LED command has no effect However no error is returned The operating system maintains virtual LEDs for each task but only the configured task act
99. menu 2220 Rem 2230 CLS 2240 ATTR 2250 CUR 4 9 2260 Print 5 DW DH TOPS 2270 Print 5 INPUT TABLE DISPLAY 2280 CUR 5 9 2290 Print 5 DW DH BOT GFK 0255K Chapter 4 MegaBasic 4 31 GFK 0255K 5 INPUT TABLE DISPLAY DISPLAY NEW SET OF INPUTS WRITE AN INPUT EXIT TO MAIN MENU INK 5 ENTER NUMBER t 20 t 21 t 22 t 24 BL ie Prin CUR Prin CUR Prin CUR Prin CUR ATTR Prin ATTR Rem Build some strings for handling the command line ES ATTRS BLINK ENTER NUMBER ATTRS ATTR_OFF LI Rem CMD CLR CMD LINES CURS 24 24 32 4CURS 24 24 LINK the INPUT_ARRAY variable with 511 in the PLC SYSREAD command below will then copy the 64 inputs rting at 511 to INPUT_ARRAY INPUT ARRAY 511 BYTE 2015 1 S is the main processing loop for the input menu READ INPUT ARRAY Rem Read PLC inputs and display them 1 0 to 7 CUR 9 1 6 Print 45 SI 515 8 I BASE_INPUTS ATTR REVERSE Print 5 888 INPUT ARRAY I ATTR t I Check for input and process if necessary Note that the Input commands used below will cause the display to freeze while the operator is entering data It is possible to handle operator input using the inchr statement or with NOWAIT READs of the keyboard however a fairly complicated state machine would have to be used to figure out what to do when each key is struck i
100. no responsibility for the accuracy completeness sufficiency or usefulness of the information contained herein No warranties of merchantability or fitness for purpose shall apply Thefollowing are trademarks of GE Fanuc Automation North America Inc Alarm Master Genius ProLoop Series Three CIMPLICITY Helpmate PROMACRO VersaMax CIMPLICITY 90 ADS Logicmaster Series Five VersaPro CIMSTAR Modelmaster Series 90 VuMaster Field Control Motion Mate Series One Workmaster GEnet PowerTRAC SeriesSix Copyright 1993 1999 GE Fanuc Automation North America Inc All Rights Reserved Preface The Programmable Coprocessor Module PCM from GE Fanuc Automation North America Inc is a high performance microcomputer designed to perform coprocessor functions in a Series 90 PLC system It combines the function of the Communications Module CCM and the ASCII BASIC Module ABM used on the Series Six programmable logic controller PLC into a single module with significantly greater capacity and performance than that of the ASCII BASIC module Revisions to this Manual Changes have been made to this version of the PCM manual GFK 0255K to add information about CPUs on page 3 5 Series 90 70 and Series 90 30 Minor Type codes and page 3 29 minimum system window time values Additionally this manual describes configuration of the PCM using Logicmaster 90 configuration software however the PCM can also be configured with Control software For in
101. of zero to the PLC CPU If the user ladder program needs to know when the command is complete it can zero the status word before issuing the COMMREO and then check the status word for a non zero value Note It is strongly recommended that only one CCM COMMREQ be outstanding for each CCM port at any time The status word can be used to control the timing of COMMREQs See the example ladder program in section 6 of this chapter 2 CCM uses a status code value of 1 to indicate that the operation was completed without errors Refer to the table below for a complete listing of secondary error codes for CCM 3 Display the status word in hexadecimal format to read the two bytes of data When an error occurs the least significant byte is greater than 1 The following table lists the CCM serial port error codes that are reported as secondary error codes in the most significant byte of the COMMREO status word after the execution of a CCM COMMREQ These codes also appear in the least significant byte of CCM Diagnostic Status Word 1 Table 3 13 CCM Serial Port Secondary Error Codes High Byte of Diagnostic Status Word 1 Error Code Decimal Description 0 Successfultransfer 1 Atimeoutoccurred on the serial link 2 02 A COMMREO attempted to write data to a section of the CCM scratch pad that is permanently write protected by the CCM 3 A COMMREO attempted to read or write a non existentI Opoint 4 04 A COMMREO attempted to acces
102. on the input and output tables Table 3 1 Memory Types Supported by Series 90 CCM Table 3 2 Memory Types for the CCM Single Bit Write Function 6110 Bit Operation Bit Set Bit Set Bit Clear Bit Clear Those Series Six memory types that are not supported are listed in the following table Table 3 3 Series Six Memory Types NOT Supported by Series 90 CCM Bit Operation Bit Set Bit Set Bit Clear Bit Clear Bit Toggle Bit Toggle GFK 0255K CCM Target Table Register Table R Input Table 1 Output Table Q CCM Scratch Pad Diagnostic Status Words CCM Target Table Input Table 1 Output Table Q Input Table 1 Output Table Q CCM Target Table Absolute Input Override Table Output Override Table User Logic Quick Access Buffer Timers Counters Input Override Table Output Override Table Input Override Table Output Override Table Input Override Table Output Override Table CCM Memory Type rn CCM Memory Type CCM Memory Type Section 1 3 2 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 The next two tables compare the Series One and Series Five CCM memory types with those supported by the Series 90 CCM Table 3 4 Series One Memory Types vs Series 90 CCM Memory Types Series One CCM Series 90 CCM Register Table 3 Input Table Output Table 6 SeatchPad 5
103. on using TERMF to load data files from a personal computer PC to the PCM store data files from the PCM to a PC show a list of files stored in the PCM and delete PCM files Note Your PCM must have firmware version 2 50 or greater to use the techniques described in this section If your PCM firmware is version 2 04 or lower you should use PCOP to transfer files The MegaBasic LOAD and STORE commands work only with MegaBasic program files If you need to load or store data files or binary files containing MegaBasic functions and procedures such as the BITFUNCS BIN and BYTESWAP BIN files distributed with TERMF and PCOP some other method must be used There are two choices you can use either TERMF or PCOP Caution Using the MegaBasic LOAD command to load files which are not MegabBasic programs to the PCM will cause unexpected results The MegaBasic LOAD command modifies text files as they are loaded PCOP provides menu driven utility functions for loading and storing PCM files If you are uncomfortable with command line computer interfaces such as the MS DOS command line then PCOP is probably a better choice Refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 for details on using PCOP to load and store PCM files In order to transfer files with TERME you must exit from MegaBasic You can do this from the Ready prompt by typing the BYE command You may need to initiate a hard reset to get to the Ready
104. point p mode The receiver for the specified port is always enabled When PHYSICAL 422 or 485 all RS 485 line drivers for the specified port are enabled when the command is executed and remain on continuously In fullduplex 4 mode The receiver for the specified port is always enabled When PHYSICAL 422 or 485 the RS 485 line drivers for RIS and transmitted data outputs on the specified port are turned on immediately before transmitting and remain on until TURNOFFDELAY expires after the last character is sent At all other times these drivers are in their high impedance state tri stated In halfduplex 2 mode e The receiver for the specified port is disabled immediately before transmitting and remains off until TURNOFFDELAY expires after the last character is sent When PHYSICAL 422 or 485 the RS 485 line drivers for RIS and transmitted data outputs on the specified port are turned on immediately before transmitting and remain on until TURNOFFDELAY expires after the last character is sent At all other times these drivers are in their high impedance state tri stated Specifies the time in milliseconds between the end of the last outgoing character and the time RTS is turned off if applicable RS 485 line drivers are tri stated if applicable the receiver is enabled in half duplex mode if applicable and WAITmode output statements complete execution Available in PCM firm ware version 3 00 or later
105. points Refer to the next section for more information 4 Scratch pad definitions are not the same in the Series Five PLC and Series 90 PLC See table 3 6 for the Series 90 scratch pad layout Diagnostic status words and error code definitions are different in the Series Five PLC and the Series 90 PLC See table 3 7 for the Series 90 diagnostic status words and refer to table 3 12 for the Series 90 CCM error code definitions GFK 0255K Chapter 3 CCM Operation 3 3 CCM Scratch Pad The entire scratch pad is updated every time an external READ request is received by CCM with a memory type of 6 All scratch pad locations are read only The scratch pad is a byte oriented memory type Table 3 6 Scratch Pad Memory Allocation Run Status o fojo o sneno Command Status Type Major a in hexadecimal 010 4 ala Minor 2 in hexadecimal ID 7 ASCII characters termination character 0 CPU Firmware Revision No Major in BCD Minor in BCD PCM Firmware RevisionNo Major Minor Reserved 00H Node Typeldentifier 90 70 OCH 90 30 0DH 3b Reserved 00H Master Slave 1 90 decimal CCM CPU ID Peer to Peer 1 4 UniversalResponder 255 Sizes of Memory Types RegisterMemory Analog input Tabie Analog Output Table Input Table Output Tabie Internal Discrete Memory User Program Code See Note 5 Reserved 00H 3 4 Series 90 Programmable Coprocesso
106. program is executed MegaBasic Version 5 602 under PCM VTOS v2 50 IEEE Software floating point on an 80186 88 CPU Copyright C 1985 1990 by Christopher Cochran MegaBasic Support BBS 415 459 0896 PO Box 723 Fairfax CA USA 94930 Serial 0000 hello world Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 26 After pressing the PCM Restart Reset pushbutton again for 10 seconds to place the PCM in PROGRAM mode the example program distributed with TERMF and PCOP can be transferred to the PCM Because this is a large program there is a long delay after executing the LOAD command before the PCM again displays the Ready prompt Note that the LOAD command must specify PC as the source since the program is being loaded from the programmer MegaBasic Version 5 602 under PCM VTOS v2 50 IEEE Software floating point on an 80186 88 CPU Copyright C 1985 1990 by Christopher Cochran MegaBasic Support BBS 415 459 0896 PO Box 723 Fairfax CA USA 94930 Serial 0000 Ready load pc sample pgm 405 lines 15 529 code bytes Ready Now save this program as BASIC PGM Since the old copy of BASIC PGM still exists on the RAM Disk the PCM prompts as to whether to overwrite the old copy Ready save ram basic pgm RAM BASIC PGM file already exists OK y 405 lines 15 529 code bytes y This example program accesses one of the utility packages VT100_5 PGM i
107. prompt After you exit from MegaBasic you may not see a prompt on your screen until you press the Enter key Pressing the Enter key repeatedly will display a lt prompt on the same line each time you press it This prompt is from the PCM command interpreter The interpreter is in its PCOP mode and does not echo the keys you type to the screen You can switch to the interpreter s interactive DEBUG mode by typing two exclamation points and then pressing the Enter key For Release 3 00 or later the following message will appear INTERACTIVE MODE ENTERED type for a list of commands If your PCM firmware is a version lower than 3 00 you will see DEBUG rather than INTERACTIVE The full set of interactive mode commands is described in appendix C PCM Commands The commands used to load store delete and show a list of files in the PCM RAM Disk are described in the remainder of this section Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Section 6 5 50 L Load Format L pc filename pcm filename This command directs the PCM to load the file specified by pc filename to pcm filename in the PCM RAM Disk If the optional pcm filename is omitted the PC file name will be used but without any device or file path prefix If the file already exists in the PCM it will be overwritten Possible errors are File not found Illegal
108. register to be written always 870 Rem changes UNLINK the register after writing it 880 Rem 890 Print 5 CLR CMD LINES 900 Input 5 REGISTER TO WRITE WRITE REG 910 Print 5 CLR CMD LINES 920 Input 5 VALUE WRITE DATAS 930 SYSLINK WRITE DATA R str WRITE REG 515 UINT 940 SYSWRITE WRITE DATA 950 UNLINK WRITE DATA 960 Print 5 CLR CMD LINES 970 Print 5 CMD LINES 980 Case 3 990 EXT_MENU MAIN_MENU 2000 UNLINK REG_ARRAY 2010 Return 2020 Case end Rem Ignore all other characters 2030 Next Rem Go back to main menu 2040 Rem This is the input display subroutine It displays a block 2050 Rem of sixty four inputs at a time The user can change the value of 2060 Rem an input or display a different group of inputs No error 2070 Rem checking is done and the display freezes while the operator 2080 Rem is entering data 2090 Rem 2100 Def proc DO_INPUT_MENU 2110 Rem 2120 Local BASE INPUT Rem Sets which inputs to display 2130 Local WRITE INPUT Rem Used for writing to PLC 2140 Local INPUT DATAS Rem Used for writing to PLC 2150 Local I Rem General purpose loop counter 2160 Local CMD LINES Rem Used to write command line 2170 Local CLR CMD LINES Rem Used to clear command line 2180 Dim integer INPUT_ARRAY 7 Rem Used for reading PLC 2190 Rem 2200 Rem The following few lines draw the static part of the input 2210 Rem menu screen using the same format as the main
109. resident in PCM CMM memory GFK 0255K Chapter 3 CCM Operation 3 7 Examples To read target Series 90 inputs 9 through 16 into source Series 90 inputs 17 through 24 the source address is 17 the target address is 9 and the data length is 8 To read target Series One inputs 9 through 16 into source Series 90 inputs 17 through 24 the source address is 17 the target address is 2 Series One I O addressing is byte oriented and the data length is 8 To read target Series 90 input 27 into source Series 90 input 3 you must specify a source address of 1 a target address of 25 and a data length of 8 Inputs 1 through 8 of the source input table are overwritten with the values of inputs 25 through 32 of the target input table To read target Series One input 27 into source Series 90 input 3 you must specify a source address of 1 a target address of 4 and a data length of 8 Inputs 1 through 8 of the source input table are overwritten with the values of inputs 25 through 32 of the target input table Data length refers to the length of the data transfer The units are determined by the source memory type and are listed in the following table Table 3 9 Unit Lengths of Series 90 CCM Memory Types Memory Type Unit Length Length Accessible 1 Registers Register s 2 3 Inputs and Outputs Multiple s of 8 Points 6 Scratch Pad Byte s 9 Diagnostic Status Words Word s 13 14 BitSetInputs Outputs 1 Point 1bit 1 Point 1718 Bit
110. than or equal to the PLC CPU sweep time when the PLC CPU communications window modeis LIMITED WINDOW Parameter Frequency Chapter 4 MegaBasic GFK 0255K Status Record Ifa SYSREAD or SYSWRITE iscalled without the NOWAIT argument any errors that occur during the transfer cause an error trap Otherwise the SYSTATUSS function is used to monitor variables that have been SYSLINKed to the PLC CPU It is called with a MegaBasic variable name as its argument It returns a string record containing three integers 1 The first integer holds the current status of the PLC variable 2 The second integer contains a status history 3 The third integer specifies the time that the variable was last updated The status record is defined as follows Struct Integer CUR STAT integer STAT HIST integer STAT TIME Current Status The possible valid CUR STAT codes are listed as hexadecimal values in the following table Code Status Description 0001 STABLE Variablehas been linked but is not currently being transferred 0002 READ PENDING Variable is being read from the CPU 0003 READ RECEIVED Variable has been read and is waiting for a timer to start a new read 0004 READ TIMEOUT Timer to start a new read has expired butthe previous read request has not completed 0005 WRITE PENDING Variable is being written to the CPU 0006 WRITE RECEIVED Variable has been written and is waiting for a timer to start a new write 0007
111. the PCM or PC serial port hardware 8 Press CTRL BREAK or ALT Z to exit TERME If PCOP establishes communication with the PCM but the PCOP status never switches to ONLINE refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 for additional suggestions GFK 0255K Chapter 2 Installing the PCM 2 33 This chapter contains information relevant to the operation of the CCM communication protocol on the Series 90 PCM The PCM must be configured for CCM operation using Logicmaster 90 configuration software or PCOP before attempting CCM communication Refer to chapter 2 section 2 of this manual for a guide to configuring the PCM Page 32 3 7 3 12 3 19 3 23 3 25 3 28 Comparisons of the CCM implementations in Series 90 Series Six Series Five and Series One PLCs are included in sections 1 and 2 of this chapter to assist those who are already experienced in the operation of CCM on other GE Fanuc programmable logic controllers If you need information on Series 90 CCM only skip to section 3 of this chapter 3 1 CCM Operation This chapter contains the following sections Description Section 1 defines the memory types for the Series 90 PLC Memory allocation for the CCM scratch pad and diagnostic status words is also described in this section Section 2 explains the addressing conventions and data lengths for each memory type Section3 describes the Communicati
112. the 64 outputs Rem starting at 501 to OUTPUT ARRAY Rem SYSLINK OUTPUT ARRAY Q1 BYTE BASE OUTPUTS 1 Rem This is the main processing loop Rem Repeat SYSREAD OUTPUT ARRAY Rem Read PLC outputs and display them For 1 0 to 7 CUR 9 1 26 Print 5 0 515 8 I BASE_OUTPUT ATTR REVERSE Print 5 8B8 OUTPUT 1 ATTR ext I Rem Check for input and process if necessary Note that the Rem Input commands used below will cause the display to freeze Rem while the operator is entering data It is possible to handle Rem operator input using the inchr statement or with NOWAIT READs Rem of the keyboard however a fairly complicated state machine Rem would have to be used to figure out what to do when each key Rem is struck Rem EYS inchr 5 1 0 0 Case begin on KEYS Case 1 Rem To display new outputs first UNLINK with Rem the old outputs and SYSLINK with the new ones Rem The SYSREAD at the top of the loop will then Rem read the outputs from the new location Rem Print 5 CLR CMD LINES Input 5 NEW OUTPUT TO DISPLAY BASE OUTPUT UNLINK OUTPUT ARRAY SYSLINK OUTPUT ARRAY Q strS BASE 515 BYTE Print 5 CLR CMD LINES Print 5 LINES Case 2 Rem To write an output SYSLINK with the output Rem which is to be written and do a SYSWRITE to write Rem the data Since the output to be written always Rem changes UNLINK t
113. the I O fault table is placed in the string FLTS and then deleted Note the default selection of the I O fault table 50 Access READ FLT pgm 100 Dim FLTS 42 600 RDEL FAULT TBL 5 5 24 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K FLT_PRESENT The Fault Present FLT PRESENTS function checks either fault table to see if there are faults present in the table The return value of the function is a boolean true false 0 value The return value is true if faults are present in the selected table and false if there are no faults The format for using the FLT PRESENTS function is xxx result FLT PRESENTS select Parameter Description Select IO FLT TBLor PLC FLT TBL A boolean true falseorl Ovalue The following example uses the FLT PRESENTS function Access READ FLT pgm If FLT PRESENT Z PLC FLT TBL then Print There are faults in the PLC fault table eise Print The PLC fault table is empty This time the FLT PRESENTS function is used to check the I O fault table Access READ FLT pgm If FLT_PRESENT then Print There are faults in the I O fault table eise Print The I O fault table is empty 1 Note When the optional parameter for selection of the fault table is omitted the parentheses around the parameter list must also be omitted GFK 0255K Chapter 5 Advanced MegaBasic Pr
114. the PCM to the programmer 1 Connect the cable between the PCM programmer port usually port 1 and the serial port on the VT100 or OIT terminal or IBM PC XT PC AT PS 2 Workmaster Workmaster II or Cimstar I industrial computer If you are using a computer as the programmer be sure the cable is connected to the serial port COM1 or COM2 specified by TERM DAT If you are using PCOP refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 for additionalinformation on establishing communication with the PCM 2 Ifyou are using a computer as the programmer type TERMF at the MS DOS prompt and press the Enter key 3 Press the PCM Restart Reset pushbutton for 10 seconds to initiate a hard reset and place the PCM in programming factory mode 4 Ifthe PCM has firmware version 2 50 or greater and has been configured using Logicmaster 90 software for BASIC or BAS CCM mode the MegaBasic banner should be displayed at the top of the screen followed by the Ready prompt MegaBasic Version 5 602 under PCM VTOS v2 50 IEEE Software floating point on an 80186 88 CPU c Copyright 1985 1990 by Christopher Cochran MegaBasic Support BBS 415 459 0896 PO Box 723 Fairfax CA USA 94930 Serial 0000 Ready With other Logicmaster 90 configuration modes you should see a lt prompt from the PCM command interpreter If your PCM has firmware version 2 04 or lower you must use PCOP to program the PCM VT100
115. the PLC CPU ID string is read in NOWAIT mode After checking that the data has arrived the PLC CPU ID string is printed Another example of the READ PLC CPU ID procedure is 50 Access utility pgm 100 READ PLC CPU ID 110 Print PLC CPU ID where the PLC CPU ID is read in wait mode and then printed Chapter 5 Advanced MegaBasic Programming 5 45 GFK 0255K CHECK CPU HEAITH The CHECK CPU HEALTH procedure checks that the PLC CPU is still alive and talking to the PCM by reading the short status data from the SRP on a periodic basis This data is obtained only in NOWAIT mode The user must check the CPU RESPONDING flag to determine if the CPU is still responding In addition the user may check the TIME OF LAST CPU RESP and DATE OF LAST CPU RESP string variables for a time stamp of the last CPU response These two string variables are known to be valid when the TIME AND DATE OF LAST CPU RESP VALID logical flag variable is set to true The user is also permitted to specify a repeat delay time so that the PLC is checked on a continuing basis When the delay time is specified as something greater than 0 the TIMER4 interrupt is used to supply the delay between repeats of the read short status request When the repeat delay is set to zero or negative then the checking of the PLC CPU s health is stopped The format of the CHECK CPU HEALTH procedure call is xxx CHECK CPU HEALTH delay where the parameter is optional and if omitt
116. the PROCESS MESSAGE statement puts the message header into it Tables 5 9 and 5 10 describe the header format lt header string gt lt message string gt This optional parameter contains the name of a string variable which has been dimensioned to at least 256 bytes After the PROCESS_MESSAGE statement is executed it may or may not contain data The current length indicates whether there is data and if so how much The actual data format depends on the application Note If the optional message string parameter is omitted and the message included a message string the data in the message string will be lost Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 64 After the PROCESS MESSAGE statement is executed the header string variable will contain this data Table 5 10 Structure of Backplane Messages Status 2 bytes 2 Reserved 3 bytes 5 Priority 1 byte 6 Application Defined 1 byte 7 Message Type 1 byte 8 Source 4 bytes 12 Destination 4 bytes 16 Reserved 0 or 8 bytes Application Defined 16 or 8 bytes 32 The parts of backplane messages are explained in the following table Table 5 11 Backplane Message Fields Field Description Status This field is zero when there are no errors All non zero status values are error values from the operating system Priority Specifies whether the message was sent high or low priority Bit 7 is set to
117. the names of the task s code and environment modules C 12 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K C 13 set protection level Format Q file name protection level This command is used to change the protection level of a module or modules on the PCMRAM Disk Level Description 0 Unprotectthe file the file is not checksum protected and may be freely written The checksum is not verified on power up or reset 1 Protect the file a checksum is calculated for it and it may no longer be written to On power up or reset the checksum of the module is verified and if itis not correct the module is discarded Appendix C PCM Commands Q GFK 0255K lt options gt R file name Format This command causes the PCM to run the executable file specified by file name The following options are available Description Redirectstandard output to the channel specified by outchnl Choices are 0111 COM2 RAM pcm filename and PC pc filename where pcm filename and pc filename arethe names of PCM RAM Diskand PC files respectively A device must be explicitlyspecified for files the colon is required A pc filename may contain a PC device and orfilepathspecification R MYFILE EXE PC C backsl MYDIR backsl1 MYFILE OUT Take standard input from the channel specified by inchnl Choices are identical to
118. the program waits in an endless loop for a COMMREO to be received When a COMMREO message arrives USER MSG PROC puts it into CMRO HDR by calling PROCESS MESSAGE at line 630 This version of USER BKP MSG PROC also pocesses messages in a loop and normally exits at line 640 the second time through When there is a message CMRQ_RCVD is set to one in line 730 and CMRQ TXT is tested in line 740 If CMRQ TXT contains no data the status pointer in CMRQ_HDR starts at character position 17 in CMRQ HDR there are 12 data bytes or less and the data starts at character position 21 Twelve bytes are are copied to CMRQ DATAS in line 780 because the actual data size is unknown If there is data in CMRQ_TXTS the status pointer in CMRQ HDR starts at character position 25 The data size is found from the current length of CMRQ TXT and the actual number of data bytes is copied to CMRQ DATAS in line 830 The status pointer type is in a single byte whose position in CMRQ_HDR is stored in Itis converted from a character to a value in line 890 The status pointer offset value is a 16 bit unsigned value MegaBasic has no built in facility for extracting two characters from a string and converting them to an unsigned integer so line 900 does it the crude way Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 76 The CASE block beginning at line 910 converts any one of the status po
119. the second example for the ATTR function is repeated using the ATTR statement Access vt100 pgm Print CURHOME ATTR ATTRIB_OFF BLINK BOLD Print Working ATTR Print I think Series 90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K ATTR 5 12 MV 5 The MV CUR function formats a relative cursor movement control string for later display on a VT100 terminal or other compatible display device The optional list of parameters specifies the desired direction for the move and the count of how many cursor positions to move in the selected direction The list of directions that may be specified are C UB C DN C RT and C LE All parameters are optional The count defaults to one The direction defaults to C UP for the first pair and no action for the rest of the pairs If the final parameter in the list is a direction specifier the count associated with that move is one location The format of the MV_CURS function is xxx A MV CUR dirl cntl dir2 cnt2 Argument Description Direction x Pairsofintegers specifying the direction and count for each cursor and move The dirl cnt1 pair is processed first then the remaining pairs Count x are added to the resulting control string before the function completes In practical terms the maximum number of parameters for this function is 4 2 pairs since any location on the VT100 screen can be rea
120. true enables the execution of the function Type Function type either byte or word to select the corresponding type of VME bus access to be performed Length Aninternal parameter that depending on the function type specifies the number of bytes or words to be transferred AddressModifier Hexadecimal value coded to specify the address modifier for the PCM The PCM AM code is always 39H see above Address A double word specifying the hexadecimal address where the first word or byte is read from the VME bus It may be a constant or the reference address of the first low word of two words containing the module address The address is based on the rack and slot where the PCM is located Refer to Address Allocation by Rack and Slot in this section OK Power flow output that is true when the function is enabled and completes successfully Q Specifies the first PLC user reference location into which the data read from the PCM is to be stored When the VMERD function receives power flow through its ENABLE input the function accesses the PCM at the specified address ADR and copies LEN data units words or bytes from the PCM to PLC locations beginning at the output parameter Q When the operation is successfully completed the VMERD function passes power to the right through the OK output For information on PCM module addressing using addresses and address modifier codes refer to General VME Information for the PCM pr
121. was received e Aninvalid ETB character was received e Aninvalid ETX character was received Aninvalid LRC character was received Aparity framing or overrun erroroccurred CCM expected to receive an EOT character from an external device and did not receive it CCM expected to receive an ACK or NAK character and did not receive either one Communication was aborted when CCM did not receive a valid acknowledge to a master enquire sequence after 32 attempts or a number specified by the configuration Communication was aborted after a peer enquire was NAKed 32 times by the external device or a number specified by the configuration Communication was aborted when the CCM did not receive a valid response to a peer enquire after 32 attempts or a number specified by theconfiguration Atimeoutoccurred during an attempt to transmit on a port due to CTS being in an inactive state too long Anerroroccurred when data was being transferred between the CCM and the Series 90 CPU Aparity framing or overrun erroroccurred during a serial header transfer Aparity framing or overrun erroroccurred during a serial data blocktransfer Bad Q Responsereceived COMMREO attempted to initiate conversation on a port in use The COMMREQ command number is invalid Aninvalid COMMREO data block length was specified The COMMREO is invalid on a peer port The COMMREQ is invalid on a slave port The COMMREO is valid only on a master port
122. were successfully completed and the configuration data for the module is good Flashing TheLED flashes during power updiagnostics Note The PCM has a hardware watchdog timer that is periodically reset by the PCM software If the watchdog timer expires the PCM stops functioning and the OK LED turns off GFK 0255K Chapter 1 Introduction 1 5 User Defined LEDs USER1 and USER2 The remaining two LED indicators USER1 and USER2 are user definable LEDs By default these LEDs blink to indicate activity on the serial ports USER1 blinks when port 1 sends or receives USER2 blinks when port 2 sends or receives The use of either or both user LEDs may be redefined A lithium battery is installed as shown in figures 1 1 and 1 2 This battery maintains user memory when power is removed Before the battery reaches the end of its useful life a low battery fault is reported in the PLC fault table See tables 1 1 and 1 3 for replacement battery catalog numbers When replacing a lithium battery be sure to connect the new battery into the unused PCM battery connector before removing and discarding the old battery Use the following procedure to replace the battery 1 Open the front cover Refer to figures 1 1 and 1 2 for the location of the battery on the module For a new PCM the battery is not connected Note When the PCM is to be stored
123. with the PCM A group of PLC functions blocks is available in Logicmaster 90 software to allow a Series 90 70 PLC CPU to communicate with VME modules including the PCM These functions include VME Read VMERD e VME Write VMEWRT e VMRead Modify Write VMERMW VME Test and Set VMETS Each of these function blocks is discussed in detail later in this section Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 100 Some Rules for VME Bus Operations in Series 90 70 PLCs VME bus block move transfers are not supported by Series 90 70 PLCs Do not place the PCM or any other GE Fanuc board in a standard VME rack GE Fanuc boards must be installed only in Series 90 70 PLC racks For more information about VME in the Series 90 70 PCM refer to the Series 90 70 Programmable Controller User s Guide to the Integration of Third Party VME Modules GFK 0448 General VME Information for the PCM When the PCM is used for VME functions it should be configured in the Logicmaster 90 configuration package That is configure the PCM in the same way it would be selected for non VME functions The PCM should not be configured as a foreign VME module Addresses on the Series 90 70 VME bus consist of two parts an address modifier AM code and a 24 bit address The AM code consists of 6 bits and is used to select the type of VME access e g the number of address bits used T
124. with the transfers For repeated transfers the MegaBasic program is periodically interrupted in order to move data in and out of MegaBasic variables If logical interrupts are disabled either explicitly or by executing an instruction which takes a long time the variables are no longer updated For the SYSREAD statement the PCM continues to read data from the PLC When interrupts are re enabled the MegaBasic variable is updated to the most recent PLC value For the SYSWRITE statement writes to the PLC are suspended until interrupts are enabled If the frequency argument is used witha SYSREAD or SYSWRITE statement to specify the repetitive update of a variable and at some time the program wishes to stop repetitive transfers the program must execute a new SYSREAD or SYSWRITE command for the variable without the frequency argument The frequency of transfers can also be changed by executing a new SYSREAD or SYSWRITE command with a new frequency argument When a Series 90 70 PCM MegaBasic application needs to obtain PLC CPU data as often as it is updated in the CPU once per sweep the PLC communications window mode should be set to RUN TO COMPLETION defaultsetting If there are too many requests or if there are several PCMs this may actually cause the PLC CPU watchdog timer to halt the CPU In this case reduce the number of requests or the number of PCMs in the system or runin LIMITED WINDOW mode The NOWAIT frequency should be greater
125. 0 30 COMMREO has no OK output OK and FT may have these states ENable Error OK output FT output active no true false active yes false true notactive no execution false false In NOWAIT mode a COMMREOQ always passes power flow to the OK output whenever it executes In WAIT mode the function passes power flow to the OK output unless the timeout expires before the COMMREQ is completed or a zero timeout period is specified Then OK remains inactive and FT becomes active The FT output also becomes active in WAIT or NOWAIT mode if There is no PCM or other intelligent module in the rack and slot specified by the SYSID input 6 The data length specified in the command block is zero In WAIT mode the FT output also becomes active if The PCM port specified by the TASK input is not configured as a CCM master or peer CCM is not enabled or the PCM has been hard reset In either WAIT or NOWAIT mode a BAD TASK ID fault is logged in the PLC fault table If there are errors in the portion of the command block used specifically by CCM these errors are reflected in the value returned in the status location and not in the FT output Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K TASK OK and FT 3 14 Other COMMREQ Faults If the CCM status pointer address specified in the command block does not exist the status information returned by CCM will be
126. 0 5 50 5 5 5 5 oOo oO 0 O00 GO eo 25 PIN FEMALE gt SERIES 90 30 PCM SLAVE 5 55 0 5 5 5 5 2 0 5 0 0 0 0 2 eo 25 PIN FEMALE PTIONAL BASED IN CONFIGURATION Ol 0 PIN 13 25 21 12 24 10 22 11 23 PIN MAKE CONNECTIONS INSIDE D CONNECTORS x 6 X101 XI TO OTHER POM s SHIELDED TWISTED PAIRS UP TOA MAXIMUM OF 4000 FEET 1200 METERS MAXIMUM OF 8 PCM s ON A MULTIDROP PIN 21 18 25 12 24 10 __ 22 11 23 WHEN WIRING RS 422 485 MULTIDROPCABLES REFLECTIONS ON THE TRANSMISSION LINE CAN BE REDUCED BY CONFIGURING THE CABLE IN A DAISY CHAIN FASHION AS RTS A RTS B CTS A CTS B ov SHLD 25 PIN MALE PCM SLAVE 1 XN ALSO IT IS RECOMMENDED TO MAKE ANY NECESSARY CONNECTIONS INSIDE THE CABLE CONNECTOR TO BE MOUNTED ON THE PCM IT IS NOT RECOMMENDED TO USE TERMINAL STRIPS OR OTHER TYPES OF CONNECTORS ALONG THE LENGTH OF TERMINATIONS ON SIGNAL RD WILL BE SERIES 90 30 PCM MASTER 5 50 5 5 5 50 5 50 5 5 5 0 5 0 0 gt l 25 PIN FEMALE NOTE SHOWN BELOW MASTER PCM SLAVE 3 THE TRANSMISSION LINE
127. 0 Software for more information on using Logicmaster 90 software to assign the CCM CPU ID The automatic default configuration provided by the Series 90 30 PLC model 331 CPU sets the CCM CPU ID to 1 on both ports A CPU ID value of 1 is also the initial default configuration from Logicmaster 90 software The value of the target ID number may be from 1 to 255 in PEER TO PEER mode or from 1 to 90 in MASTER SLAVE mode Target IDO is reserved Any peer CCM device regardless of its ID responds to target ID 255 Specifies the type of user reference being accessed in the CCM target device There are nine accessible Series 90 target memory types 1 2 3 6 9 13 14 17 and 18 The memory types associated with each number are listed in chater 3 section 1 Series 90 CCM Target Memory Types Other CCM devices support different types Specifies the address within the CCM target device where the data transfer is to begin The address range for each Series 90 memory type is listed in table 3 8 Note For both target memory type and target memoryaddress error checking is done by the non initiating device and not by the initiating PCM Consequently Series 90 CCM can initiate requests for target memory types and addresses which are invalid for Series 90 targets as long as the target device is not a Series 90 PLC Specifies the length of the data transfer The units are determined by the source memory type which is specified by the command numbe
128. 10 140 remove any messages that may have been received by the PCM before this program was started Applications should flush the incoming buffer in this way Lines 150 160 keep MegaBasic from terminating the program Lines 80 100 install a user procedure called USER BKP MSG PROC for the COMMREQ interrupt The procedure processes any received messages until the message string CMRO HDR is NULL indicating no more available messages PROCESS MESSAGE fills CMRO HDR and CMRQ TXT with the next incoming message Note that CMRQ_TXT is not used in this example Also note that the REM statements on lines 250 270 can be uncommented to display the actual message contents to the screen Line 280 converts the first and only word in the COMMREO data to an integer and stores the value in LED CMD The IF statements in lines 290 330 determine the proper action to take based on the value of LED_CMD Note that if the program needs to return a status for the COMMREO to the PLC a SYSLINK to R200 in the main program and a line at 205 to SYSWRITE a value to R200 would be added The format and value of R200 is totally user definable Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 72 02 21 92 09 07 GE FANUC SERIES 90 30 90 20 DOCUMENTATION v3 00 MegaBasic COMMREQ example START OF LD PROGRAM MB CRQ3 J VARIABLE DECLARATIONS BLOCK DECLARATIONS START OF PROGRAM LOGIC CREE 2 KU
129. 255K Series 90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 ix Contents Section 3 Accessing P oL and Password Protected Data 5 16 CHG TRV ier REPAS 5 17 SMSG WTEXT ut tb te e SR E ee ee Ped licec 5 18 Section 4 Access to PLC Fault Tables and PLC Status 5 21 READ FAULT TBL ek eme xy ed ade acetals hein 5 23 ROFL STB 0 EAR e 5 5 24 BEET 5 mui teo RE e e e a e Da 5 25 FLOC HANGED D i 5 26 WORDJ3AG ete S dx ee ac e RD Re E 5 27 Fault Table Header Records 0 0 cee cece ce ence eee 5 28 PLC Fault Table Records 2222222222 eee eens 5 28 I OFault Table Records 1 0 0 0 000 cc RR 5 29 Short Status Records 2 2 2 5 bx ehe eti d qe 5 30 Time Stamp Subrecords 06 5 32 PLC Fault Address Subrecords 2222222222 5 32 I OReference AddressSubrecords 220022222 5 32 I OFault Address Subrecords cece cece eens 5 33 Known Problems with Fault Table Access 2222222222 5 33 Section 5 Gathering PLC Information from MegaBasic Programs 5 34 READ PLE STATUS gt patos actos ate ae 5 39 READ PLC TIME AND eee eee eee 5 41 READ PLC RUN STATUS 0 0 cece ne 5 43 READ PLC CPU ID sitze de P e e o d ud 5 45 GHECK CPU HEALIH
130. 26 the MS DOS search path 2 25 communication failure 6 2 6 3 DEFAULTDAT 6 2 Deleting 681 0 descriptions of files placed on the hard disk during INSTALLJF 1 ALM_RD PGM ASMCHK PGM ASMDEFS ASM ASMPKG BAT BINARIES DOC BITFUNCS ASM BITFUNCS BIN F 1 BYTESWAPBIN CLEANUP BAT CRUNCH EXE DEFAULT DAT EXAMPLES DOC GEN TEST PGM F 1 GENERIC DOC GENERIC PGM GRAPH PGM INSTALL DOC MBCRC PGM PORT CTL BIN PRN FLT PGM F 1 READ FLT PGM README DOC UTILITY DOC UTILITY PGM VT100 PGM F 1 VT100_5 PGM installation and config ration 2 24 Loading data files 2 31 local configuration file Index 17 ERASE EOL 5 7 ERASE_LINE ERASE_SCREEN 5 7 ERASE TOP 5 7 RESTORECURS 5 7 SAVECURS 5 7 SW SH 5 7 String record 4 24 Support utilities PCM for personal computers SVCREQ 3 28 example 3 30 FNC parameter 3 28 PARM parameter 3 29 SW_SH 5 7 SYSLINK statement 4 15 4 17 5 72 5 77 arguments CPU symbol 4 17 handle 4 17 local name 4 17 type examples using the SYSLINK statement 4 18 SYSREAD short status records 5 30 SYSREAD statement 4 15 4 22 5 114 5 115 arguments frequency 4 21 data coherency 4 24 NOWAIT variable name SYSTA function System communications window System overview 1 1 System window 3 28 SYSWRITE statement 5 60 5 1 5772 arguments frequency 4 21
131. 5 Advanced MegaBasic Programming 5 95 GFK 0255K NOWAIT CLOSE The NOWAIT CLOSE statement is used to close a channel that has been opened for NOWAIT access Once a channel is closed subsequent NOWAIT READs and NOWAIT WRITEs to the channel result in errors although all outstanding transfers are completed The format of NOWAIT CLOSE is NOWAIT CLOSE channel handle NOWAIT SEEK The NOWAIT SEEK statement is used for setting the file pointer of a NOWAIT channel This is mainly used when accessing files over the PCM s remote file server Its format is NOWAIT SEEK channel handle position Since the completion of a NOWAIT SEEK does not generate an interrupt any error that occurs ona NOWAIT SEEK is not recognized until a subsequent NOWAIT READ or NOWAIT WRITE is done Depending on the device a NOWAIT WRITE beyond the end of file may or may not be considered an error For a NOWAIT READ an end of file error is returned in the error variable of a PROCESS READ call In addition the string variable contains only those bytes read before the end of the file Care must be taken when stopping and restarting programs that do NOWAIT I O particularly NOWAIT READs Ifa program is in the middle of a NOWAIT READ or NOWAIT WRITE when it stops it tries to finish the operation before it runs again In the case of a device that is not responding this can cause MegaBasic to wait indefinitely or until the PCM is reset Another
132. 510 520 530 540 550 Next Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 4 28 Rem This is the main menu subroutine It displays the various Rem options and checks for input Note that this is the only menu Rem in which the user can type a control C to exit This is optional Rem Def proc DO MAIN MENU CLS Rem Clear the screen ATTR Rem Reset line attributes CUR 4 10 Rem Position cursor to row 4 column 10 Print 5 DW_DH_TOPS Print 5 EXAMPLE MAIN MENU Rem Print top half of banner CUR 5 10 Print 5 DW_DH_BOTS Print 5 EXAMPLE MAIN MENU Rem Print bottom half of banner CUR 9 25 Print 5 1 SPLAY REGISTERS Rem Print the rest of the menu CUR 11 25 Print 2 SPLAY INPUTS CUR 13 25 1 8 SPLAY OUTPUTS 25 DA ub EXIT PROGRAM 24 LINK Rem Make the next line blink 5 ENTER NUMBER Rem The following loop continuously checks for user input Rem Repeat KEYS inchr 5 1 77 0 0 Rem Check for a character Case begin on KEYS Case 1 Rem Display register menu EXT MENU REG MENU Return Case 2 Rem Display input menu EXT MENU INPUT MENU Return Case 3 Rem Display output menu EXT MENU OUTPUT MENU Case E Rem Exit the program Case chr 03 Rem Handle Control C Print Stop Case end Rem Ignore all other characters Next Rem This is the register display subroutine It displays a block
133. 9 GFK 0255K To save a MegaBasic program to default device and directory type SAVE filename You can also save programs explicitly to the PCM RAM Disk or a specified PC disk drive and or file path Path Description SAVE MYPROG PGM Currentdirectory of default device SAVE RAM MYPROG PGM PCMRAM Disk SAVE PC MYPROG PGM Currentdirectory of current PC disk drive SAVE PC MMYPROG PGM Rootdirectory of current PC disk drive SAVE PC C MYPROG PGM Currentdirectory of PC drive C SAVE PC MB MYPROJ MYPROG PGM Directory MB MYPROJ of current PC disk drive SAVE PC C MB MYPROJ MYPROG PGM Directory MB MYPROJ of PC drive C If you want a program to run automatically after power is applied to the PLC or a PCM soft reset occurs save the program to RAM and use the file name BASIC When you load a program into a new workspace MegaBasic remembers where it was loaded from and uses the same device and file name as defaults when the program is saved For example if you type LOAD PC lt filename gt make some changes and then SAVE the program it is saved to PC ilename You can specify a new file name on the default device For example typing SAVE lt newfilename gt would save the program to PC lt newfilename gt You can also specify a new device for the default file name or a new device with a new file name Typing SAVE RAM or SAVE RAM newfilename savesthe program to the RAM Disk For most file
134. A 9 PIN FEMALE 9 PIN MALE 000 Figure A 5 PCM to PC AT Personal Computer DEFAULT PORT o 5 L IBM PC AT personal computer PC AT PCM IC690CBL702 3PL RS 232 _ E N The following illustration shows the connection between a PCM and a Cimplicity Model 242832 PCM 25 PIN FEMALE A 5 CL LLLI PIN DCD RD TD DTR RTS CTS GND 9 PIN FEMALE 4 2 PC AT 9 PIN MALE 844237 IC697CBL702 RS 232 DEFAULT PORT Figure A 6 PCM to Cimplicity Model W Computer W industrial computer The IC697CBL702 cable may be used for this connection CIMPLICITY EY Appendix A PCM Cabling Information GFK 0255K An IC697CBL705 cable provides the required signal connections between a PCM and a Workmaster II industrial computer or an IBM Personal System 2 personal computer WORKMASTER 243744 PCM IC690CBL705 3PL RS 232 DEFAULT PORT 4PL 244033
135. A companion file to VT100 PGM that prints to the device opening as 5 Adirectory Refer to GFK 0256 Refer to GFK 0256 Refer to GFK 0256 Compaction and encryption utility for MegaBasic program MegaBasic release notes F 1 File PCOP CLEANUP BAT DEFAULT DAT INSTALL DOC TERM DAT TERMF EXE TERMSET EXE PCOP EXAMPLES PCM ALM_RD PGM BINARIES DOC BITFUNCS BITFUNCS BIN BYTESWAP BIN EXAMPLES DOC GENERIC DOC GENERIC PGM GEN_TEST PGM GRAPH PGM MBCRC PGM PORT CTL BIN PRN FLT PGM READ FLT PGM SAMPLE PGM TEST FLT PGM UTILITY DOC UTILITY PGM VT100 PGM VT100 5 PGM PCOP UTILS ASMCHK PGM ASMDEFS ASM ASMPKG BAT CRUNCH EXE README DOC Appendix GFK 0255K Appendix Synchronous Serial Mode Operation G This appendix outlines the technical information required to use the synchronous serial modes of the Series 90 70 PCMA3 and newer hardware The PCMAS3 has two separate ports Port 1 and Port 2 which are isolated from each other and optically isolated from the host system Only Port 1 is capable of synchronous mode serial operation The serial controller used on the PCMA3 is a NEC uPD72001 Multiprotocol Serial Controller MPSC For detailed information on programming NEC72001 please contact NEC at 1 800 632 3531 8 am to 4 pm Pacific time and request a User s Manual for this product Port 1 Pin Assignments Connector PL3 contains signals for both RS 232 and
136. ACO000H AE0000H to to to to to to to to AO7FFFH A27FFFH A47FFFH A67FFFH A87FFFH AA7FFFH AC7FFFH AE7FFFH 900000H 920000H 940000H 960000H 980000H 9A0000H 9C0000H 9E0000H to to to to to to to to 907FFFH 927FFFH 947FFFH 967FFFH 987FFFH 9A7FFFH 9C7FFFH 9E7FFFH 800000H 820000H 840000H 860000H 880000H 8A0000H 8C0000H 8bE0000H to to to to to to to to 807FFFH 827FFFH 847FFFH 867FFFH 887FFFH 8A7FFFH 8C7FFFH 8E7FFFH Rack 0 is the CPU rack PCM Dual Port RAM Available for Applications The PCM system software uses the first 4000h bytes of the PCM dual port RAM Addresses within the first 4000h should never be used for user VME communication with the PCM Use only addresses at or above 0A4000h Future PCM enhancements are likely to use dual port RAM above the first 4000h bytes Applications should use the highest possible address for VME communication 5 102 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K VME Read Function The VMERD function can be used to read data from the dual port RAM of the Series 90 70 PCM to the CPU This function should be executed before the data is needed in the PLC ladder program The format of the VMERD function block is enable function OK logic RD address BYTE modifier AM LEN module 00001 address ADR 0 destination for VME data Parameter Description Enable Power flow input that when
137. AIT RD 5 NOWAIT_WR 4 STD_IN 3 STD_OUT 2 COM_TIMEOUT 1 USER 0 Any of the interrupts listed in this table can be assigned a priority from 0 to 23 to override the default priority Priorities do not have to be unique the highest priority for a PCM MegaBasic program is 23 Caution Although MegaBasic permits the assignment of priorities above 23 they must not be used in any program that runs on the PCM These interrupts are used to interface MegaBasic to the PCM operating system Any attempt to define or use these interrupts will result in erratic behavior of the program Once an interrupt is associated with a procedure and priority it is still necessary to enable the interrupt This is done with the statement INTERRUPT lt interrupt name gt ON At any point during program execution an interrupt can be disabled with the statement INTERRUPT lt interrupt name gt STOP Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 58 Ifthe interrupt name gt is omitted from either of these instructions the ON or STOP operation is applied to all of the defined interrupts Disabling all interrupts also disables interaction between MegaBasic and the PCM operating system Therefore this operation must be used with care A PCM MegaBasic program may not be able to recover from fault conditions if interrupts are disabled when the fault occurs Once an interrupt has been de
138. Any unused channel number can be used instead of 5 and you can of course use any file name instead of filename 1st When MegaBasic responds with the Ready prompt type LIST 5 to list the program to the PC file specified by the file name Once this is done you can exit MegaBasic and use the MS DOS PRINT command to print the file or a text editor program to edit it If you do not exit MegaBasic right away type CLOSE 5 before continuing Using a Text Editor to Create MegaBasic Programs Any text editor that creates or uses ASCII text files can be used to create or modify MegaBasic programs To create a MegaBasic program simply type MegaBasic statements Line numbers are not required and are added during the automatic text file conversion process in MegaBasic Save the text file to disk and use it as any other MegaBasic program To edit an existing MegaBasic program on your PC list the program to a file following the instructions above The resulting file may be edited When loading the text file into MegaBasic the message Text file conversion is displayed You can check the syntax of your program before running it by using the CHECK command MegaBasic Program and Data Size MegabBasic is more efficient than many other BASIC interpreters because it uses structured programming concepts to minimize program size Conversion of a program originally written for a different BASIC dialect to MegaBasic often reduces its size signif
139. BAT files see appendix D PCM Batch Files UCDFs are created and stored to a PCM using the PCOP development software For more information on PCOP and UCDFs see the Series 90 PCM Development Software PCOD User s Manual GFK 0487 When one of these modes is selected the PCM uses its default serial port settings unless they have been overridden by the PCMEXEC BAT or UCDF configuration An example detail screen showing NONE mode is displayed below The detail screen for PCM CFG mode is identical to this l l 1 orca 32323 INNEN CNN 01733 o o gt SERIES 90 70 MODULE IN RACK SLOT SOFTWARE CONFIGURATION Catalog 8 1 PROGRAMMABLE COPROCESSOR MDL HELP ALT H for Serial Port Restrictions Config Mode Im MENNI ID NLMSONLESSUN P ONFIG VALID IREPLACE Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 14 PROG PRT Mode PROG PRT mode is used to configure the PCM ports without automatically configuring the PCM for MegaBasic or CCM operation This mode requires configuration data stored in the PCM Either a PCMEXEC BAT file or User Configuration Data UCDF may be used For information PCMEXEC BAT files see appendix D PCM Batch Files UCDFs are created and stored to a PCM using the PCOP development software For more information on PCOP and UCDFs see the Series 90 PCM Development Software PCOP User s Manual GFK 0487
140. BLE MODULE FUNCTION 0 SERIES 90 70 PROGRAMMABLE o COPROCESSOR H o COMMUNICATIONS o 5 OPTIONAL MEMORY 9 8 USE IC697MEM71_ PORT 2 5 5 9o ij PonRT2 08 ii RS 2320R go RS 422 RS 485 o H H COMPATIBLE MODULE 1C697PCM711 LABEL 44A726758 203 0 OPTION CONNECTOR Figure 1 1 Series 90 70 PCM 1 4 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K a43734 PCM300 8006 COPROC usi PIOK TC 2 0206 64 9 e a 4 S RESTART 1 1 o EL Fl BATTERY gt LI 0 600 00 0 0060 060 00 0000 0 0 Figure 1 2 Series 90 30 PCM OKLED The OK LED indicates the current status of the PCM It has three states State Description Off When the LED is off the PCM is not functioning This is the result of a hardware malfunction e g the diagnostic checks detect a failure the PCM fails or the PLC CPU is not present Corrective action is required in order to get the PCM functioningagain On When the LED is on steadily the PCM is functioning properly Normally this LED shouldalways be on indicating that the diagnostic tests
141. Basic execution stops including backplane interrupt servicing and Control C processing In order to provide fast response time to interrupts itis a good idea to keep inputs and outputs small in length At 19 2K bits per second it takes 0 5 milliseconds to send a single character For applications where standard I O causes timing problems the program can elect to do NOWAIT I O Therearefive NOWAIT I O statements NOWAIT OPEN NOWAIT CLOSE NOWAIT READ NOWAIT WRITE NOWAIT SEEK Beginning with Release 2 51 there are two additional NOWAIT I O statements NOWAIT READ ABORT NOWAIT WRITE ABORT Unlike normal MegaBasic I O statements the NOWAIT statements except for NOWAIT OPEN do not wait for their operation to complete before allowing the MegaBasic program to continue In addition NOWAIT READ and NOWAIT WRITE can cause the MegaBasic program to be interrupted when the operation completes This allows the MegaBasic program to do remote file access collect input and do output without sacrificing program speed or responsiveness Note The one limitation to NOWAIT I O processing is that only strings can be read and written This is because the NOWAIT I O statements bypass the normall O formatting that is done by the MegaBasic interpreter s PRINT statement The strings can be formatted using other MegaBasic functions such as STR NOWAIT READ and NOWAIT WRITE are unnecessary for the RAM Disk and the NULL device because these accesse
142. Bus Transmitter Module and the CPU module GFK 0255K Chapter 2 Installing the PCM 2 3 The Programmable Coprocessor Module PCM may be placed in any unused slot in any rack provided that these conditions are met The configuration created by Logicmaster 90 configuration software must match the physical configuration of the modules If it does not the PLC may not operate as expected Configuration faults are logged in the PLC fault table Refer to the Logicmaster 90 Programming Software User s Manual GFK 0263 or GFK 0466 for more information on PLC configuration using Logicmaster 90 software When PCMs are installed in a Series 90 70 rack all the slots between the PCM and the PLC CPU CPU rack or the Bus Receiver Module expansion rack must be occupied If any of these slots is empty the PCM cannot communicate across the backplane to the Series 90 70 PLC CPU or Bus Receiver Module eA Series 90 30 PCM must be in the main rack with the PLC CPU Installing a Series 90 70 PCM To install a Series 90 70 PCM follow these steps 1 Set the CPU Run Stop switch to STOP This prevents the PLC program from initiating any command that may affect the operation of the module 2 Power down the Series 90 70 PLC system 3 Locate the desired rack and slot 4 Remove the Series 90 70 PCM from the shipping carton but leave it in its anti static plastic bag Touch an ex
143. C status word An example of the use of the READ PLC STATUS procedure is Access utility pgm READ PLC STATUS NOWAIT 500 OLD PLC STATUS WORD VALID Repeat While OLD PLC STATUS WORD VALID Next STS PLC STATUS WORD OLD PLC STATUS WORD VALID Print PLC status word 4h4 STS Next where the PLC status word is being read every 1 2 second as a result of the READ PLC STATUS procedure call The sequence of operations is 1 First wait fora change in the PLC STATUS WORD VALID flag line 1010 2 Record the state of the PLC STATUS WORD variable line 1020 3 Record the state of the PLC STATUS WORD VALID variable for waiting for a change the next time through the loop line 1030 4 Finally use the recorded state of the PLC STATUS WORD in further calculations The reason for this particular sequence of events is to insure that all processing is done with the same sample of the PLC status word and that a new sample of the PLC status word arrives before further processing Chapter 5 Advanced MegaBasic Programming 5 39 GFK 0255K Another example of the READ PLC STATUS procedure is Access utility pgm READ PLC STATUS Print Constant sweep mode is If PLC_STATUS_WORD amp 2 0 then Print not Print active where a read of the PLC status word is done in wait mode so that the data is available immediately after the call to the READ_PLC_STATUS procedure Then the con
144. CCM Serial Port Error Codes for a list of the possible error codes and their definitions Internal commands do not modify this count The term conversation refers to communications across the serial port 3 Same as the PCM Firmware Revision Number in the scratch pad 0E 0F This value always remains in word 12 of the diagnostic status words even when the diagnostic status words are cleared by issuing internal command 6002 or by an external device request 4 Refer to section 5 of this chapter for a description of the returned status fora CCM COMMREQ Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 3 6 Section 2 Series 90 CCM Memory Addressing Conventions In order to carry out a data transfer the CCM protocol must be given the address where the transfer is to begin and the length of the data to be transferred The starting address plus the length must not go past the end of a table boundary The requirements for specification of the starting address and data length are explained in this section followed by general guidelines for replacing a Series One Series Three Series Five or Series Six PLC with a Series 90 PLC in an application using the CCM protocol Target Source Memory Addresses The memory addresses in the following table are target addresses when the non initiating device is a Series 90 PLC When the initiating device is a Series 90 PLC they are source addre
145. CESS 1 Else Print Good status time for syswrite Errset READERR2 SYSREAD INTVBL1 Errset STATSTRS SYSTATUSS INTVBL1 f STATSTRS CUR STAT lt gt STABLE then Print Bad status for PLCLOCS after sysread SUCCESS 1 Return 3 STATSTRS STAT TIME f abs X3 12 5000 y gt 100 them UNLINK INTVBL1 Print Status time for sysread is wrong SUCCESS 1 Else Print Good status time for sysread Errset UNLINKERR2 UNLINK INTVBL1 Print No status errors detected during transfer of 551 Return LINKERR2 Print Error detected for R1 during syslink SUCCESS 1 Print errtyp errmsg errpkg Return WRITERR2 Print Error detected for R1 during syswrite SUCCESS 1 Print errtyp errmsg errpkg UNLI INTVBL1 Return READERR2 Print Error detected for R1 during sysread SUCCESS 1 Print errtyp errmsg errpkg UNLI INTVBL1 Return UNLINKERR2 Print Error detected for R1 during unlink SUCCESS 1 Print errtyp errmsg 7 58 Return Proc end GFK 0255K Appendix E Example MegaBasic Program E 3 TERME File Descriptions The following files are placed on the hard disk during the TERMF INSTALL procedure The AUTOEXEC BAT and CONFIG SYS files are optional you can select not to install them Description Adirectory Cleans up deletes old files in the PCOP directory TERM settings for
146. CM Data Rate Data rate bits per second or bps for the port Choices are 300 600 1200 2400 4800 9600 or 19200 TheSeries 90 70 PCM also supports 38400 Flow Control Type of flow control to be used for the port Choices are HARDWARE SOFTWARE or NONE Parity Type of parity to be used for the port Choices are NONE ODD or EVEN Stop Bits The number of stop bits for the target port Choices are 1 or 2 Bits per Character The number of bits per character for data transfer on the target port Choices are 7 or 8 Defaultselection GFK 0255K Chapter 2 Installing the PCM 2 15 PROG CCM and CCM PROG Modes PROG CCMand CCM PROG modes are used to configure the PCM programming and CCM ports without automatically configuring the PCM for MegaBasic operation These modes require configuration data atored in the PCM Either a PCMEXEC BAT file or User Configuration Data UCDF may be used For information PCMEXEC BAT files see appendix D PCM Batch Files UCDFs are created and stored to a PCM using the PCOP development software For more information on PCOP and UCDEs see the Series 90 PCM Development Software PCOP User s Manual GFK 0487 When PROG CCM this mode is selected in Logicmaster 90 software the following PCM detail screen is displayed rack l l E orca INN A 33 01733 7231 o 2 SERIES 90 70 MODULE IN RACK g SLOT SOFTWARE CONFIGURATION Catalog 8 1 PROGRAMMABLE C
147. CONST IN3 0 CONST 14 0 CONST IN5 00000 CONST 6 00000 CONST IN7 00000 500011 2 I 6 REQ ROOOII IN FT CONST SYSID 0003 CONST TASK 0000007F GFK 0255K Appendix PCM Commands C The PCM includes a command interpreter which is similar in principle to the MS DOS command line interpreter or UNIX shell PCM commands provide complete control for loading and storing applications and for executing them Note Your PCM must have firmware version 2 50 or greater in order to use the commands described in this appendix Accessing the Command Interpreter The PCM command interpreter is connected by default to PCM serial port 1 whenever the PCM is not configured by Logicmaster 90 in CCM ONLY mode and is not executing an application program In addition the command interpreter can be accessed through the PCM backplane as described earlier in this document The following discussion assumes that you are trying to access the command interpreter through serial port 1 using the TERMF terminal emulation program TERME is described fully in chapter 2 section 4 TERMF Installation and Configuration When a PCM is configured in PCM CFG mode using Logicmaster 90 software and there are no files stored in it the command interpreter will be connected to serial port 1 whenever the PCM is reset by holding the restart button for 10 seconds a hard reset Press
148. CPU CPU Series 90 30 Minor Types for CPU _311 30 1eh Series 90 30 311 CPU _31333 21h Series 90 30 313 CPU _323 34 22h Series 90 30 323 CPU _331 35 23h Series 90 30 331 CPU 34038 26h Series 90 30 340 CPU _341 36 24h Series 90 30 341 CPU CPU CPU CPU CPU CPU CPU Located in the same position as in the Series Six scratch pad Series One Three and Five PLC users who need to determine the node type should note this location and make driver modifications where necessary Scratch Pad Bytes 18h 33h 24 27 9401 Input Table Points Bits Points Bits Output Table 6 2C 2F M Internal Discrete Memory Points Bits 30 33 User Program Code Four bytes hold the hexadecimal length of each memory type with the most significant word reserved for future expansion For example the 731 default register memory size of 1024 words 0400h would be returned in the following format Least Significant MostSignificant contains oo 6 00 00 1 2a 2b 4 Note The amount of program memory occupied by the logic program Also appears on the Logicmaster 90 PLC 3 5 Memory Usage screen in the User Program field 5 Chapter 3 CCM Operation GFK 0255K GFK 0255K Diagnostic Status Words In addition to the status word which is automatically transferred from the CCM task to the CPU there are 20 diagnostic status words maintained and updated within CCM These status wor
149. Call PRINT_MSG to print the message KKK KKK KKK KKK KK KKK KK KK KK Print message type MT PRINT MSG RCV HDRS If RCV_TXT gt lt then PRINT MSG RCV TXT Next Proc end Chapter 5 Advanced MegaBasic Programming GFK 0255K GFK 0255K This procedure sends the unsolicited backplane message in the MSGS argument to the Series 90 smart module in the rack slot and task ID passed in the R S and ID arguments KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK proc SEND UNSOLICITED MSG 509 TXT R S ID Local DEST Rem A rack slot and task ID DEST R 6 1111b 5 amp 11111b lt lt 4 ID amp 1111111b gt gt 505 13 MSG 14 chr DEST S 256 f TXT then chr DEST mod 256 SEND MESSAGE MSG Else SEND MESSAGE 505 59 Rem Rem Rem Rem Rem Def Return Proc end KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK This procedure prints strings containing binary data as well as text Each byte is displayed in both hexadecimal and character format non printable characters are displayed as 5 o Note that 2 byte integer values are printed with the B lea
150. ClearInputs Outputs Examples To read 12 bytes of the target Series 90 scratch pad into Series 90 or Series Six registers the data length is 6 since the unit length for the source memory type registers is a register To read 12 diagnostic status words into the registers the data length would be 12 because both registers and diagnostic status words have equivalent unit lengths register word 2 bytes To read 8 target Series 90 inputs into Series 90 or Series Six inputs the data length is 8 points since the unit length is the same for each CCM memory types 2 and 3 inputs and outputs can be accessed only in multiples of 8 To read 8 target Series 90 registers into Series 90 or Series Six inputs the data length is 8 registers times 16 points per register 128 points Data Length 3 8 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K CCM Comparisons The following diagrams compare the CCM implementations on the Series 90 PLC with those on the Series One Series Three and Series Five PLCs The mapping of the Series 90 is the same as that of the Series Six PLC Note however that memory organization within the diagnostic status words and scratch pad differs between Series 90 PLCs and Series Six PLCs SERIES 844246 ONE JUNIOR lt gt SERIES 90 MEMORY TYPE 1 MEMORY TYPE 1 TIMERS REGISTER COUNTERS TABLE MEMORY TYPE 3 B MEMORY TYPE 2
151. Coprocessor Module and Support Software User s Manual November 1999 CLS 5 8 CUR The CUR function formats a cursor positioning string for use in constructing displays for the VT100 screen The first integer parameter indicates the desired row the second integer parameter indicates the desired column where the cursor is to be placed Both parameters are optional with the defaults being row 1 and column 1 The format for the CURS function is xxx A CURS row col Argument Description Row Aninteger number specifying the desired row Column An integer number specifying the desired column where the cursor is to be located In the following example the string A is constructed so that the screen is erased Then a double high and wide HELLO is displayed in the center of the VT100 screen Note that when the VT100 line is in double wide mode the cursor positioning is based on a 40 column line Access vt100 pgm A ERASE_SCREENS CURS 10 20 DW_DH_TOPS HELLO A 0 CUR 11 20 DW_DH_BOTS HELLO Print A In the next example a column of numbers is printed down the left side of the screen on every third line and then the cursor is placed at the home position Access vt100 pgm For I 2 to 20 by 3 Print CUR 1 2i 1 Next Print CURS GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 9 The CUR statement prints a cursor pos
152. Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 Verify that both the PCM and the programmer port are using the same serial port setup especially the same type of handshaking hardware software or none If they are not using the same serial port setup operation of the serial ports is unpredictable 5 This should first be checked in the Logicmaster 90 software Also check the PCM configuration mode If PROG or BASIC mode is selected in one of the ports this is the serial setup used in FACTORY mode Either use a different mode to determine the problem set the serial settings to the factory default settings or create a new TERM DAT file for this setup Repeat the previous step using the new TERM DAT file 6 Ifthe configuration mode is not PROG or BASIC for the port in question the default settings are used in FACTORY mode If you have not already done so initiate a hard reset by pressing the Restart Reset pushbutton continuously for 10 seconds 7 Ifyou are using PCOP check the PCOP configuration using the configuration editor If you are online select Advanced functions F10 and then Read UCDF F8 Refer to the port screen for the serial setup for this port Does the serial configuration match the required serial setup for the application If not change the PCOP configuration on this screen or reconfigure the attached device to match 8 Type PCOP or TERMF at the MS DOS prompt If you s
153. D PLC STATUS Aprocedure used to get the PLC status word The optional parameters for this procedure indicate the method of return wait for completion of the read operation default or return immediately NOWAIT with the data valid flag being used to indicate when the actual data has arrived In addition for NOWAIT the command may beautomatically repeated ata specified frequency as fast as possible or no repeats at all The PLC status word is placed in the integer variable PLC STATUS WORD and the PLC STATUS WORD VALID integer variable is used to indicate when the status word is updated READ PLC TIME A procedure used to get the time and date information from the PLC AND DATE CPU The time value is formatted hh mm ss format into the 8 byte string variable PLC TIME and the date is formattedmm dd yy format into the 8 byte string variable PLC DATE The integer variable PLC TIME AND DATE VALID is used to indicate when the time and date variables have been updated Optional parameters for this procedure are the same as those previously described for READ PLC STATUS READ PLC RUN A procedure that gets the PLC run status from the PLC status word STATUS andsetsthe PLC RUN STATUS integer variable according to the value found in the PLC status word as follows PLC runenabled PLC rundisabled PLCstopped PLGtopped faulted PLChalted PLCsuspended PLCstoppedI Oenabled 2 1 Hog g H HW dg M The integer var
154. D or SYSWRITE the number of bytes in its maximum size is transferred Furthermore whenever a string is used as a SYSREAD variable argument its current size is set equal to its maximum size Once a MegaBasic array or string variable has been SYSLINKed it must not be redimensioned until itis UNLINKed or erratic behavior results Although MegaBasic allows redimensioning it is not a good programming practice and should be avoided If the variable to be passed between the PLC and the PCM is a MegaBasic array variable the type argument can be used to convert all elements of the array from one representation to another For example a MegaBasic program could use the type argument to convert 10 consecutive input points at 701300 to an array of ten MegaBasic integers as follows 1000 Dim integer CPU INPUTS 9 1010 SYSLINK CPU INPUTS 1300 BOOL The program could now transfer the variables using the statement 1030 SYSREAD CPU INPUTS This sets each of the ten integers in CPU INPUTS to 1 or 0 corresponding to the bit values of the ten CPU inputs in 701300 through 9 GFK 0255K Chapter 4 MegaBasic 4 19 SYSREAD SYSWRITE and SYSTATUS To reference a Series 90 PLC CPU variable the PCM MegaBasic program must define the variable locally and SYSLINK it to a CPU variable Once this is done the variable can be manipulated with the SYSREAD and SYSWRITE commands The status of any variable can be determined with the SYSTATUS
155. FANUC GE Fanuc Automation Programmable Control Products Series 90 Programmable Coprocessor Module and Support Software User s Manual GFK0255K November 1999 GFL 002 Warnings Cautions and Notes as Used in this Publication Warning notices are used in this publication to emphasize that hazardous voltages currents temperatures or other conditions that could cause personal injury exist in this equipment or may be associated with its use Insituations where inattention could cause either personal injury or damage to equipment a Warning notice is used Caution notices are used where equipment might be damaged if care is not taken Note Notes merely call attention to information that is especially significant to understanding and operating the equipment This document is based on information available at the time of its publication While efforts have been made to be accurate the information contained herein does not purport to cover all details or variations in hardware or software nor to provide for every possible contingency in connection with installation operation or maintenance Features may be described herein which are not present in all hardware and software systems GE Fanuc Automation assumes no obligation of notice to holders of this document with respect to changes subsequently made GE Fanuc Automation makes no representation or warranty expressed implied or statutory with respect to and assumes
156. FK 0255K Another example of the READ PLC RUN STATUS procedure is 50 Access utility pgm 100 READ PLC RUN STATUS 200 If PLC RUN STATUS 2 then 210 Print CPU is running 220 else 230 Print CPU is not running 240 where the PLC CPU run status is checked once and an indication of the run stopstatus GFK 0255K of the PLC CPU program is given Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 44 READ PLC CPU ID The READ PLC CPU ID procedure obtains the PLC CPU ID string from the long status data from the SRP This data is obtained either in a wait for data mode default or a NOWAIT mode In NOWAIT mode the user must check the PLC CPU ID VALID flag to determine when the data has actually arrived in the PLC CPU ID string variable There is no provision for repetitively obtaining the PLC CPU ID data since it is assumed that this data would not change very often The format of the READ PLC CPU ID procedure call is xxx READ PLC CPU ID wait flag where the parameter is optional and if omitted the read of the PLC CPU ID string takes place in wait mode The wait flag is normally programmed with the NOWAIT constant from the PCMEXT PGM package that is accessed automatically by the MegaBasic program An example of the READ PLC CPU ID procedure is Access utility pgm READ PLC CPU ID NOWAIT While not PLC CPU ID VALID Next Print PLC cpu ID where
157. GND 120 OHM TERMINATING RESISTOR A S PIN 21 25 24 SD A SD B RD A RD B RT SHLD GND PCM 25 PIN CONNECTOR Figure 8 18 2 Wire RS 422 RS 485 PCM Hookup Appendix A PCM Cabling Information GFK 0255K 844361 Y 4 TO ADDITIONAL SLAVE MODEMS TXD RXD RTS TX CTS RX DCD GND MODEM TXD RXD RTS TX CTS RX DCD GND MODEM SWITCHED CARRIER TXD RXD RTS TX CTS RX DCD GND MODEM SWITCHED CARRIER x Ab yas Avv Aya Noo fF CQ mw ann Noa o N OM Ro PIN TD RD RTS CTS DCD GND PCM MASTER PIN TD RD RTS CTS DCD GND PCM SLAVE TD RD RTS CTS DCD GND PCM SLAVE IF MASTER IS HOST COMPUTER CONSULT COMPUTER MANUAL FOR WIRING SCHEME NUMBER OF SLAVES POSSIBLE DEPENDS ON PARTICULAR MODEMS USED THE PCM s SOFTWARE IS CAPABLE OF HANDLING 90 SLAVES Figure A 19 CCM2 or Host Computer to Multiple PCMs Multidrop Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 A 14 a44236 eo SERIES 90 30 PCM SLAVE 5 5 50 5 o gt 0 OO OO eo 25 PIN FEMALE j SERIES 90 30 PCM SLAVE 5 5 5
158. ID memory type and target memory address The target ID is 4 the memory type is 14 for bit set in the output table and the target memory address is 296 Consequently the command sets 70000296 on CCM CPU ID 4 On the first scan the program ensures that the PCM has had time to initialize itself before sending the first COMMREQ This is done with a 5 second TMR block in rung 8 The initial count value for the timer was cleared to 0 by one of the MOVE UINT function blocks in rung 6 After the timer has expired 79100001 latches on When 90100001 is on the CCM status word in 6R00107 is checked for a non zero value by the NE UINT function block Its value was initialized to 1 on the first scan by another MOVE UINT function block in rung 6 to allow the first COMMREO to be sent When the status word is not equal to 0 power flow is provided first to a MOVE UINT function block which clears the status word and then to the COMMREQ Note that the COMMREO IN parameter specifies R00050 as the command block location SYSID is 0002 so the PCM must be located in rack 0 slot 2 The TASK parameter on the COMMREO indicates that this COMMREQ is for CCM on port 1 of the PCM After the COMMREO completes a non zero CCM status word value is moved to R00107 The NE UINT block then permits another COMMREO to be sent When the program is run an error may cause the COMMREO FT output to become active or cause the PCM to post a fault to the PLC fault table Eithe
159. IN are written to the PCM at the specified address ADR When the operation is successfully completed the VMEWRT function passes power to the right through the OK output For information on PCM module addressing using address and address modifier codes refer to General VME Information for the PCM presented earlier in this section Chapter 5 Advanced MegaBasic Programming 5 105 GFK 0255K Example VMEWRT Function In the following example the hexadecimal value FFFF is written to each of 20 words on the PCM during every sweep when enabling input 70M00001 is true The starting lowest PCM address is specified by the contents of 61400019 low word and 0 high word Unless an error occurs while writing the data internal coil M00055 is set M00055 C CONST FFFF CONST 0039 R00019 to true M00001 d The PCM must be located in the rack and slot corresponding to the address contained in RO0019 and R00020 The MegaBasic user program would read this data from the PCM dual port RAM using an EXAM statement at the appropriate address GFK 0255K Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 106 VME Read Modify Write Function The VMERMW function can be used to update a data element in the dual port RAM of the Series 90 70 PCM The format of the VMERMW function block is enable unction OK logic RMW_ BYTE operatio
160. INE OUT E Case C LF LINE OUT LINE LF Case end For I to CNT Print LINE OUT ext Print MV CURS C LF Return Proc end CLS LINE DRAW LINE DRAW LINE DRAW LINE DRAW LINE DRAW LINE DRAW CUR 23 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 14 The MV CUR statement formats and prints relative cursor movement control strings on a VT100 terminal or other compatible display device The optional list of parameters specifies the desired direction for each move and the count of how many cursor positions to move in the selected direction The directions that may be specified are C UP C DN C RT and C LE All parameters are optional The count defaults to one location to move The direction defaults to C UP for the first move and no operation for subsequent moves The format of the MV CUR statement is xxx MV CUR 4121 cntl1 dir2 cnt2 Description Argument Direction x Pairs of integers specifying the direction and count for each cursor and move The dirl cnt1 pair is processed first then the remaining Count x pairs if any are processed before the statement completes In practical terms the maximum number of parameters for this statement is 4 2 pairs since any location on the VT100 screen can be reached in two relative moves of the cursor The direction parameters have a range of 1to4 C_UP to C_LF The
161. INKed to different PLC data areas during program execution This should be avoided if possible When a CPU location is referred to the size of the CPU data object is determined automatically from the size of the MegaBasic local variable and the type argument of the SYSLINK statement This is done automatically by the PCM Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 18 For numeric data the size of the CPU data object is equal to the number of elements of the MegaBasic local variable if it is an array variable multiplied by the size specified by the type argument of the SYSLINK statement A single MegaBasic integer or real variable SYSLINKed with a type argument of BOOLean would refer to a single bit in the PLC CPU An array of 5 integers or reals SYSLINKed with type BOOLean would refer to 5 bits An array of 16 MegaBasic integers or reals SYSLINKed with type UINT would refer to 16 contiguous 16 bit locations or 256 bits For string data the size of the CPU data object is equal to the maximum size of the string in bytes MegaBasic keeps two types of size information for each string current size and maximum size When strings are first created their current size and their maximum size are equal to their dimensioned size When an assignment is made to the string its current size changes according to the assignment that is made However when the string is transferred using SYSREA
162. Itis acount of the number of times a software delay loop is repeated before putting the next character into the transmit buffer This parameter is used only when TERMF is communicating with very slow devices Itis included here only for the sake of completeness The PCM does not requirethisdelay Range 0 to 32 767 The value zero 0 is strongly recommended Defaultselection 2 28 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Value Description ReceivedCharacter This buffer size affects the overall speed of TERMF when flow control is Buffer Size enabled With no flow control it affects the probability that a received character may be lost It also affects the responsiveness of the display when a key is pressed the smaller the buffer the more responsive If you use the Scroll Lock key to start and stop continuous output from a device a 1000 character buffer is recommended If you aresimply starting and stopping a MegaBasic listing from the PCM using the space bar then a 100 character buffer is adequate Exit Term Key This selection changes the key combination which exitsfromTERME The default setting 2092 assigns ALT Z Press the Z key while holding the AIT key You can also exit from TERMF by using the CTRL BREAKkey combination The scan codes used for this setting do not correspond to keyboardscan codes documented in IBM personal computer m
163. K 0487 for instuctions on installing PCOP 2 1 Chapter 2 GFK 0255K What You Will Need Before you can begin the installation procedure you must have the following equipment A Series 90 70 programmable controller PLC system or a Series 90 30 PLC system containing a model 331 or higher CPU 6 A Programmable Coprocessor Module PCM to install and test If your application is CCM with standard default settings for a Series 90 30 PCM no other equipment or software is required For other applications the following is also required An MS DOS based computer with a hard disk and MS DOS version 3 0 or later The computer may be A Workmaster II industrial computer An IBM PC XT PC AT industrial PC AT or PS 2 personal computer with an 83 key or 101 key keyboard A Workmaster or Cimstar Lindustrial computer with an 83 key or 101 key keyboard Logicmaster 90 programming software For most CCM applications no other equipment or software is required For MegaBasic and advanced CCM applications you also need PCM support software TERME IC641SWP063 or PCM development software PCOP IC641SWP061 One of the standard RS 232 cables described in appendix A PCM Cabling Information 2 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Section 1 Installing the PCM Hardware Th
164. KCK CR 4 CORRER COR KR LER LE LLL IER LLL LL LAL IAA 0 LL ALA I Initialize the delay timer and the MegaBasic COMMREQ command block CEE ELIA IER E UE QUAE COR OPE EIS SE AS SAS EE EE EE POE ESS I A lt lt RUNG 5 STEP 0002 gt gt FST SCN MOVE_ INT CONST CONST 1 1 00000 LEN 00001 CONST 0 CONST 8 CONST 9 CONST 0 CONST 0 CONST 4 RE RE RE RR ERE KR ERE RR Y Delay the COMMREQ 5 0 Sec T0001 is guaranteed to be off when the PLC transitions to RUN mode T0002 is on for only one sweep when the timer times out m UPS PUE Program MB CRQ3 C NLM90MMB CRQ3 Block MAIN GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 73 GFK 0255K 02 21 92 09 07 GE FANUC SERIES 90 30 90 20 DOCUMENTATION v3 00 MegaBasic COMMREQ example lt lt RUNG 7 STEP 0006 gt gt T0001 TMR 0 108 E CONST 00050 R0001 Add dd dd dd dd dd dd dd dd dd dd dd dd Cd dd dd d m d Clear the COMMREQ return status
165. KKKKKKKK Interrupt BKP_MSG end Interrupt BKP_MSG USER_BKP_MSG_PROC Interrupt BKP_MSG on Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Wait 5 seconds to give the other PCM if one is used time ii Rem to get ready to receive backplane messages ko ko ko ck ck Rem Wait 5 Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Build a backplane message in MSG HDR and send it to ID 3 in Rem the module at rack 0 slot 2 Since that is the backplane 5 Rem address of this program an unsolicited message will arrive ko ko ko Sk ck ck ck ck Rem SEND HDR chr 0 2 Rem initialize message SEND HDRS 8 chr 0EOh Rem message type SEND HDR 17 5 HELLO Rem message data SEND TXTS SEND UNSOLICITED MSG SEND HDR SEND TXT 0 2 3 Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Build a backplane message with more than 16 bytes of data 5 Rem Send it to task 3 in this module ko ko ko ko ko
166. KKKKKKKKKKKKKKKKK Interrupt BKP_MSG end Interrupt BKP_MSG USER_BKP_MSG_PROC Interrupt BKP_MSG on Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Send a CHG_PRIV generic message to trigger a response Rem message from the PLC CPU Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK CHG_PRIV 3 Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Initialize the NEXT CMRQ as the PLC signal Then wait for Rem two COMMREQs ko ko ck Rem EXT 050 1 SYSLINK NEXT CMRQ R200 UINT Repeat If MSG lt gt 0 then Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 84 5 85 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK A backplane message arrived If it is a COMMREQ print the data size and then the data in hexadecimal format KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK If CMRQ_RCVD lt gt 0 then Print COMMREQ data size CMRQ DATA SIZE bytes Print COMMREQ data For 15 1 to CMRQ_DATA_SIZE Print 382 asc CMRQ_DATAS I Next I Print Print KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
167. KKKKKKKKKKKKKKKKKKKKKKKKKKK Signal the PLC CPU to send the next COMMREQ KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK SYSWRITE NEXT CMROQS Else A generic message response arrived print the message type KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Print message type MSG_TYPE Print 1 MSG TYPES 0 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK This procedure handles the BKP_MSG interrupt i Process messages until no more are available proc USER MSG PROC 1 Next Rem Rem Rem Rem Def Repeat PROCESS MESSAGE RCV HDR RCV_TXTS If RCV HDR then Return KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK There is a message Set CMRQ_DATA_SIZE to zero If the message is a COMMREQ change it later Put the message type into MSG TYPES x KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK CMRQ_DATA_SIZE 0 MSG_TYPE S asc RCV_HDRS 8 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Is the message is a generic message response ko ko kok ko kck KKK
168. L2 PLCLOC SYSTATUSS INTVBL2 U RS CUR STAT lt gt STABLE PATTERNS 0 INTVBL1 TVBL2 SYSTATUSS INTVBL1 U R CUR STAT lt gt STABLE SYSTATUSS INTVBL2 U R CUR STAT lt gt STABLE Errset XFERERR3 Def proc Local STATSTRS Errset XFERERR SYSLINK Errset XFERERR2 STATSTRS 1 1 SYSLINK STATSTRS f 1 NTVBL NTVBL2 SYSWRITE SYSREAD STATSTRS 1 1 STATSTRS f 1 Errset XFERERR2 UNLINK INTVBL2 Errset XFERER UNLINK INTVBL1 If INTVBL2 lt gt PATTERN then 1 FERERR3 UNLINK INTVBL2 FERERR2 UNLINK INTVBL1 Print BACKPLANE TRANSFER FAILURE FOR LINK INTVBL2 LINK INTVBL1 Print WRONG SYSTATUS VALUE FOR CHECKSTAT Local STATSTRS NKERR2 NTVBL1 R1 SYSTATUSS INTVBL1 U R CUR STAT lt gt STABLE then Bad status for R1 after syslink NTVBL1 STR STAT TIME Print CPU Print THE FERERRI SUCCESS 186 eturn eturn C JJ 6 6 6 DH Return Proc end Def proc Errset L SYSLINK Errset STATSTRS If STATS Print UNLINK Return 71 STA Wait 5 E 2 Errset 2 SYSWRITE 1 Errset STATSTR SYSTATUSS INTVBL1 f STATSTRS CUR STAT gt lt STABLE then Print Bad status for 5821 after syswrite SUCCESS 1 UNLINK INTVBL1 Return T2 STATSTRS STAT TIME Wait 5 f abs T2 T1 5000 gt 100 then Print Status time for syswrite is wrong SUC
169. M Series 90 30 Autoconfig If you are trying to use Autoconfig with the Series 90 30 PLC and the PCM is not functioning in CCM SLAVE mode with the default configuration see chapter 2 Installing the PCM clear the PCM by using PCOP Utility functions or by removing the battery and shorting the battery terminal leads with a screwdriver This is done in case the board has an old PCOP configuration that would take precedence over the autoconfig data If you have PLC revision 1 03 or earlier IC693CPU331D or earlier an upgrade is required for correct operation Contact the GE Fanuc Hotline If multiple PCMs are present especially of different catalog numbers such as an ADC CMM or PCM301 you must configure the PCM using Logicmaster 90 software or upgrade to Release 2 0 PLC 1 Logicmaster 90 Configuration If you have configured the PCM using Logicmaster 90 software and the PCM is not functioning correctly in the selected mode clear the PCM by using PCOP utility functions or by disconnecting the battery from the circuit board connector and shorting the circuit board terminal pins with a screwdriver This is done in case the board has an old PCOP configuration that would take precedence over the Logicmaster 90 configuration data Ensure that the correct mode and setting have been chosen See chapter 2 Installing the PCM for details on configuration modes and associated parameters If multiple PCMs are present especially of differ
170. M provides several routines that break down and print information contained in the fault records TEST FLT PGM explains how to use the functions and procedures from the other two files to read and display the fault table information To use the functions procedures and data structure definitions supplied in READ FLT PGM add the line xxx Access READ FLT pgni at the beginning of a MegaBasic program or in the PROLOGUE section of a user written package The READ FLT PGM file must be loaded to the PCM RAM Disk before running the MegaBasic program which accesses it The file is located in the PCOP or PCOP EXAMPLES PCM directory of your PC hard disk depending on which release of PCOP or TERMF you use Note In PCOP version 2 04 and earlier READ FLT PGM PRN FLT PGM and TEST FLT PGM arecalled RD FLT PGM PR FLT PGM and RP TEST PGM respectively The functions and procedures found in READ FLT PGM are listed below Table 5 5 READ FLT PGM Functions and Procedures Function Procedure Description READ FAUIT TBL A procedure that reads the table header information and zero 0 or more fault records from the I O or PLC fault table RDEL_FAULT_TBL A procedure that reads and deletes the first fault record in either fault table FLT_PRESENT A function that reads PLC short status information and returns the fault table present boolean from the PLC status word for either fault table FLT_CHANGED A function that reads PLC short sta
171. MRQ TXT If CMRO HDR then Return KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK There is a COMMREQ message It is assumed to be a NOWAIT mode COMMREQ Put the data size into CMRQ DATA SIZES 5 there are 12 data bytes or less there is no way to know the exact data size unless it is included in the COMMREQ data ri itself Next copy the COMMREQ data to CMRQ DATAS KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK CMRQ_RCVD 1 If CMRQ TXT then T 17 O 19 CMRQ DATA SIZE 12 Rem it could be less CMRQ DATAS CMRQ HDRS 21 12 Else T 25 0 7 CMRQ DATA SIZES len CMRQ_TXTS CMRQ DATAS CMRQ TXTS 1 CMRQ DATA SIZE KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Construct a string containing the PLC reference address of d the COMMREQ status register in STAT PTR 6 ck ko ko STAT PTR asc CMRQ HDR T STAT PTR OFFSET asc CMRQ HDR O 256 asc CMRQ HDR O 1 Case begin on STAT PTR TYPE Case 8 STAT PTR Case 10 STAT PTR SAT Case 12 STAT PTRS SAQ Case 16 STAT_PTR E n Case 18 STAT PTR Q Case STAT PTR Rem The status pointer type is Case end Rem unrecognized
172. NTS PLC FLT TBL function 1 Thereisafaultrecord in the PLC fault table 0 Thereis no fault record in the PLC fault table 4 1 I Ofaultentry changed flag This flag is also returned by the FLT CHANGEDS function 1 I Ofaulttablehaschanged since the lasttime the table was read 0 T blehasnotchanged 5 30 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 31 PLC faultentry changed flag This flag is also returned by the FLT_CHANGED PLC FLT TBL function 1 PLC fault table has changed since the last time the table was read 0 Table has not changed Constant sweep mode setting 1 Constant sweep mode of PLC CPU operation has been enabled 0 Constantsweep mode is disabled Oversweep flag valid only if constant sweep modeis enabled 1 Constant sweep value was exceeded on the last sweep 0 Constant sweep value was not exceeded Current PLC CPU state as opposed to switch settings or commanded state Possiblevalues PLCrunning I Oenabled PLCrunning I Odisabled PLCstopped PLCstopped due toa fatal fault PLChalted PLCsuspended PLCstopped I Oenabled Spare reserved DoPwnr 2 Program Configuration Symbostatusable changed flag 1 Achangehas been made to the PLC user program configuration data or symbol status table The latter requires a new resolve of any symbols currently resolved b
173. November 1999 GFK 0255K Argument Description BufferSize Whena NOWAIT READ or NOWAIT WRITE isdone an intermediate buffer is used to transfer the data between the MegaBasic program and the device The buffer size argument specifies the maximum total number of bytes that can be buffered at once This may span several outstanding NOWAIT READ or NOWAIT WRITE statements If this value is omitted or set to zero the amount of data that can be buffered is limited only by the amount of free memory in the PCM Specifying a maximum buffer size does not actually cause a buffer to be allocated It only places a limit on the total size of subsequent outstanding allocations That is NOWAIT_READs and NOWAIT_WRITES are not being satisfied as fast as new buffers additional requests are allocated It is possible to run out of memory on the PCM before the maximum buffer size is reached OPEN does however verify that the maximum buffer size is available at the time that the NOWAIT_OPEN call is made Error Determines what action to take if subsequent transfers exceed the maximum buffer size or cause the PCM to run out of memory If the error flag is omitted or set to zero the MegaBasic program waits until memory becomesavailable and then continues Otherwise a memory erroris generated NOWAIT OPEN returns a handle for the channel that is an integer in the range 0 through 65 535 This handle must be saved in order to use it with th
174. O TXTS 5 76 Color graphics adapter CGA goce m data block length 3 16 idle timeout value maximum communication time status pointer memory type 3 17 status pointer offset 3 17 wait no waitflag Command format for PCM commands c2 Command interpreter C 1 accessing the command interpreter C 1 COMMREO S I2 5 61 CCM COMMREQ example CCM COMMREO status word 3 23 CCM status word command block data block 3 17 data block length 3 16 idle timeout value 3 17 maximum communication time 3 17 status pointer memory type status pointer offset 3 17 wait no wait flag controlling COMMREOs 5 76 data block 3 19 format of the COMMREO function IN parameter 3 13 5 68 interpreting COMMREQ messages 3 67 MegaBasic blink LED program example 55 GFK 0255K using TERMSET to configure TERMF or PCOP with Logicmaster 90 software 2 6 Connecting the PCM to the programmer 2 32 integer and string constants 5 6 CP 5 7 CPU name string too long error code 115 5 4 CPU RESPONDING 5 38 create a memory Module M command c1 CRUNCH 4 12 CRUNCH EXE 4 12 6 5 F 1 CTS_STATUS 5 56 CUR statement 5 6 5 10 CUR function 5 6 5 9 CUR STAT codes NO CPU 4 22 READ PENDING 4 22 READ RECEIVED 422 READ TIMEOUT4 2 STABLEJ422 WRITE FINISHED 4 22 WRITE PENDING WRITE RECEIVED 42Z WRITE TIMEQUT 4 22 XFER_REJECT 4 22 CURHOMES 5 7 Curre
175. OD4 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK MT asc RCV_HDRS 8 If MT 10111111b 94h MT OD1h or MT amp OBEh 82h then Print 8 message arrived from the PLC CPU Else KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK it a return to sender message Either bit 5 set to 1 15 in RCV HDR 6 or an error code in RCV_HDR 1 and RCV HDR 2 indicate a rejected message ko ko ko ER asc RCV HDR 1 256 asc RCV HDR 2 If asc RCV_HDRS 6 20h or ER gt lt 0 then Print an outbound message was rejected Else KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Extract the rack slot and ID of the sender 8 SOURCE asc RCV HDR 9 256 asc RCV HDRS S 10 RACK S SOURCES amp 1111b SLOTS SOURCE S gt gt 4 amp 11111b ID SOURCES gt gt 9 amp 1111111b Print an unsolicited message arrived from rack RACK Print Let SLOTS ID ID sx KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Print the message type
176. OMMREO command block and its data block are initialized using the BLKMV function block The command block is located in R50 R55 R50 the data block length is 1 it contains a single word command for the MegaBasic program R51 contains a 0 for NOWAIT mode The status return is in R200 since R52 is 8 for R memory and R53 is 199 R54 and R55 are ignored in NOWAIT mode and are simply initialized to 0 The data block begins at R56 and contains one word In this example the PLC ladder instructs the PCM to blink the LED continuously since R56 is set to 4 The program ensures that the PCM has had time to initialize before sending the first COMMREQ This is done with a 5 0 second timer function block in rung 7 The timer count register R0001 was also initialized to 0 by a MOVE INT block in rung 5 After the timer has expired T0001 transitions on to stop the timer and 7010002 is on for one sweep When T0002 is on power flow is provided to rung 9 The return status location for the COMMREO block 6140200 is set to zero by a MOVE INT function block Then the COMMREQ is sent to the PCM The IN parameter to the COMMREO gives location R50 for the command block SYSID is 0002 indicating the PCM is located in rack 0 slot 2 The TASK parameter indicates that this COMMREO is for the MegaBasic program since its value is 3 The MegaBasic program defines two string variables CMRQ HDR and CMRQ_TXTS for receiving the COMMREO data block Lines 1
177. OPROCESSOR MDL HELP ALT H for Serial Port Restrictions Conf ig Mode Port 1 PROG Port 2 CCM Interface 2 CCM Enable YES Data Rate 0 CCM Mode SLAVE Flow Contrl HARDWARE Interface 2 19200 NONE ODD NORMAL LONG NONE 1 Flow Contrl Parity Retry Count Tineout Turn Delay CPU ID ONFIG VALID Parity NONE Data Rate Stop Bits 1 Bits Char 8 D LMSONLESSON REPLACE The configuration mode is set to PROG CCM The remainder of configurable parameters are as described previously for PROG PRT mode on port 1 and CCM ONLY mode on port 2 The screen displayed for CCM PROG mode is similar It shows CCM port options in the Port 1 column and PROG options in the Port 2 column Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 16 Configuration Modes and the PCOP Display When the PCOP development software is running and connected to a PCM it attempts to display the current PCM operating mode on its status line The following table shows the modes displayed by PCOP for various combinations of Logicmaster 90 configuration modes presence or absence of UCDF configurations and reset conditions A soft reset occurs when the PCM Reset Restart pushbutton is pressed and held for less than 5 seconds A hard reset occurs when the button is held for 10 seconds Table 2 3 Logicmaster 90 Configuration Mode Configuration Prese
178. OR MDL HELP ALT H for Serial Port Restrictions Config Mode 9 Interface 2 Interface 2 Data Rate 0 Data Rate 0 Flow Contrl HARDWARE Flow Contrl HARDWARE Parity NONE Parity NONE Stop Bits 1 Stop Bits 1 Bits Char 8 Bits Char 8 1 D LMSO LESSON Per sew ONFIG VALID Parameter Description ConfigurationMode Set to BASIC Interface The interface parameter for port 1 of a Series 90 30 PCM is 25 232 port 2 of the 192K and 640K Series 90 30 modules may have an interface value of either RS 232 or RS 485 The interface parameter is not used or displayed for the 160K module IC693PCM300 RS 232 and RS 485 are valid for both ports of the Series 90 70 PCM Data Rate Data rate bits per second or bps for the port Choicesare 300 600 1200 2400 4800 9600 or 19200 The Series 90 70 PCM also supports 38400 Flow Control Type of flow control to be used for the port Choices are HARDWARE SOFTWARE or NONE Parity Type of parity to be used for the port Choices are NONE ODD or EVEN Stop Bits The number of stop bits for the part Choices are 1 or 2 Bits per Character The number of bits per character for data transfer on the port Choices are 7 or 8 Defaultselection 2 12 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K BAS CCM Mode BAS CCM mode is not supported in PCM firmware version 2 04 or earlier Attempting to use it
179. ORE and REVERSE When all parameters are omitted the resulting control string turns all attributes off when printed to the VT100 device The format of the ATTR function is xxx AS ATTR p1 p2 Argument Description P1 P2 Aninteger number specifying the desired attribute number 1 The desired attribute number 2 In the following example a string consisting of an erase screen control string and various combinations of attributes and related text strings is constructed and then printed to the VT100 device The effect of the various attributes is additive until a clear screen or an ATTRIB OFF isissued The ATTR function can accept more than one attribute per call and more than one attribute may be turned on in the string returned by the ATTR function Access vt100 pgm Dim A 300 CRLFS 2 CRLF chrseq 13 10 ERASE SCREENS ATTR BLINK Blink CRLF 0 ATTRS BOLD Bold Blink 5 ATTRS UNDERSCORE Bold Blink Underscore CRLF ATTRS REVERSE Bold Blink Underscore Reverse CRLF ATTRS ATTRIB OFF UNDERSCORE REVERSE Underscore Reverse 5 ATTRS BOLD Bold Underscore Reverse 5 0 0 AS 0 Print A In the next example a string consisting of an SGR control string activating blink and bold modes the text Working and finally an SGR control string for all attributes off is constructed The string A
180. ORT 2 SHIELD PORT 1 85 232 TD PORT 1 85 232 RD PORT 1 55 232 RTS PORT 1 856 232 CTS NO CONNECTION SIGNAL GROUND PORT 1 85 232 DCD 990999909999 6 6 PORT 2 RS 485 SD A PORT 2 RS 485 RTS A PORT 2 RS 485 CTS A PORT SHIELD RS 232 TD RS 232 RD RS 232 RTS RS 232 CTS SIGNAL GROUND RS 232 DCD 2 TERMINATION CTS I RS 485 RD B PORT 2 PORT 2 85 485 RD A A97 PORT 1 PORT 2 244358 HO SHIELD ES O 9 8 232 TD H 2 RS 232 RD B 4 8 RS 232 RTS 4 HS RS 232 9 Oo SIGNAL GROUND TO a I RS 232 DTR I RS 232 DTR RS 232 DCD 8 DH Rs 485 SD B Oa een Tao RS 485 RTS B RS 485 RTS A 0 9 H Rs 485 CTS RS 485 CTS A 9 TERMINATION RD TERMINATION CTS 2 69 i RS 485 RD B OY RS 485 RD A A9 pr RS 232 244225 25 PIN FEMALE PIN 1 CONNECTOR x PORT1 PORT2 RS 232 RS 485 25 PIN FEMALE CONNECTOR P gt gt 1FOOT 2 0 INCH 0 INCH LABEL Ne PCM COMM CABLE IC693CBL305B 3 6 NC nt uu PIN1 RS 232 25 PIN MALE CONNECTOR Figure A 3 WYE Cable Connections for the S
181. P MSG PROC rrupt BKP MSC on at PROCESS MESSAGE CMRQ HDR 5 If CMRQ_HDRS then Exit at proc USER BKP MSG PROC peat PROCESS MESSAGE CMRQ HDR CMRQ_TXTS If CMRQ HDR then Return KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Uncomment the next 3 lines to print the COMMREQ message The message bytes are printed in decimal format K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK For I 1 to 16 Print asc CMRQ HDRS I Next I Print For I 17 to 32 Print asc CMRQ HDR I Next I Print Print LED CMD asc CMRQ HDR 21 f LED CMD 1 or LED CMD 4 then SET LED 1 4 7 blink LED 1 continuously Else If LED CMD 2 or LED CMD 3 SET LED 1 LED CMD 2 blink LED 1 once 3 turn LED 1 off xt turn Rem Rem Rem Rem Rem Dim Dim Inte Inte Inte Repe ext Repe ext Def Re Ne Re 240 250 260 2200 200 200 300 310 320 330 340 350 360 Proc end Chapter 5 Advanced MegaBasic Programming GFK 0255K Controlling COMMREQs The temporary queue where backplane messages are stored can hold only a limited number When the queue overflows the PCM is unable to receive another backplane message until PROCESS_MESSAGE is called COMMREQs sent to the PCM are lost and a fault is posted to the PLC fault table Overflow can be prevented by regulating the rate at which the PLC CPU sends repeate
182. PCM The WYE cable is 1 foot in length and has a right angle connector on one end that connects to the PCM On the other end it has a dual connector with one connector for port 1 and the other for port 2 In order to use an RS 232 cable on port 2 of a Series 90 30 PCM either a special cable must be made according to the serial port pin assignments shown in appendix A or a WYE cable must be used Standard Series 90 70 PCM cables can be used for the Series 90 30 PCM when the WYE cable is used GFK 0255K Chapter 1 Introduction 1 7 The WYE cable should not be used with Series 90 30 PCMs connected to an RS 485 multidrop network because it introduces signal reflections on the cable Multidrop networks should be cabled directly to the PCM serial connector The connector pin assignments for the Series 90 70 PCM Series 90 30 PCM and the WYE cable shipped with each Series 90 30 PCM are shown in appendix A PCM Cabling Information 1 8 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Section 4 Hardware Overview for the Series 90 70 PCM The Series 90 70 PCM features include A 12 5 mHz 80C186 microprocessor 128 Kbytes on board RAM Up to 512 Kbytes optional RAM on memory expansion boards These are the same expansion boards used by the Series 90 70 CPU 731 32 and CPU 771 772 Two RS 232 RS 485 serial ports Backplane access to PLC memory A real time calendar clock synchroniz
183. PCM with the HHP Programmable Coprocessor Module parameters can be edited with the Hand Held Programmer if you have a Release 3 or later CPU and a Release 2 51 or later PCM The parameters are edited in exactly the same manner as for Intelligent I O Modules described previously in this chapter Freezing the Configuration Processing a change to the PCM s configuration takes 15 seconds or more Processing multiple parameter changes simultaneously takes the same time as processing a change to a single parameter Since changing several parameters at once is a common occurrence changes to individual parameters are remembered by the module but are not processed and do not take effect until specifically commanded to do so When a PCM parameter is changed an asterisk will appear before the module name on the top line of the HHP screen This indicates that the module s previous configuration has been frozen and that the module is not yet using the change s you have just made You can continue editing and this and all subsequent changes will be remembered by the module However if power is lost while a module s configuration is frozen the changes edits you have made made will be lost When the configuration for a module is frozen in this manner you can tell the system that editing of all of the parameters is complete by pressing the WRITE and ENT keys The edited changes are then processed all at once by the PCM and the asterisk will disapp
184. PLC variable is manipulated by more than one statement you must ensure that an update of the variable between instructions does not cause erroneous results To ensure that the variable is not corrupted copy it to a temporary variable and use the copy for subsequent processing Since the copy can be made with a simple assignment statement one instruction the temporary variable is guaranteed to contain a coherent copy of the PLC variable MegabBasic has two data types that enable large blocks of data to be copied with a single assignment statement The first is the vector which can be used to copy arrays of numbers The second is the stringrecord which allows arbitrary groupings of data defined within the same record to be transferred After the PCM updates a variable witha SYSREAD or SYSWRITE command either the PCM or CPU can change its copy of the variable There is no guarantee that both copies of the variable are the same unless you take steps to ensure that only one program updates the variable and always notifies the other about changes to the variable Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 24 Accessing the PCM s LEDs The PCM has three green LEDs located at the top of the front panel The topmost LED is designated as the BOARD OK LED During normal operation this LED is always on The two LEDs below the BOARD OK LED are designated as USER1 and USER2 These LEDs
185. RAM Rem Access RAM VT100 5 PGM Rem ow assign MegaBasic channel number 5 to whatever port is Rem 15 being used for the display The screen formatting package Rem accessed above assumes that 45 is the output device Rem Open 5 COM1 Rem Disable control C processing so that it doesn t interfere with Rem the keyboard handling routines Since automatic control C Rem detection will be disabled the program must do its own Rem checking if a control C stop is desired Rem Param 1 1 Rem Assign each menu a number for switching between the menus Rem Def integer MAIN_MENU Def integer REG_MENU Def integer INPUT_MENU Def integer OUTPUT_MENU MAIN_MENU 1 REG_MENU 2 INPUT_MENU OUTPUT_MENU 4 3 Rem All of the menus are implemented as subroutines and are called Rem from the main loop below A variable called NEXT_MENU is used to Rem keep track of the next menu to display When the user wants to Rem change menus the active menu subroutine sets the NEXT_MENU Rem variable and returns to the main loop To add a new menu define Rem a new number for it as above write a subroutine to implement Rem the menu and add another case statement in the loop below Rem Def integer NEXT_MENU EXT_MENU MAIN_MENU Rem Run the main menu first Repeat Case begin on NEXT_MENU Case MAIN_MENU DO MAIN MENU Case REG MENU REG MENU Case UT MENU INPUT MENU Case PUT MENU DO OUTPUT MENU Case end
186. READ INT Local VBLPTR HANDLE XFERERR Repeat PROCESS READ VBLPTR HANDLE XFERERR If VBLPTR 0 then Return If XFERERR gt lt 0 then Stop Transfer error OWAIT WRITE HANDLE2 VBLPTR HANDLE Next Proc end Def proc WRITE INT Local VBLPTR HANDLE XFERERR Repeat PROCESS WRITE VBLPTR HANDLE XFERERR If 17812185 0 then Return If XFERERR gt lt 0 then Stop Transfer error Print HANDLE OWAIT READ HANDLE1 VBLPTR HANDLE Next Proc end This example program uses two interrupt procedures READ INT and WRITE INT to process NOWAIT serialI O The main program simply initializes program variables opens serial port 1 assigns the interrupt procedures to the NOWAIT RD and NOWAIT WR interrupts makes three NOWAIT READ requests and then goes into the non ter minating loop at line 260 When one of the main program s NOWAIT READ requests completes READ INT is called to process the data READ INT usesa NOWAIT WRITE statement to send the new data back out port 1 5 98 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Try running this program yourself First load VT100 PGM into MegaBasic from the PCOP EXAMPLES PCM directory created when you installed TERMF or PCOP Save VT100 PGM tothe PCM RAM disk Then load the example program and run it Each time you type five characters they will be received by READ INT and echoed back to your PC display by NOWAIT W
187. RITE When the write operation completes WRITE INT will be called It will print the handle value of the NOWAIT READ request which received your five characters GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 99 Section 11 VME Functions Series 90 70 PLC ladder program can also communicate with the PCM using the VME Read VMERD and VME Write VMEWRT functions These functions are not available for Series 90 30 PLCs VMERD VMEWRT and other associated functions treat the PCM as a standard VME board Data is moved to and from the PCM s VME bus dual port RAM VME functions usually execute faster than the equivalent COMMREO for the same data transfer These functions can also be useful in situations when the PLC System Communications Window must be severely shortened or eliminated However many of the advantages of the COMMREQ are not present for a VMERD or VMEWRT including Guaranteed data coherency Automatic protection against simultaneous access to the same data location by the PCM and PLC CPU Fault reporting of some user programming errors such as an invalid task or the wrongrack slot 6 No requirement for user knowledge or manipulation of dual port addresses Most applications should use the COMMREO function to transfer data between the ladder program and the PCM The VME functions should be used only when timing constraints or other factors dictate their use VME Function Blocks for Communicating
188. RS 485 communication circuits The pin out for RS 232 signals conforms to the RS 232 specification with the exception that pins normally unused for RS 232 are used for RS 485 signals Table G 1 Port 1 Pin Assignments RS 232 Synchronous Serial Mode Operation RS 232 ASYNCHRONOUS SYNCHRONOUS PIN FUNCTION SIGNAL NAME FUNCTION SIGNALNAME YO w fiee w 5 Note The Transmit Clock Input is used only with RS 232 synchronous mode communications 15 422 synchronous mode uses only the RXCLK and TXCLKO lines 7 SignalGround GFK 0255K G 1 Table G 2 Port 1 Pin Assignments 85 422 Synchronous Serial Mode Operation RS 422 ASYNCHRONOUS SYNCHRONOUS PIN FUNCTION SIGNAL NAME FUNCTION SIGNALNAME VO RDA Request to Send A RTS A Transmit Clock Out A TXCLKO A Clear to Send A CTS A ReceiveClock A RXCLK A X Termination o mmm Receive Data A Receive Data A RD A Send Data B SD B Send Data B SD B Request to Send B RTS B Transmit Clock Out B TXCLKO B Clear to Send B CTS B Receive Clock B RXCLK B Receive Data B RD B Receive Data B RD B Synchronous Operation Modes for Port 1 Due to connector pin limitations the asynchronous mode CTS RTS lines are also used for the synchronous mode clock lines There are three possible synchronous operation modes for Port 1 of the PCMA3 1 RS 232 Transmit Timing from PCM TLCKO Receive Timing from Other
189. RXCLK 2 RS 232 Transmit Timing from Other TLCLK1 Receive Timing from Other RXCLK 3 RS 422 485 Transmit Timing from PCM TXCLKO Receive Timing from Other RXCLK RS 232 RS 422 485 PCMA3 7 PCMA3 sb 8 Le e Other TXCLKO A Other TXCLKI TXcLKO B 2 DTE gt NC DCE DTE XOKO a DCE RD A he 1 p PD B RXCLK RXCLK A Tg HO RXCLK B FOMAS HXCLKO RS NC Other TXCLKI DTE e DCE RD RXCLK E G 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 999 GFK 0255K Synchronous Mode PCMA3 Port 1 Control Registers The PCMAS has several hardware registers for controlling the Synchronous mode operation The I O Addresses listed in the table below assume a programmable base address of 0000H Table G 3 Port 1 Control Registers DATA BITS Reset ie Address 6 54 521 FUNCTION Value Lowe ERR ms Toren serre oom fefe pee f e en ekpen 03001 XI X X X X X X PCMA3 Set PCMA3 1 then read Status register at 0101H bit 3 If0101H bit 3 is also set identifies PCMA3 as hardware platform NEC72001 I O Addresses The serial controller used on the PCMAS3 is an NEC72001 The serial controller is lo
190. SE BOLS 5 7 ERASE_BOT 5 7 ERASE_EOLS 5 7 ERASE LINES 5 7 ERASE SCREENS b 7 ERASE TOPS 5 7 Error codes MegaBasic 5 3 argument of wrong type 102 argument out of range 101 Backplane timeout 118 backplane transfer failure 112 5 4 bad LED definition 110 5 3 3 bad timer definition 108 Basic extensions incompatible 116 buffer space exceeded 120 CPU name string too long 115 5 4 Device unavailable 23 ed duplicate remote variable 111 5 3 illegal backplane operation 117 5 4 illegal NOWAITI O operation 119 improper variable type 114 5 4 insufficient memory 103 5 3 invalid IOCTL string 122 5 4 missing argument 100 not enough timers 107 PCM hardware not present 106 remote variable unknown 104 serial port framing 126 5 4 too many remote variables E undefined local variable 113 EXAM statement 5 106 5 109 Example MegaBasic program E 1 EXAMPLES DOC F 1 EXAMPLES PCM 4 27 Examples MegaBasic programming execute a batch file command C 4 Exiting the MegaBasic interpreter 4 6 Expansion memory 2 5 Expansion memory boards for the Series 90 70 PCM catalog numbers 2 5 Expansion memory for the Series 90 70 PCM 2 9 Extensions to MegaBasic 1 2 4 2 5 1 Index 5 determining the size of a MegaBasic program DISMISS MegaBasic i rogram packages 4 11 Eoi Data accessing PLC 4 15 DATE OF LAST CPU RESH5 38 E board fo
191. T QMYFILE These errors can be returned File not found file name Illegal module type file name For more information on PCM batch files refer to appendix D PCM Batch Files configure LEDs Format 85 led number led use code lt task_number gt This command configures either of the bottom two PCM LEDs USER1 and USER2 The LED number can be either of the ASCII characters 1 or 2 The LED use code is a two digit ASCII hexadecimal code that specifies a configuration byte for the LED Binary values for the LED use code are as follows d Serial port transmit 1 Serial port 1 receive 2 Serial port transmit Serial port 2 receive Backplane transmit Backplane receive Must be zero Combine the bits for the desired LED action into a single byte value in hexadecimal format For example to blink LED USER1 when characters are transmitted or received on serial port 2 use binary code 00001100 This is equivalent to 0C hexadecimal so the command is B 1 OC The task number if specified is an ASCII hexadecimal digit that specifies which task will control the indicated LED The task number must be the number of a valid task 0 0F hexadecimal When an LED is assigned to a task the LED use code must be specified as 40 hex To configure LED 1 to be controlled by task 7 use B 1 40 7 T sk 7 will then be able to change the behavior of LED 1 A second B command may be used specify a default communication event o
192. TD LO RESERVED RS 232 RD 6 RESERVED SeN TO DE neseno RS 232 CTS Ooh RESERVED NO CONNECTION H6 SIGNAL GROUND RESERVED RS 232 DTR RS 232 Sot RS 485 SD B RS 485 SD A 8 2 85 485 RTS A LaS RS 485 RTS B nec RS 485 CTS B RS 485 CTS A 4 TERMINATION RD TERMINATION CTS 54 RS 485 RD A eo RS 485 RD B Figure A 1 Serial Port Pin Assignments for the Series 90 70 PCM A 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Note In figure A 1 SD Send Data and RD Receive Data are the same as TXD and RXD used in Series Six PLC publications A and B are the same as and A and B denote inputs and A and B denote outputs To terminate the RS 485 CTS input signal jumper pins 11 and 12 to terminate the RD input signal jumper pins 24 and 25 The Series 90 30 PCM has a single serial connector that supports two ports One port has a fixed interface Port 1 uses RS 232 operation only The IC693PCM300 module is restricted to using RS 485 on port 2 All other Series 90 30 PCM modules may select either RS 232 or RS 485 operation on port 2 The connector pin assignments for the Series 90 30 PCM are shown below 244357 SHIELD I RS 232 TD PORT2 PORT 1 85 232 TD I 85 232 CTS PORT 2 PORT 1 RS 232 RD I 85 232 RD PORT
193. TS B 0 o l esa _ esa 4 0 8 8 23 CTS B 0 0 7 7 gt 0 0 9 SHLD 1 i 1 SHLD 57 0 Jo pope ulcer NEC Se 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE 0 MALE FEMALE Figure A 14 PCM to PCM without Hardware Flow Control RS 422 RS 485 844360 PIN SHIELDED 2 J1 TWISTED PIN ren PARS a ran o ce TxD 0 8 CS XX l 25 B md dn 0 17 9 13 RD A 0 RXD 8 8 21 506 0 0 8 x xX m B 0 0 PCM o 9 4 9 SD A I 0 CCM2 9 ms 4 al to RTS L port 0 CTS 6 5 _ 22 RTS B Org 2 aS pee CTS A 0 0 23 CTS B E 0 0 OV 7 7 7 I 0 09 sup 1 1 SHLD ON a 4000 FEET 25 PIN 25 PIN 25 PIN 25 PIN FEMALE MALE Oe S MALE FEMALE 120 OHMS Figure A 15 CCM2 to PCM RS 422 RS 485 GEK 0255K Appendix A PCM Cabling Information A 11 244232 PIN PIN NENED C CASCO m EN 90 9 SDA 9 XX 22 RD A tn 0 0 SD B 21 10 RD B 0 0 0 3 Rv 8 23 SD A 0o 0 0 PCM oo RDB 5 XX 11 SD B 00 lE 2E 09 S RTS A 10 9
194. Y To view other possible modes Press the key R0 02 PCM301 S MODE PROGRAM PRT Each time that you press the key other modes will be displayed When the desired mode is displayed it will be blinking Press the RY key RO 02 PCM301 lt S MODE PROGRAM PRT The asterisk to the left of PCM indicates that the module s configuration is now frozen That is the new mode value of PROGRAMMER PORT is remembered and displayed but the module is still using the old value of CCM ONLY If power were cycled at this time the mode parameter would have the old value of CCM ONLY If you should attempt to change HHP modes or go to RUN mode when the module s configuration is frozen the FROZEN error message will be displayed For example Press the key R0 08 FROZEN lt S MODE PROGRAM PRT Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 20 To refresh the display of the module name press any key for example Press the 1 key RO 02 PCM301 lt S MODE PROGRAM PRT If an attempt is made to view the configuration of a module in another slot at this time the HHP will prompt you for the changes For example Press the key SAVE CHANGES S lt ENT gt Y lt CLR gt N Since the port baud rate parameters have not yet been edited at this point in our example we do not want to save the changes yet Press the key DISCARD CHGS lt S lt ENT gt Y lt CLR gt N If the
195. a Files Using TERME for more information on using TERMF to load files to the PCM Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 12 Section 2 Interfacing to the PCM Hardware and Series 90 CPU MegaBasic has access to all the PCM input output devices Through Release 3 these include the RAM Disk RAM two PCM serial ports COMI and COM2 and a file server PC which can be attached to either serial port Finally there is a NULL device NULL which can be used to discard output Note When using the PCM version of MegaBasic device names must include a colon The colon is optional with the MS DOS version MegaBasic programs can perform input and output I O operations using either standard or specified devices MegaBasic is normally configured to use COMI as its input and output device For example executing the line 10 Print Hello World causes the string Hello World to be printed out port 1 of the PCM To read or write one of the other devices the program must first open the device and assign it a specified channel number This channel number is then used in subsequent 1 0 statements For example the following two lines 10 Open 45 COM2 20 Print 45 Hello World print the string Hello World to serial port 2 In the MS DOS version of MegaBasic channel numbers 0 1 and 2 are reserved for the console printer and auxiliary device
196. a Series 90 70 PLC rack RACK COPY REF YU DELETE UNDEL CFGSEL 157180 june ther ONE G DIL EN RACK J 4 6 CONFIGURATION PUR 11 CPU 731 MDL 240 167 BEM 731 1 I 16 6801 Jape Ref Adr 101 Devices 2001 BUS1 0 D LMSONLESSON E LESSON ONFIG VALID REPLACE 2 6 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K This example represents a Series 90 30 PLC Model 331 rack IINE cory REF UU DELETE UNDEL SEM OCNNN 1283 CLD 01173 OM o Fiera Tu slice fool zs PROGRAMMED CONFIGURATION 710001 Q10017 NLMSONLESSON P ONFIG VALID The current module on a Series 90 I O Configuration rack screen is highlighted in reverse video Upon entering the rack screen the Power Supply module is shown in reverse video Use the left or right cursor keys to move from module to module Use the up and down cursor keys to move between racks in descending or ascending order respectively The rack screen presents an overview perspective of one Series 90 PLC rack To add a PCM press Other F8 and then PCM F1 To display the current configuration of the module in a slot press Zoom F10 CONFIGVALID is displayed in the lower right corner of each display screen after the configuration is successfully valida
197. a hard disk or on an IBM PC PC XT PC AT IBM System 2 or 100 compatible personal computer with a hard disk at least 640K of RAM and DOS Version 3 0 or later For information on choosing whether to use TERMF or PCOP see section 7 Who Should Use PCOP IBM PC and IBM System 2 are registered trademarks of International Business Machines Corporation Chapter 1 Introduction 1 3 GFK 0255K Section 3 PCM Module Description The Programmable Coprocessor Module has a battery and three LEDs The Series 90 70 PCM has two serial port connectors while the Series 90 30 PCM has a single connector supporting two serial ports Both the Series 90 70 PCM and the Series 90 30 PCM have a Restart Resetpushbutton LED Indicators The three LED indicators shown in the following figures are mounted along the top front edge of the PCM 242733 DOOR BD OK Q USER 1 P1 OK d USER2 __ 5 q P2 OK E RESTART cdi MODEL 70 5 PCM 711 BATTERY gt Nj MODULE OK CONNECT SN XX USER 1 X USER2 o ON ORUSER 0 0 6 0 o o o PUSH TO RESTART 09 APPLICATION 9o PUSH AND HOLD PORT 1 92 TO 5 o STOP AND RESET 09 l BATTERY go CONNECTIONS 8 L o INSTALL NEW BATTERY BEFORE UNPLUGGING OLD BATTERY USE 1C697ACC701 o PORT 1 RS 232 OR RS 422 RS 485 COMPATI
198. able For PCM Release 3 00 and later a simpler method is available for changing the privilege level Simply include the following MegaBasic statements in your program 150 Open 45 CPU 5 160 Ioctl 5 PASSWD 170 Close 5 The correct password string for the desired privilege level should be substituted for PASSWD GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 17 SMSG WTEXT SMSG WTEXT is a general purpose procedure that makes requests of the Service Request Processor SRP by sending a message with text string to the SRP The format for using the SMSG WTEXT procedure is xxx SMSG WTEXT req code acc code offset length handle Parameter Description RequestCode Therequest code for the particular PLC reference data type see below AccessCode Theaccess code for this user reference type see below Offset The zero based offset from the beginning of the specified user reference data Length The number of data words to transfer Handle A user identification for this transfer The procedure sends a message and a text string defined as SMSG TXT Note The current size of the data in the text string SMSG_TXT must be in the range 0 through 256 bytes The SRP response message from a call to SMSG WTEXT may be obtained by using the PROCESS MESSAGE statement which can be used periodically or by an interrupt procedure invoked by the response Before using SMSG WTEXT the PLC program name w
199. able 5 10 Table 5 11 Table 5 12 Table 5 13 Table G 1 Table G 2 Table G 3 Table G 4 Table G 5 GFK 0255K Introduction System Overview The Programmable Coprocessor Module PCM from GE Fanuc Automation North America Inc is a high performance microcomputer designed to perform coprocessor functions in a Series 90 PLC system It combines the function of the Communications Module CCM and the ASCII BASIC Module ABM used on the Series Six programmable logic controller PLC into a single module with significantly greater capacity and performance than that of the ASCII BASIC module The PCM is closely coupled to the Series 90 PLC and may be configured to function as One or two independent CCM ports One CCM port and one MegaBasic application using one serial port One MegaBasic application using one or both serial ports The PCM communicates with the PLC CPU over the backplane and can access user and system data using extensions to the MegaBasic language No application support is required in the PLC CPU Dual tasking allows the PCM to run a MegaBasic program and support a CCM communications channel at the same time For CCM and smaller MegaBasic applications the PCM can use on board memory The Series 90 70 PCM has 128K bytes of memory however some Series 90 70 MegaBasic applications require a daughter board that can expand memory by 64K 128K 256K or 512K bytes The Series 90 30 PCM is available with vari
200. access commands MegaBasic prompts you for confirmation The confirmation prompt includes the destination device before the file name providing a check to verify that the device you intend will actually be used To ensure that the correct destination for a file access command will be used you can always fully qualify file names with the device name Backing Up Your Program If you perform a power cycle or reset the PCM while adding lines to a MegaBasic program the program statements entered in the current session are lost Therefore when you develop a program on line you should back it up to a PC file often Although use of the RAM Disk for program storage is much faster than using the PC programs stored on the RAM Disk can be corrupted under certain conditions In particular if a MegaBasic program uses assembly language routines or the FILL statement the program and data files should always be backed up to PC before running Itis good programming practice to back up every change to programs and data files to the PC hard disk GFK 0255K Chapter 4 MegaBasic 4 5 Exiting the MegaBasic Interpreter Most MegaBasic programs developed for the PCM are programmed to run in a continuous loop and are restarted only when the PCM is reset During debug however it may be necessary to stop a program There are three ways a MegaBasic program can be stopped If a syntax error occurs CTRL C is pressed ora STOP statement is
201. ad A string variable of length 8 that supplies the PLC time value read as a result of the READ PLC TIME AND DATEprocedure This string is formatted as hh mm ss with the leading digit of the hours field being set to blank if itis a zero A string variable of length 8 that supplies the PLC date value read as 8 result of the READ PLC TIME AND DATEprocedure This string is formattedismm dd yy with the leading digit of the month field being set to blank if itis a zero An integer variable that is incremented by 1 every time the PLC time and date is read The value of the variable increments up to 255 and then rolls over to 1 A zero value false indicates that the PLC time and date have never been read An integer variable that contains the true falseflag indicatingwhether the PLC CPU is responding to the check CPU health requests ie short statusreads A string variable of length 8 that records the local time time function at which the CPU last responded to a health check This string is formatted as hh mm ss with the leading digit of the hours field being set to blank if it is a zero A string variable of length 8 that records the local date date function at which the CPU last responded to a health check This string 15 formattedismm dd yy with the leading digit of the month field being set to blank if itis a zero Aninteger variable that indicates true false whether the time and date of last CPU response are valid N
202. advance what the status registers will be Here is a tip to make the process of debugging a program using this regulation method easier The design of the ladder program assumes the PCM program starts before the first COMMREQ is sent and continues to respond to COMMREQs indefinitely But MegaBasic programs are started and stopped frequently while they are being developed When this program stops the PLC CPU never receives a signal to send the next COMMREQ The ladder program can be stopped and then started at the same time as the MegaBasic program but is is easier to leave the CPU running After line 290 in the example add 3 lines to SYSLINK CMRQ RCVD to RO200 SYSWRITE it and UNLINK it The added lines will cause the ladder program to send a COMMREO whenever the MegaBasic program starts When the program is working correctly these lines can be remarked out GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 77 GFK 0255K 02 20 92 15 46 GE FANUC SERIES 90 30 90 20 DOCUMENTATION v3 00 Regulating MegaBasic COMMREQs PROGRAM REG CRQ ECLARATIONS CLARATIONS ROGRAM LOGIC 1 Ke SCORE gt RAL IEA SALARIES ALAS gt he delay timer the 60828510 COMMREQ command block and ocation ck ck ck
203. al delay enable the first COMMREQ Then wait until the PCM acknowledges each one before enabling the next KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK gt gt RUNG 9 STEP 0012 lt lt T0002 oc sh NE INT l R0200 11 Q l CONST 2 00000 RE gt SKIES RRR gt gt 1 gt esie ee gt Send a 608288510 COMMREQ in NOWAIT mode to ID 3 in the PCM at rack 0 slot 2 but only when the previous one is successfully acknowledged m Ne eoe oce see SENE Seo woe se se se se se Sole sese woe 09 gt gt RUNG 11 STEP 40016 lt lt T0003 IMOVE INT l l CONST IN Q R0200 R0050 00000 LEN 00001 CONST 0002 CONST 00000003 END OF PROGRAM LOGIC Program REG CRQ C NLM90NREG CRQ Block MAIN Chapter 5 Advanced MegaBasic Programming GFK 0255K GFK 0255K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK This example program shows how to 1 Determine the COMMREQ status location in PLC memory 2 Regulate COMMREQs from the PLC program so that the PCM backplane message queue never overflows and 3 Determine the amount of data in the COMMREQ SS
204. alf display format A string constant lt esc gt 5 used to set the currentlinetosinglewide singlehigh display format A string constant lt esc gt 6 used to set the currentline to double wide single high display format A string constant lt esc gt K used to erase the present line from the cursor to the end of the line A string constant lt esc gt 1K used to erase the present line from the beginning of the line to the cursor A string constant lt esc gt 2K used to erase the entire present line A string constant lt esc gt J used to erase the screen from the cursor to the bottom of the screen A string constant lt esc gt 1J used to erase the screen from the top of the screen to the cursor A string constant lt esc gt 2J used to erase the entire screen Chapter 5 Advanced MegaBasic Programming Constant ATTRIB OFF BLINK BOLD UNDERSCORE REVERSE C_UP C_DN C_RT C_LF CP CURHOMES SAVECURS RESTORECURS DW DH TOP DW DH BOT SW SH DW SH ERASE EOL ERASE_BOL ERASE_LINE ERASE POT ERASE TOP ERASE SCREEN GFK 0255K GFK 0255K The CLS statement clears the VT100 display screen and sets the cursor at the home position row 1 column 1 The format for the CLS statement is xxx CLS The following example uses the CLS statement 50 Access vt100 pgm 100 CLS 110 Print This is home position for the cursor Series 90 Programmable
205. an invalid type The PCM does not have enough system memory to complete the requested operation This error is not to be confused with error 0 which occurs if the MegaBasic interpreter does not have enough memory If this error occurs configure MegaBasic to use less memory leaving more for PCM system memory The PCM could not complete a SYSLINK This could be due to an invalid CPU name specified by SYSLINK or the CPU may not be responding Too many SYSLINKs are active UNLINK those that are not used all of the time This error is generated if an MS DOS version of MegaBasic tries to access the PCM extensions or if the version number of an extension package does not match the PCM MegaBasic version number The PCM has run out of system timers Use fewer timers in the MegaBasic program An invalid argument has been passed to the TIMER statement The MegaBasic program attempted to manipulate an LED that was not configured to be under the control of a user program If your PCM has firmwareversion 2 50 or greater you can use a PCMEXEC BAT file containing the B Configure LEDs command to assign the LED to your MegaBasic program With lower firmwareversions you must use PCOP to configure the LED Either an invalid LED number or invalid mode was specified by the MegaBasic program A MegaBasic local variable being SYSLINKed is the object of another SYSLINK call A MegaBasic local variable can be SYSLINKed to only one PLC CPU v
206. ane Processing for the Series 90 70 5 114 Backplane Processing for the Series 90 30 PCM 5 115 Chapter 6 TroubleshootingGuide eee 6 1 GFK 0255K Series 90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 xi Contents OK EED Not On eres sos er Rp Der e Rep RA EUER ERREUR RR EO 6 1 Reset Blinks User LED1 or LED2 0 6 1 Communication Failure iesst yarasa eee e 6 2 PLC Fault Table Entries 0 0 0 0 eee eee cee eene 6 3 Backplane Transfer Failure 0026666 066666066666606 066660000000002 6 4 Insufficient Memory Error 0 0 6 6 oes 6 4 LossofCharacters 1 1628 08510 1 811026 0 000000 ee 6 6 CEM Data Tx7 Rx Failures seo end RIR ER Se 6 7 Configuration Problems a 6 8 Appendix A PCMCabling Information eee A 1 Cable and Connector Specifications 66 6666 660666666666660 60002 A 1 Serial CODnectorS cna et A Ee E s A 2 Cabling seve sey nelle dep bees RE 05 bh Ree A 5 RS 232 Cables errie eae LR 0 5 ohh ei ed RES A 7 15 422 RS 485C ables 2 8 byes ee ERR Sh ares 0 gets A 10 Appendix B Resetting the PLC from a PCM Program sees B 1 Appendix PCM Commands 22d 4293 EO ERREUR ARD EUR RURAL C 1 Accessing the Command Interpreter 0 0666 660666666606666 660600000 C 1 Interactive Mode cssc iier ld ep da Re ERE Ru PES Eu C2 Command Format
207. annels are not located in contiguous PLC memory and the MegaBasic program has additional processing to do so that it cannot stay in a dedicated loop the inputs can be processed more efficiently with an interrupt procedure as follows Def integer INPUT TBLO Def integer INPUT TBL1 Def integer INPUT TBL2 Def integer INPUT TBL3 SYSLINK INPUT TBLO AI001 INT16 SYSLINK INPUJ L1 521025 INT16 SYSLINK IN L2 521079 INT16 SYSLINK INPUT L3 AI133 INT16 SYSREAD IN LO OWAIT 100 SYSREAD INPUT L1 OWAIT 100 SYSREAD IN L2 OWAIT 100 SYSREAD IN L3 OWAIT 100 Interrupt ER end Interrupt ER PROCESS INPUTS Interrupt on 1 i B B JHA UJ 1 1 HG 3 3 3 2 3 3 3 9 IS T Tj Def Proc PROCESS INPUTS Local DATA PTR CHANNEL NUM Repeat PROCESS XFER DATA PTR CHANNEL If DATA PTR 0 Then Return SCALE DATA PTR DISPLAY DATA PTR CHANNEL NUM If DATA PTR OVERRANGE Then SEND ALARM CHANNEL NUM Next Proc end The BKP XFER interrupt and the PROCESS XFER statement are used here because the data messages are transferred from PLC memories to the PCM BKP MSG and PROCESS MESSAGE would be used if the PLC sent this data via a COMMREQ This second solution is more complex than the first because four separate variables are defined linked and transferred However they can all be processed with the same interrupt procedure Also
208. anuals Use Show Scan Code below to determine the correct setting for the key or key combination Shift CTRL or ALT plus another key you select Do not change this setting if you use PCOP The Series 90 PCM DevelopmentSoftware PCOP User s Manual GFK 0487 specifies ALT Z as the key combination to return to PCOP after communicating with PCM MegabBasic If you change this setting PCOP will not function as expected Send Break Key This selection changes the key combination which causes TERMF to send aserialbreak The default setting 2152 assigns ALT F1 Press the F1 function key while holding ALT The scan codes used for this setting do not correspond to keyboardscan codes documented in IBM personal computer manuals Use Show Scan Code described below to determine the correct setting for the key or key combination Shift CTRLor ALT plus another key you select PCM MegaBasic does not respond to Break although user programs can BreakDelay This delay valueisarbitrary and varies among different computer models It is a count of the number of times a software delay loop is repeated between the start and end of a break The default is 20 000 counts Show Scan Code This menu item is shown after you answer Y to the prompt that asks whether you wish to change a selection You should use Show Scan Code to discover the scan code for the key or key combination you want to assign to the Send Break function or exit TERME The key assignm
209. are linked to procedures in the package BKP MSG TIMER1 TIMER2 TIMER3 TIMER4 and TIMERS The timers associated with these five timer interrupts are also stopped If the user changes these interrupt linkages the original settings can be restored through the UTILITY_INIT procedure described below Some of the procedures in the UTILITY PGM package support a NOWAIT operation As a result of the NOWAIT mode of operation the requested data may not be available immediately after returning from the called procedure However there is a global status variable typically VALID that indicates when the data has arrived via the BKP MSG interrupt The NOWAIT operation also allows some of the procedures in the package to obtain the requested data repetitively When the procedure has setup a repetitive read operation one of the timer interrupts listed above may be used in addition to the BKP MSG interrupt The data valid flag is incremented every time new data arrives and rolls over from 255 to 1 The only time that the data valid flag is a zero a logical false is when the first transfer of the data after the procedure call has not yet taken place The procedures found in the UTILITY PGM package are summarized in the following table Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Section 5 5 34 5 35 Table 5 7 UTILITY PGM Package Procedures Procedure Description REA
210. ariable The table in this section explains error codes returned by PCM extensions to MegaBasic Table 5 1 Code Status 101 Argument Out of Range 102 Argumentof Wrong Type 103 InsufficientMemory 104 Remote VariableUnknown 105 Too Many Remote Variables 106 PCM Hardware Not Present 107 Not Enough Timers 108 Bad TimerDefinition 109 Task Not Active 110 Bad LED Definition 111 Duplicate Remote Variable Chapter 5 Advanced MegaBasic Programming GFK 0255K GFK 0255K Table 5 1 MegaBasic Error Codes cont d Description Corrective Action A backplane transfer cannotbe completed This could be caused by a timeout waiting for a response from the PLC CPU attempting to SYSREAD or SYSWRITE more data than a particular PLC memory type contains or attempting to write into a protected region of PLC CPU memory This error occurs if a MegaBasic local variable is made the object of a SYSLINK call before it has been declared This error occurs if a string array or an array with more than three dimensions is SYSLINKed CPU name strings must be eight characters or less including the ASCII NUL terminationcharacter The internal revision numbers for the PCM extension packages do not match those of the interpreter A MegaBasic program tried to SYSWRITE a variable while it is in the process of being read ora SYSREAD occured while the variable is being written The CPU backplane driver tim
211. asc MESSAGE HDR 8 TYPES 194 then 0 DATA SIZE 12 0 DATAS MESSAGE HDR 21 12 f MSG_TYPES 195 then 0 DATA SIZE 8 0 DATAS MESSAGE_HDRS 25 8 f MSG_TYPES 130 MSG TYPE 131 0 DATA SIZE len MESSAGE_TXTS 0 DATAS MESSAGE TXT 1 COMMREQ_DATA_SIZE Rem not a COMMREQ do something else Chapter 5 Advanced MegaBasic Programming MSG TY f MSG COMM COMM Else COMM COMM Else COMM COMM Else GFK 0255K Programming the PLC COMMREQ Function Block The PLC CPU uses the parameters of the COMMREO function block and a command block to define the data required to communicate with the PCM When the COMMREQ function receives power flow a block of data is sent to the PCM The Communications Request may either send a message and wait for a reply or send a message and continue without waiting for a reply If the command block specifies that the program will not wait for a reply the command block contents are sent to the PCM and program execution resumes immediately This is referred to as NOWAIT mode If the command block specifies that the program waits for a reply the command block contents are sent to the PCM and the CPU waits for a reply The maximum length of time the PLC will wait for the device to respond is specified in the command block If the device does not respond in that time program execution resumes This is referred to as WAIT m
212. at uses an IBM Color Graphics Adapter CGA display The default TERM DAT also contains serial port settings identical to the PCM default settings If your computer uses different display hardware such as the IBM Monochrome Display Adapter MDA Enhanced Graphics Adapter EGA or Video Graphics Array VGA you need to use the TERMSET program If you change your computer s hardware configuration you will need to use TERMSET again You also need to run TERMSET in order to use PCM serial port settings that are different from the defaults TERMSET asks you about your computer s display hardware and the serial port settings you plan to use then it makes the necessary changes to the TERM DAT file Thefile DEFAULT DAT contains the same default settings as the initial version of TERM DAT installed with TERME Caution The file DEFAULT DAT should never be modified It is very useful when troubleshooting for providing default settings to TERMF or PCOP Torun TERMSET 1 Type CD PCOP at the MS DOS prompt 2 To make changes to the TERM DAT file type TERMSET to display the TERMSET main menu There are three parts to the main menu Basic Setup Custom Configurations and Exit TERMSET To configure TERMF or PCOP for your computer you need to use only the two Basic Setup functions items 3 and 4 below to set up the serial port and display adapter For information on Custom Configurations see items 5 through 8 on the following pages 3 To chang
213. ata 4 15 Adding a memory expansion board to the Series 90 70 PCM 2 9 Adding a PCM to the rack screen D 8 Address allocations for the PCM 5 102 data length target sourcememory addresses 7 Advanced MegaBasic programming 5 1 ALL_SENT_STATUS 5 56 ALM RD PGM F 1 i i of wrong type error code 102 Argument out of range error code 101 5 3 ASMCHK PGMIF 1 ASMDEFS ASM F 1 ASMPKG BAT E 1 Asynchronous serial input and output 5 91 ATTR statement 5 6 5 12 ATTR function b e 5 11 ATTRIB OFF 5 7 Autoconfig 1 13 2 18 AUTOEXEC BAT B configure LEDs command 4 25 C 4 GFK 0255K CCM ONLY configuration mode 2 10 1 CCM operation 1 2 1 CCM commands not supported CCM COMMREQ data block 3 19 CCM COMMREQ example CCM COMMREQ status word CCM comparisons 3 9 CCM data Tx Rx failure 6 7 CCM status word command block data block 3 17 data block length 3 16 idle timeout value 3 17 maximum communication time status pointer memory type 3 17 status pointer offset wait no wait flag COMMREQ 3 12 COMMREQ IN parameter 3 13 B sri OK and FT parameters 3 14 COMMREQ SYSID parameter 3 13 COMMREQ TASK parameter 3 14 communications request data length 3 8 diagnostic status words 3 6 format of the COMMREO function block 3 13 memory types not ini ported 3 2 NOWAIT mode other COMMREQ faults 3 15 power up as ces run to completion mode 3 28 scratch pad 5 4
214. ata strings They are passed to the executable program for processing GFK 0255K If the file specified by the R command is not present in the PCM RAM Disk the PCM attempts to load it from the default device PC using the specified file name If it cannot find the file in either device an error message is returned Errors that can be returned Module not found file name File not found Insufficient memory Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 are Run R C 14 Format 5 pcm filename pc filename This command causes a file named pcm filename in the PCM RAM Disk to be saved to a PC file If the optional pem filename is omitted the PCM file name will be used and the file will be saved in the current directory of the current drive If the file does not already exist on the PC it is created otherwise the existing PC file is overwritten The pem filename may include 8 PC disk drive and or file path as described above for the L Load command EXE files which have been loaded to PCM RAM no longer contain relocation information They cannot be saved to PC files Possible errors are Module not found file name Cant save module file name Save reconfigure the PCM Format U configuration files This command reconfigures the PCM according to the specified configuration file If any ofthe modules specified in the configura
215. ation found in the UCDF to determine its function For more information on creating user configuration data refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 Configuring the PCM for CCM Operation If the PCM is configured for CCM ONLY or BAS CCM mode using the Logicmaster 90 configuration package CCM operation is automatically started on the specified port s on power up or following a soft reset The configuration of port characteristics data rate etc unit ID and assignment to port 1 or port 2 is also done with the Logicmaster 90 configuration package GFK 0255K Chapter 1 Introduction 1 13 Configuring the PCM for MegaBasic Operation If the PCM has firmware version 2 50 or greater it may be configured for BASIC or BAS CCM mode using Logicmaster 90 software With these modes the MegaBasic program in RAM automatically loads and starts on power up or following a soft reset pressing the Restart Reset pushbutton for less than 5 seconds A hard reset pressing the Restart Reset pushbutton for 10 seconds will cause MegaBasic to start in PROGRAM DEVELOPMENT mode For more information on MegaBasic operation see chapter 4 MegaBasic Note PCMs with firmware versions 2 04 and earlier do not recognize BASIC or BAS CCM mode Using one of these modes will cause a fault to be posted in the PLC fault table for the PCM rack and slot location Unsupported feature in configuration The UCDE PCM batch files
216. ation mode Not enough timers error 00066 3 Notation conventions for PCM NOWAIT example program SEEK 5 91 5 96 NOWAIT_WRITE 5 91 5 94 5 96 5 97 NOWAIT_WRITE_ABORT NOWAIT mode 3 12 5 68 NOWAIT READ function 6 6 NOWAIT SYSREAD commands example 5 62 NOWAIT IO functions 4 14 NUM FLIS 5 28 NUM READS 528 0 O get LED configuration command C 11 OK LED 1 5 Index Index 12 Index PCOP locks up 6 9 PCOP screen goes blank 6 9 PLC fault address subrecords 5 32 structure PLCFA RACKS PLCFA SLOTS PLCFA UNIT PLC fault table entries 6 3 PLC fault table records format IO ACTS IO FLT ADD IO 1 CATS IO FLT DESCS IO GRP IO SPECS o PET T IO FLT TYPES 5 29 10_FT 5 29 IO_REF_ADD PLC_FLT_ACT PLC FLT ADD 5 28 PLC FLT ERROR CODES PLC FLT GRP PLC FLT SPECS PLC FLT TSS PLC FT 5 28 spare reserved SS CONTROL PROG NUMS 5 30 SS NUM CONTROL PROGSS SS PLC STATUSS SS PRIV LEVELS SS PROGRAMMER FLAGSS 5 30 SS SWEEP TIMES 5 30 PLC status access to PLC fault tables and PLC status 5 21 PLC_CPU_ID 5 38 PLC_CPU_ID_VALID 5 38 PLC DATE 5 38 PLC FAULT BIT 8 PLC FAULT VALID 5 38 PLC FAULT HDR 522 PLC FAULT HDR NUM READ 523 PLC FLT ACT 5 28 PLC FLT ADDS 528 PLC FLT ERROR CODES 528 PLC_FLT_GRP 5 28 PLC_FLT_SPEC 5 28 In
217. automatically copied into the MegaBasic program execution RAM and executed by the MegaBasic interpreter upon power up or reset The RAM Disk is an area of RAM used to simulate a disk drive It contains all memory not used by MegaBasic Like any other storage medium hard disk or floppy disk the RAM Disk is used to store program and data files RAM Disk files are preserved by a battery when the PLC is powered off Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K RAM Disk If you store files to a RAM Disk they will remain only as long as power is present or the battery is connected and working Application programming errors battery failure battery disconnection and the removal of the daughter board from a Series 90 70 PCM have the potential to destroy files stored in RAM All RAM files should be backed up to a more permanent storage medium hard disk or floppy disk PCM Operation Modes The PCM has a Restart Reset pushbutton that is used to place the module in RUN mode or PROGRAM mode If the Restart Reset pushbutton is pressed for less than 5 seconds the PCM is placed in RUN mode This reset is referred to as a softreset CCM is started up on ports configured for CCM operation If the PCM has been configured to run a MegaBasic program and that program has been saved to the PCM RAM Disk RAM the program is automatically copied to the program workspace and executed by the MegaBas
218. backplane transfer failure interrupts CCM data Tx Rx failure BKP MSG communication failure TIMERI configuration problems 6 8 TIMER2 insufficient memory error TIMER3 known problems with fault table access TIMER4 5 33 TIMERS lossofcharacters MegaBasicTx Rx procedures failure 6 6 CHECK CPU HEALTH 5 36 5 46 OK LED not on 6 1 READ PLC CPU ID 5 45 Index 18 GFK 0255K Index CLS CUR CURS MV 6 5 13 integer and sing cpnstants 7 5 7 ATTRIB_OFF DW_SH 5 7 ERASE_BOLS ERASE BOTS ERASE_EOL ERASE LINES ERASE SCREENS ERASE_TOP RESTORECURS REVERSE SAVECUR SW_SH UNDERSCORE VT100 5 PGM 427 5 5 F 1 W Wait command C 16 W PBMEMS 5 16 TMEMS 5 16 Wait W command C 16 WAIT mode 3 12 5 68 Wait no wait flag 3 16 5 71 Watchdog timer 1 5 WORD 5 27 WORD 5 21 Workspace size MegaBasic WRITE_FINISHED 4 22 WRITE_PENDING WRITE RECEIVED 4222 WRITE TIMEOUT 4 22 WYE cable A 3 Index 19 READ PLC FAULT READ PLC RUN STATUS READ PLC STATUS 5 35 5 39 READ PLC TIME AND DATE UTILITY INIT 5 36 5 49 shared constants and variables CPU RESPONDING 5 38 DATE OF LAST CPU RESP 5 38 PLC CPU ID 538 PLC CPU ID VALID 5 38 PLC DATE 5 38 PLC FAULT BIT 5 38 PLC FAULT BIT VALID 5 38 PLC RUN STATUS 5 38 PLC RUN STATUS VALID 5 38 PLC STATUS WORD 5 36 PLC STATUS WORD VALID 5 38
219. been used to configure the Model 331 or higher CPU system the Series 90 30 PCM can still be plugged into the rack and will communicate to a CCM device In order to initiate the autoconfig default settings either clear the PLC or delete the PCM slot from the Logicmaster 90 30 configuration and then read it with the Hand Held Programmer The default values for autoconfig listed in the following table are the same as the default configuration values provided by the Logicmaster 90 30 software in CCM ONLY mode Table 2 4 Autoconfig Default Configuration Values Port 1 Port 2 CCM Enable Yes CCM Mode Slave Interface RS 422 RS 485 Data Rate 19200 Flow Control None Parity Odd Party 8 Retry Count Normal Timeout Long TurnA Delay TurnA Delay None CPUID 1 CPUID 1 To change any of the default configuration values provided or to use a different mode for the Series 90 30 PCM you must use Logicmaster 90 30 software PCOP or both to configure the PCM To use PCOB refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 Note If you have Release 3 00 or later PLC CPU and Release 2 50 or later PCM the Hand Held Programmer HHP may also be used to configure the PCM Refer to the section 3 for more information on using the Hand Held Programmer Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 18 Section 3 Configuring the Series 90 30
220. before the last soft reset to a PC file Enterinteractive DEBUG mode Command Loada file from the PC Save a file to the PC eXterminate delete a file Run an executablefile Killarunning task Clear the PCM Execute a batch file Show availablememory Get PCM memory ID Configure a user LED Reconfigure the PCM Create a memory module Show PCM config errors Show reset type and mode 10860 gt gt 8 8 8 Exitinteractive DEBUG The following commands are also available although most of these are seldom used Description except by PCOP Command Initializea device Format the ROM device Get LED configuration Set protection level Verify a file Wait for a background task Set upper memory limit gt 5 460 0 4 The remainder of this section provides detailed descriptions of the commands listed in the preceding tables The commands are presented in alphabetical order C 3 Appendix C PCM Commands Commands GFK 0255K execute a batch file Format file name This command executes the PCM batch file ile name No intervening space is permitted between the command and the file name These examples show how the command is used The file extension is optional in the last example MYFILE BAT is executed If no device is specified as in the first and last examples RAM is assumed QMY BAT PC A MYDIR MY BA
221. ber of formatting capabilities TERMF and PCOP provide several utilities that are useful for writing to terminals such as routines to clear the screen and position the cursor Refer 0 chapter 5 Advanced MegaBasic Programming for information on these utility programs The PRINT statement always waits until output is complete before continuing The NOWAIT IO functions described in chapter 5 provide buffered output which allows the program to continue while output occurs Serial Port Control and Status MegaBasic has several built in statements and functions for controlling devices and determining their status The two status functions are INPUT and OUPUT These are used to determine the input status and output status respectively of any device The INPUT function is particularly useful for determining when input data is available from an operator or external device Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 14 Accessing PLC Data Because the PCM and Series 90 PLC CPU are connected by the PLC backplane PCM MegaBasic programs can transfer data between the PCM and the PLC CPU very efficiently In order to transfer data a MegaBasic program must first create an association between a MegaBasic variable and an area in the PLC memory This is done with the SYSLINK statement Once a MegaBasic variable has been associated with PLC data the PLC data can be copied to or from t
222. c Programs Loading and Storing PCM Data Files Using TERMF Serial Port Setup with IOCTL and PORT_CTL BIN Timers and Logical Interrupts COMMREQs and Other Backplane Messages Section 1 Chapter GFK 0255K Page 5 91 5 100 5 110 5 114 GFK 0255K Description Section 10 describes the the NOWAIT I O commands thatsupportasynchronousserial communications Thesecommandsinclude NOWAIT OPEN NOWAIT CLOSE NOWAIT READ NOWAIT WRITE NOWAIT SEEK NOWAIT READ ABORT NOWAIT WRITE ABORT Section 11 describes the use of Series 90 70 VME functionsas alternatives for communicating with a Series 90 70 PCM Section 12 providesa complete programming example containing PLC VME functions and EXAM and FILL MegaBasic statements Section 13 describes how to maximize data throughput between the PCM and the PLC CPU Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 Title AsynchronousSerial Input and Output VMEFunctions PCM Programming Exampleusing MegaBasic Optimizing Backplane Communication Section 10 11 12 13 5 2 5 3 Section 1 MegaBasic Error Codes MegaBasic Error Codes Description Corrective Action One or more arguments to a PCM extensionis missing One or more arguments to a PCM extension is out of bounds One or more arguments to a PCM extension is of
223. can be run The backplane message queue is emptied in lines 160 190 and USER MSG PROC is installed as the BKP MSG interrupt procedure in lines 230 250 just as in the previous example At line 300 however the CHG PRIV procedure from GENERIC PGM is used to send a generic message to the PLC CPU CHG PRIV is described in chapter 5 section 3 Accessing P oL and Password Protected Data To make this example shorter and clearer the COMMREO status register is assumed to be 90150200 However the technique of the previous example is better Here the NEXT CMRQS signal is initialized and SYSLINKed in lines 350 360 and the program waits for messages in the loop starting at line 370 Chapter 5 Advanced MegaBasic Programming 5 83 GFK 0255K COMMREQ data is printed in lines 440 490 in the same way as in the previous example GFK 0255K If a message is nota COMMREQ the message type is printed in line 580 This version of the USER BKP MSG PROC procedure starting at line 630 has an additional complication It identifies messages by testing the message type field at character position 8 The hexadecimal values 94 D1 and D4 148 209 and 212 decimal identify generic message responses while 82 83 C2 and C3 130 131 194 and 195 decimal identify COMMREOSs To reduce the number of conditions that need to be evaluated by If statements the MegaBasic bitwise AND operator amp masks the bit that differs between 94 a
224. cated in I O address space at addresses 000011 000611 even addresses only The table below shows the port assignments Table G 4 Serial Controller Port Assignments 0000H Serial Port 1 Data 0002H Serial Port 2 Data 0004H Serial Port1 Control Status 0006H Serial Port2 Control Status GFK 0255K Appendix G Synchronous Serial Mode Operation G 3 NEC72001 Synchronous Clock Source Selection CR15 In synchronous mode the PCMA3 hardware defines the STRxC input as the Receive Clock RxCLK and the TRxC pin as either Transmit Clock In TXCLKTI or Transmit Clock Out TXCLKO Control Register 15 CR15 in the NEC72001 is used to control the synchronous clock sources The three operating modes listed previously correspond to the following settings of CR15 and the PCMA3 control registers defined in table G 3 Table G 5 Synchronous Clock Source Selection Operation 221 422111 TXCLK EN SYNCH EN NEC72001 CR15 Bit In 1 RS 232 Tx Clk Out Rx Clk In 2 RS 232 Tx Clk In Rx Clk In 3RS 422 485 Tx Clk Out Rx Clk In For Further Information For further information on the NEC72001 Serial controller please refer to the NEC Users Manual for the uPD72001 11 available from NEC Corporate Headquarters at 1 800 632 3531 8 am to 4 pm Pacific Time For technical support of the PCMA3 please call the GE Fanuc PLC Technical Support Hotline toll free at 1 800 GEFANUC G 4 Series 90 Programmable Coprocessor Module and Sup
225. ched in two relative moves of the cursor The direction parameters have a range of 1 to 4 C UP to C LF The count parameters specify how many positions to move the cursor default 1 in the specifieddirection In the following example a relocatable graphic string BIG PLUS is created and then displayed at several locations on the VT100 screen The only characters on the screen that are overwritten are those characters that are directly overlapped by the printable characters lt sp gt of the BIG PLUS graphic Access vt100 pgm BIG PLUS MV 009 MV CURS C LF 4 C DN BIG PLUSS 0 MV CURS C LF 4 C DN Print CUR 10 20 BIG PLUSS Print CURS 20 40 BIG PLUSS GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 13 In the next example the MV_CUR function is used to construct some line drawing primitives lines 70 85 Then a procedure is defined to use these line drawing primitives lines 100 190 Finally the main program clears the screen draws a few lines and then puts the cursor toward the bottom of the screen at the end of the program Access vt100 pgm 66A LINE UP MV CURS C LF LINE DN MV CURS C LF un Lo LINE RIS e s LINE LF MV CURS C LF 2 lt Def proc LINE DRAW DIR C UP CNT 1 Local I LINE OUTS Print Case begin on R Case C UP LINE OUT E UPS Case C D LINE OUT E DNS Case C RT L
226. cimal soft reset 8640 Hexadecimal hard reset GFK 0255K The two Logicmaster 90 70 ladder program rungs shown below will send a soft reset to a Series 90 70 PCM whenever contact T00001 is active and contact 76100002 is inactive Latching contact 70100002 assures that only one reset COMMREO is set FST SCN BLKMV MOVE INT WORD CONST 1 1 CONST 1 8 2 4320 LEN 00001 CONST IN2 0 CONST IN3 0 CONST IN4 0 CONST IN5 0 CONST IN6 0 CONST 7 0 100001 2 T00002 7 COMM C REQ T00003 1 200001 FT C CONST SYSID 0003 CONST TASK 0000007F Figure B 1 Soft Reset Series 90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K B 3 The next Logicmaster 90 70 program fragment will send a hard reset to a Series 90 70 PCM whenever contact T00011 is active and latching contact 76100012 is inactive MOVE WORD l l CONST IN Q4 R00018 8640 LEN 00001 T00012 C T00013 C Figure B 2 Hard Reset Logicmaster 90 30 versions of these rungs are slightly different because the Logicmaster 90 30 COMMREO function block does not have a power flow output Appendix B Resetting the PCM from a PLC Program FST SCN BLKMV INT CONST IN1 Q 4 R00011 2 CONST IN2 0
227. count parameters specify how many locations to move the cursor default 1 location in the specified direction In the following example a procedure is defined 216 PLUS that duplicates the action shown previously in the first example for the Mv CUR function Access vt100 pgm Def proc BIG PLUS MV CUR Print MV CUR C LF 4 C DN Print MV CUR C LF 4 C DN Print Return Proc end CUR 10 20 BIG PLUS CUR 20 40 BIG PLUS 6 In the next example a simple procedure is defined and used to waste time by bouncing the cursor left and right Access vt100 pgm Def proc WASTE TIME Local I For I 20 to 1 by 4 MV CUR C LF I C RT I 1 C LF I 2 CRT I 3 Next Return Proc end CUR 10 40 WASTE TIME Chapter 5 Advanced MegaBasic Programming 5 15 MV CUR GFK 0255K Section 3 Accessing P L and Password Protected Data GENERIC PGM supplies definitions and procedures to access Series 90 70 PLC reference data types not directly supported by the PCM backplane driver e g P and L and to access data protected by a user password in the Series 90 30 or Series 90 70 PLCs Attempting to SYSWRITE PLC data when PLC privilege level 2 is protected by a password will result in an error unless the PCM can gain access to level 2 as described here In addition GEN TEST PGM isa sample program using GENERIC PGM GENERIC DOC is a line number referenced documen
228. ction Procedure Description CLS Astatement that prints the control sequence to clear the screen ERASE SCREENS CUR 1 A function that takes row and column integer parameters and returns a control string that when printed to the VT100 device positions the cursor at the desired location This function may be used to build up larger control and text sequences screens for later display CUR1 A statement that takes row and column integer parameters and prints the resulting cursor positioning string ATTR 2 A function that takes a list of desired screen display attributes and returns a formatted Set Graphic Rendition SGR control string that when printed to the VT100 device sets the desired screen attributes to be used for the next text printed The attributes defined by this package for use with the ATTR functionand ATTR statementare ATTRIB OFE BLINK BOLD UNDERSCORE and REVERSE In addition if the device supports additional SGR controls such as TERMF s controls for foreground and background color parameter values 30 37 and 40 47 these controls may also be supplied to the ATTR functionand the ATTR statement ATTR A statement that takes a list of the desired screen display attributes and prints the resulting SGR control string to the VT100 device See ATTR function above MV CUR A function that takes direction and count parameters and returns the appropriate relative move cursor control string for usein relative cur
229. ction For MegaBasic applications first check the serial port configuration as previously described The flow control characteristics on both the PCM and attached devices are particularly important 2 In PCM firmware version 2 04 when a MegaBasic program receives characters on its STDIN channel serial port 1 by default input characters will be lost if a CTRL C character is received unless CTRL C checking is disabled This MegaBasic statement disables CTRL C checking xxx PARAM 1 1 Note that CTRL C checking is usually disabled when program development is completed regardless of the PCM firmware version Otherwise program execution will stop when a CTRL C is received 3 If you have Release 2 02 or earlier of the Series 90 70 PCM and are using the INCHR function on port 1 of the PCM a problem exists in the PCM firmware An upgrade to version 2 04 or later should correct the problem Meanwhile you may use port 2 if available or the NOWAIT READ function to work around the problem Note This problem does not exist in the 90 30 PCM 4 Another possible problem could be that the type ahead buffer on the PCM has overflowed The type ahead buffer can hold up to about 320 characters You may want to clear the type ahead buffer periodically in your program by adding this statement xxx WHILE LEN INCHR dev num 50 0 NEXT 5 Ifyou have unsuccessfully tried all of these suggestions an application error may be the pr
230. d COMMREQs The next example shows how The PLC ladder program for this example is based on the previous one However it sends COMMREQs repeatedly rather than just once As before the first COMMREQ is delayed 5 seconds after the program runs Then the PLC waits for the PCM to signal that it is ready for another COMMREQ The PCM sends its signal by using the SYSWRITE statement to put a non zero value into the COMMREQ status register in the PLC CPU Rung 9 is added to the ladder to test the COMMREQ status register R0200 for a non zero value When the PCM has sent its signal the test succeeds and T0003 is turned on to permit another COMMREQ The first COMMREQ needs to be sent before the PCM can send a signal A new MOVE INT block in rung 5 sets the status register to one on the first scan Then rung 9 permits the first COMMREQ The MegaBasic program in this example finds the status register location for each COMMREQ prints its data and then signals the PLC CPU to send the next one Most of the work is done in USER BKP MSG PROC which begins at line 550 The string variables used in the program are dimensioned in lines 80 110 The main program begins at line 120 In lines 150 180 it processes and discards any messages which were in the temporary queue when the program started Then in lines 220 240 USER BKP PROC is assigned to the MegaBasic BKP MSG logical interrupt Finally the COMMREO signal is initialized in line 290 and
231. d off line using any editor that creates ASCII text files However programs created off line can be executed only when installed in the PCM A separate version of the MegaBasic interpreter allows you to create and execute programs in a DOS based personal computer The MS DOS version of MegaBasic however does not provide the PCM extensions It is available from GE Fanuc as catalog number IC690SHP403 for 3 5 inch diskettes or IC690SHP404 for 5 25 inch diskettes The remainder of this chapter describes how to use MegaBasic in the PCM For information on MegaBasic commands and the MegaBasic language itself refer to the MegaBasic Programming Language Reference Manual GFK 0256 4 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Getting Started with the MegaBasic Interpreter Before the PCM can be used for MegaBasic applications it must be configured If your PCM has firmware version 2 50 or greater you can use Logicmaster 90 configuration software to configure the PCM for MegaBasic only BASIC mode or for simultaneous MegaBasic and CCM operation BAS CCM mode Refer to chapter 2 section 2 Configuring the PCM with Logicmaster 90 Software for information on BASIC mode configuration The PCM can also be configured and programmed for MegaBasic using the PCM development software PCOP PCMs with firmware version 2 04 or lower must use PCOP Refer to the Series 90 PCM Development S
232. data use POINTER and Rem HANDLE to find out what was just transferred Next Proc end If a user procedure is supplied for the BKP_XFER or BKP MSG interrupt the previous interrupt definition must be erased and a new definition activated by the user program before the new procedure is used as shown above and in the following example Example using NOWAIT SYSREAD Commands In this example a MegaBasic program monitors four analog input channels The data from each channel is read and scaled by the PCM checked for overrange and displayed as a bar graph on a screen channel XXXXXXXXX channel XXXXXXXXXXXXXXXXXX channel XXXXXXXXXXXXXXXXXXXXXXXXX channel XXXXXXXXXXXX There are several ways to solve this problem If the analog inputs were located together in the PLC and the MegaBasic program did not have to do any other processing the program could wait in a loop reading the inputs and displaying them as follows Dim integer INPUT_TBL 3 SYSLINK INPUT TBL SAI001 INT16 Do SYSREAD INPUT TBL For I 0 to 3 SCALE INPUT TBL I DISPLAY INPUT TBL I If INPUT TBL I OVERRANGE Then SEND ALARM I 1 Next Next Note It is assumed that the OVERRANGE constant and the SCALE DISPLAY and SEND ALARM procedures are defined elsewhere in the program or in another package Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 62 If the four input ch
233. dex 13 X eXterminate file 5 51 X eXterminate Y set upper memory limit C 17 PCM development package 1 3 PCM hardware not present error code 106 5 3 PCM module battery 1 6 cable and connector specifications cabling lico aa for Series 90 30 PCM E D type connector 1 12 hardware overview of the Series 90 30 PCM 1 11 hardware overview of the Series 90 70 PCM 1 9 LED indicators 1 4 memory on the Series 90 30 PCM 1 11 memory on the Series 90 70 PCM OK LED 1 5 option connector RS 232 cables RS 422 RS 485cables A 10 serial connectors 1 7 A 2 on the Series 90 30 PCM 8 ho seri EST ts on the Series 90 70 PCM 1 10 LEDs USER1 and USER2 1 6 USERI and USER2 LEDs 1 6 watchdog timer WYE cable 1 12 PCM module description 1 4 PCM support utilities for personal computers Mugen D 3 PCMEXTPGM 15500 0 communication failure 6 2 configuration problems 6 9 configuring and programming for MegaBasic 4 3 DEFAULTDAT PCOP does not go on line 6 2 troubleshooting Bi TERMSET to configure PCOP PCOP does not go ondine 62 deter mining the size of a MegaBasic program DISMISS MegaBasic program packages 4 11 SHOW STAT Program compaction utility CRUNCH f1 Program packages MegaBasic 4 11 Program example MegaBasic E 1 Programming example using VME functions 5 110 Programming examples MegaBasic 4 26 Pro
234. ds are not automatically transferred to the CPU the internal COMMREQ command 6003 Read Diagnostic Status Words to Source Registers is used to transfer these status words to the CPU An external device can access these status words using a READ command with target memory type 9 Table 3 7 explains the purpose of each diagnostic status word When CCM runs concurrently on both PCM serial ports each has its own copy of diagnostic status words Neither can report on the status of the other The Series Six diagnostic status words contain data referring to both ports Because the Series 90 maintains two separate sets of diagnostic status words the words referring to the other port have been removed in the Series 90 and the diagnostic status words reorganized as outlined in the following table The serial configuration data for both ports has also been removed The software version number remains in the same location as in the Series Six PLC Table 3 7 CCM Diagnostic Status Word Definitions Diagnostic Word Status Word Contents Byte 2 Byte 1 LSB Serial Port Error Code 1 Number ofSuccessful Conversations Numberof Aborted Conversations Number of Header Retries Number of Data Block Retries Number of Q SequenceSuccesses 7 Number of Peer to PeerCollisions 8 11 Reserved 00H 12 CCM Software Version Number 13 COMMREQ Error Code 14 Reserved 00H 15 20 COMMREQ Data Block Contents 1 See table 3 12
235. e background task is using the file server This is not a problem with tasks run in foreground mode because the command interpreter is suspended until the foreground task completes This command is also useful for insuring that one task is completely initialized before starting another task Itis commonly usedin BAT files Wait eXterminate file Format X file name This command deletes a file named file name inthe PCM RAM Disk Possible errors are Module is use file name Module not found file name Note The specified file is deleted immediately There is no confirmation prompt nor is there any method for recovering a deleted file Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K W X C 16 Y set upper memory limit Format Y limit PCM memory may be divided between the operating system and one or more applications Setting a limit on the memory used by the operating system causes it to ignore all memory above the limit It will never load programs or allocate memory buffers there Application programs can determine the limit with the GET MEM LIM utility and access memory above the limit through the use of pointers or absolute addresses The optional limit argumentis the amount of memory in 16 byte paragraphs to be retained by the operating system It is specified as a hexadecimal value and must be at least 800 32K bytes to leave
236. e CCM COMMREQs no status information is returnedautomatically The PCM program must contain code for this purpose The first word of the status pointer memory type contains a reference type selector value 16 discrete input table lI 18 discrete output table Q 8 registermemory R 10 analog input table AI 12 analog output table AQ The second word offset contains the offset within the specified reference type to the status data The location and content of the status information depends upon the user application Idle Timeout Set the value to zero e g NOWAIT Value Maximum Set the value to zero e g NOWAIT Communication Time Chapter 5 Advanced MegaBasic Programming GFK 0255K MegaBasic COMMREQ Example The following example is a complete MegaBasic COMMREO application for the PCM including PLC Ladder logic and MegaBasic program segment For this example the PCM must be configured using PCOP to permit LED 1 to be controlled by the MegaBasic program The PLC program uses the COMMREO to command the PCM to blink or turn off the PCM s User LED 1 This is done by sending a single word with the following translation in the MegaBasic program Blink LED continuously Blink LED once Turn LED off Blink LED continuously 02 Note that it is also possible to simply turn the LED on but this program does not use that indication On the first scan the C
237. e Manual GFK 0265 For more information about Series 90 70 VME bus applications refer to the Series 90 70 Programmable Controller User s Guide to the Integration of Third Party VME Modules GFK 0448 5 108 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K MegaBasic Program Access to PCM Dual Port RAM The PCM memory map places the dual port RAM in the address range 0A0000h to OA7FFFh for the current revision of the Series 90 70 PCM The PCM User MegaBasic program uses EXAM and FILL statements to access the PCM Dual Port RAM The EXAM statement is used to read data from a specified location in the PCM dual port RAM The FILL statement is used to write to a location in the dual port RAM The format of the EXAM statement is EXAM st addr var list Parameter Description Starting Address Thestarting address of the data VariableList Thelistofvariables separated by commas The format of the FILL statement is FILL st addr data list Parameter Description Starting Address Thestarting address of the data Data List The list of data items separated by commas The address of the data in the PCM dual port RAM is usually represented as a segmented address using two words segment and offset Example EXAM and FILL statements EXAM 0A000h 4000h QDATA FILL 0A000h 605Ah Q1 Note The 9 character in the examples above denote
238. e bre sae ee CEM Status Word sessu Section 4 CCM COMMREO Data Block Section 5 CCM COMMREO Status Word Section 6 CCM COMMREQ Example ess Section 7 PLC System Communications Window Series 90 70 System Communications Window PLC Service Request SVCREQ 0 cece eee Series 90 30 System Communications Window 4 SVCREO Examples entere erbe Maher eae Goan Contents Chapter 3 viii Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 Contents Chapter 4 MlegaBasiC 42x22 rero OREL CI Ps ica RR UR RC eae 4 1 Section 1 Programming the PCM in MegaBasic 4 2 Getting Started with the MegaBasic Interpreter 4 3 Loading and Saving MegaBasic 0298 4 4 Backing Up Your Program 0 6 66 6 eens 4 5 Exiting the MegaBasic Interpreter 600660060002 4 6 Saving Data through a Power Cycle or Reset 4 6 Compatibility with MS DOS 162828546 4 7 MegaBasic Features Not Supported by the PCM 4 8 Modifying Existing BASIC Programs for MegaBasic 4 8 Printing a MegaBasic Text File 2 0 0 0 6 cee ee 4 9 Using a Text Editor to Create MegaBasic Programs 4 9 MegaBasic Program and Data Size 2222222022 4 9 Determining the Size of a MegaBasic Program suus 4 10 MegaBa
239. e first step in the installation procedure is to physically install the PCM hardware and verify that it is working properly Overview In a single rack system the PCM resides in the same rack as the PLC CPU In a multiple rack Series 90 70 PLC the PCM can reside in either the CPU rack or an expansion rack The Series 90 30 PCM must reside in the main rack with the CPU The following illustration shows two possible system configurations for installing a Series 90 70 PCM in either a local or expansion rack LOCAL RACK CONFIGURATION 842732 P CI P S P C E U M CPU RACK EXPANSION RACK N 8 N P BIP S P T S RIC i UM M M Figure 2 1 Series 90 70 PCM Configurations The power supply CPU and Series 90 70 Bus Transmitter BTM or Bus Receiver Module BRM must reside in specific slots within each rack The CPU module must be located in slot 1 of rack 0 The Series 90 70 system usually includes a Bus Transmitter Module BTM The Bus Transmitter Module may be located in any slot as long as it is not to the right of an empty slot If the PLC system has more than one rack a Bus Receiver Module BRM must be located in slot 1 of each expansion rack Note Version A of the Bus Transmitter Module must be installed to the right of all other GE Fanuc modules There must be no empty slots between the
240. e other NOWAIT statements GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 93 NOWAIT READ and NOWAIT WRITE The NOWAIT READ and NOWAIT WRITE statements handle the movement of data between the MegaBasic program and various devices Their formats are NOWAIT READ channel handle str lt 15 xfer handle NOWAIT WRITE channel handle str vbl1 xfer handle Argument Description ChannelHandle An integer that was returned as the result of a previous NOWAIT OPENcall String Variable A MegaBasic string variable that has already been defined in the program The length of this string variable may up to 65 535 bytes The number of bytes read or written depends upon the current size of the string variable TransferHandle Anoptionalinteger number in the range 0 through 65 535 that identifies a particular transfer When the transfer completes an interruptis generated This number is then made available to the interruptprocedure Whena NOWAIT READ or NOWAIT WRITE completes an interrupt is posted to the interpreter If there is no interrupt procedure defined the interrupt is ignored In most cases however it is advantageous to use interrupt procedures If user procedures are supplied for the NOWAIT READ or NOWAIT WRITE interrupts the old interrupt definition must be erased and a new definition activated by the user program before the new procedures are used much the same as for backplane interrupt p
241. e pointer to the SYSTATUSS function For more information on pointers refer to chapter 9 in the MegaBasic Programming LanguageReferenceManual GFK 0256 Handle A MegaBasic integer variable which when PROCESS XFER completes contains the handle specified for the variable that was transferred when it was SYSLINKed If no handle was specified zero is returned The handle can be used for any purpose by the application Typically itis used to organize variables into groups thatreceivesimilar processing Note Both the pointer and handle arguments are MegaBasic variables whose values are set by PROCESS XFER for later use in the interrupt service routine Since they are set by PROCESS XFER they do not have to be initialized before the PROCESS XFER statement is executed GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 61 The interface between the PCM and PLC allows several backplane transfers to complete at once In order to ensure that all transfers are processed the XFER interrupt procedure must use the PROCESS XFER statement repeatedly until zero is returned in the pointer variable indicating that there are no more unprocessed transfers In the following example the BKP_XFER interrupt procedure does not return until the pointer variable is set to zero by PROCESS XFER Def Proc USER BKP XFER PROC Local POINTER HANDLE Repeat PROCESS XFER POINTER HANDLE If POINTERS 0 Then Return Rem Process the
242. e that reported the fault See discussion below of PLC fault addresses PLC_FLT_GRP A one byte integer specifying the fault group of the fault PLC FIT ACT A one byte integer specifying the action code of the fault PLC ERROR CODES Atwo byte integer WORDS specifying the actual error code for the fault PLC FIT SPEC 8 or 24 bytes of fault specific or extra fault data rarely used PLC FIT TS A six byte field containing the time stamp when the fault occurred See discussion below of time stamp subrecords Referto the Series 90 70 Programmable Controller Installation Manual GFK 0262 for additional terms associated with Series 90 faults 5 28 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K I O Fault Table Records When a non zero number of fault records is requested from the I O fault table you may receive one or more I O fault records The actual number of records returned may be determined from the NUM READ field of the IO FAULT HDR record described above Each I O fault record contains 42 bytes and has the following format Field Description IO FT Aone byte flag indicating the type of fault record and how much of the IO FLT SPECS field is valid data The codes used for this field are 2 Faultrecord 15 anI O fault record Only the first5 bytes of IO FLT SPECS data are valid 3 Faultrecord isanI O faultrecord All21 bytes of
243. e the serial port settings first type 1 to display the current values Then type the number corresponding to the setting to be changed A new menu will appear showing all possible values for the selected setting Choose one of the values from this menu Be sure the new port settings match the configuration of the PCM port used for programming When all the settings are correct type E to return to the main menu 4 To change the video adapter display hardware settings type 2 If the display settings are correct answer N to the prompt to avoid changing them Generally the display adapter type is the only setting that should need to be changed If it is incorrect type Y An explanation of the display parameters is provided in the following table 2 26 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 27 Description Specifies the type of display adapter your personal computer uses to drive the attached video monitor CRT The six hardwareselections are 1 EnhancedGraphics Adapter VWdeoGraphics Array EGA V 2 ColorGraphics Adapter CGA e g Workmaster computer 3 Good CGA without snow i e anon IBM CGA compatibleadapter 4 Monochrome Display Adapter MDA 5 Vega7 Deluxe MultisyncusingVEGABIOS SYS 6 EGAdrivinga Monochrome Display Specifies the number of lines to be displayed on one video page Range 10 60 lines Default 25 Display
244. e the state of the PCM without having a terminal connected The OK LED top LED indicates the current status of the PCM The function of the USER1 and USER2 LED indicators middle and bottom LEDs respectively can be configured by the user program or PCOP By default these LEDs indicate transmit and receive activity on serial ports 1 and 2 respectively The option connector on the Series 90 70 PCM provides for the addition of expansion memory The Series 90 30 PCM does not have an option connector Table 1 1 Series 90 70 PCM Expansion Memory and Accessories Catalog No Description IC697MEM713 Expansionmemory 64 Kbytes IC697MEM715 Expansionmemory 128 Kbytes IC697MEM717 Expansionmemory 256 Kbytes IC697MEM719 Expansionmemory 512 Kbytes IC697 ACC701 Replacementbattery package of 2 IC690CBL701 PCM to IBM XT compatible 9 pin serial connector IC690CBL702 PCM to IBM AT compatible 9 pin serial connector IC690CBL705 PCMtoIBMPS 2compatible25 pin serial connector Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 1 10 Section 5 Hardware Overview for the Series 90 30 PCM The Series 90 30 PCM features include An 8 mHz 80C188 microprocessor On board RAM options of 160 192 or 640 Kbytes Two serial ports one RS 232 and one RS 232 RS 485 Backplane access to PLC memory A real time calendar clock synchronized to the PLC ARestart Reset pushbutton Three s
245. ear from the display indicating that the new values are being used by the PCM and have been saved in the PLC s non volatile memory If you decide to abandon the changes that you have made so far they can be discarded by pressing the CLR and ENT keys If you do this the configuration parameters will revert to the values they had before the configuration was frozen If you attempt to leave the current slot either by pressing the or key while the module s configuration is frozen you will be prompted to indicate whether to use the new combination of values discard the new values and return to the old configuration or to continue editing the changes If you attempt to change the HHP mode or go to RUN mode the FROZEN error message will be displayed Note Once changes have been made which are not being used by the module you cannot leave the slot until the changes are saved or discarded GFK 0255K Chapter 2 Installing the PCM 2 19 Example of Editing a PCM For this example assume that a 192K PCM IC693PCM301 module resides in slot 2 of the CPU rack and that the PLC was powered up with the CLR and M T keys depressed that is the PLC was cleared In our example we want to change the mode from CCM only the default to PROGRAMMER PORT and to change the data rate for both ports to 9600 baud 20 02 PCM301 lt S Initial display VERSION 3 01 To view the mode parameter Press 552 key 20 02 PCM301 lt S MODR CCM ONL
246. earch path is defined in the AUTOEXEC BAT file located in the root directory of the disk drive from which MS DOS is started the boot drive which is usually drive C Using any text editor program edit the AUTOEXEC BAT file If the file does not contain a path command similar to path c dos add the following command as the first line of the file path c pcop If there is already a PATH command add this text at the end of the path definition Cc Mpcop If TERMF was not installed on the C drive use the correct drive letter in place of c Ifthereisno AUTOEXEC BAT file in the root directory of the boot drive create one with your text editor Include only a PATH command as above which specifies the PCOP directory on the correct hard drive Note The AUTOEXEC BAT file may begin with an ECHO OFF command in the first line If one is present the PATH command should appear in the second line GFK 0255K Chapter 2 Installing the PCM 2 25 Section 5 Using TERMSET to Configure TERMF or PCOP Before TERMF or PCOP can be used to program the PCM it requires information about the display hardware in your computer and the serial port settings to be used for communication with the PCM This information is provided by a data file named TERM DAT A default version of TERM DAT installed with TERMF or PCOP contains display hardware settings for the Workmaster industrial computer from GE Fanuc These settings will work with any computer th
247. ecord The return value of the function is the integer value of the first two bytes of the string parameter passed to the function The format for using the WORDS function is xxx result WORDS str Parameter Description Astring with current size of at least 2 Result An integer value containing the first two bytes of the string combined into a single word In the following example the WORD function converts the PLC status word field of the short status record to an integer The integer is then formatted as a 16 bit hex number and printed Note that 4h4 is a print format that displays 16 bit values as 4 digit hex numbers including leading zeroes if necessary More information on the PLC status word is provided later in this section 50 Access READ FLT pgm 600 SYSREAD SHORT STATUSS 610 Print 4h4 WORD SHORT STATUSS SS PLC STATUS In the next example the header record for the I O fault table is read The number of faults field is converted by WORD function and then printed 50 Access READ FLT pgm 100 Dim TEMPS 42 300 READ FAULT TBL TEMP 310 Print WORD IO_FAULT_HDR NUM_FLTS I O faults present GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 27 Fault Table Header Records When using the READ FAULT TBL procedure a header record is returned through the IO FAULT HDR or PLC FAULT HDR string variables Header records are the same for both fault tables and con
248. ed Serial port communication is light There is only one PCM in the system and it is is the only intelligent option board The PLC System Communications Window time is at least 10 milliseconds MegaBasic does not wait for long periods of time Any deviation from these conditions may prevent data from being transferred on every sweep 5 114 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K MegaBasic programs wait for file server activity input on the serial ports backplane commands issued without the NOWAIT argument and the WAIT statement During these times MegaBasic variables are not updated However variables that are periodically read from the PLC CPU continue to be transferred into temporary buffers so that when the program finishes waiting it gets the latest copies of CPU variables Periodic writes are suspended while MegaBasic is waiting Backplane Processing for the Series 90 30 PCM The communication channel between the Series 90 30 PCM and the PLC CPU consists of a high speed serial backplane link On the PCM side there is one queue for outgoing messages from the PLC and one queue for incoming messages to the PCM These queues may each contain two messages each On average Series 90 30 PLCs can process one message or less per sweep If CCM and the user program attempt to send several NOWAIT messages at once the outgoing message queue may run out of space very quickl
249. ed the checking of the CPU s health is stopped The delay parameter is the minimum number of milliseconds that the UTILITY PGM package will wait before rechecking the PLC CPU s health An example of the CHECK CPU HEALTH procedure is Access utility pgm CHECK CPU HEALTH 1000 Repeat If not CPU RESPONDING then Print PLC CPU not responding to PCM If TIME AND DATE LAST CPU RESP VALID then Print CPU s last response was at Print DATE OF LAST CPU RESP TIME OF LAST CPU RESP eise Print CPU has never responded to the PCM where the CHECK CPU HEALTH procedure is used to setup the periodic read of the PLC CPU s short status from the SRP every second In the main loop of the program the CPU RESPONDING flag is checked every time through the loop If it indicates that the CPU has stopped responding a time stamped message is put out indicating that the CPU has stopped talking to the PCM Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 46 Another example of the CHECK CPU HEALTH procedure is Access utility pgm PROLOGUE CHECK CPU HEALTH 1000 Return EPILOGUE CHECK CPU HEALTH Return Repeat If not CPU RESPONDING then Print chr 7 32 ext where in the prologue to this example package a check of the CPU s health is set up to occur every second and in the epilogue this check of the CPU s health is stopped In the mai
250. ed in milliseconds The default selection is to stop checking the CPU s health Unlike other procedures calling this procedure with no parameters does not perform a one time check of the CPU s health A procedure used to obtain the status of a faultsummary bit from the PLC CPU Faultsummary bits indicate the presence of one or more faults in a specified rack slot bus or module Optional parameters for this procedure include four parameters to indicate the desired fault summary bit and two parameters for the selection of NOWAIT and the repetition rate The default selection is to return the rack 0 fault summary bit waiting for the response and to do the transfer only once A procedure used to re initialize the interrupt linkages used for the various timers and backplane interrupts for the proper functioning of the rest of the procedures in this package This procedure is called automatically in the PROLOGUE section of the package but may also be called at any time to re establish the interrupt routine linkages and timer states after the execution of other packages routines using the same interrupt s or timer s as the UTILITY PGM package Procedure CHECK_CPU_ HEAITH READ_PLC_ FAULT BIT UTILITY INIT Shared constants and variables defined in the UTILITY PGM package are described in the following table Table 5 8 UTILITY PGM Package Shared Constants and Variables Description A constant 1 used to ind
251. ed out during an attemptedtransfer It is a good idea to check for this error on the first SYSLINK in a program in case the CPU has not yet completed its initialization A NOWAIT_READ or NOWAIT_WRITE is attempted after a channel has been closed The user program exceeded the maximum designated outstanding buffer space for NOWAIT 1 0 The program must specify that this condition should cause an error otherwise no error is posted Either an invalid serial port setup string was passed to the IOCTL statement or the IOCTLS function or MegaBasic attempted to reconfigure a serial port used by another task An invalid device name was passed to the OPEN statement or to the DIR or DESTROY command A parity error was detected in received serial data Anoverrun error was detected in received serial data A framing error was detected in received serial data Two or more different parity overrun or framing errors were detected in received serial data Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 Status Backplane Transfer Failure Undefined Local Variable Improper Variable Type CPU Name String Too Long Basic Extensions Incompatible Illegal Backplane Operation Backplane Timeout Illegal NOWAITI O Operation Buffer Space Exceeded Invalid IOCTL String DeviceUnavailable Serial Port Parity Serial Port Overrun Serial Port Framing Serial PortMultiple C
252. ed to the PLC ARestart Reset pushbutton Three status LEDs Soft configuration no dip switches or jumpers Occupies a single slot in Series 90 70 racks Memory on the Series 90 70 PCM consists of PROM local RAM and dual port RAM PROM contains the operating system the CCM protocol a built in MegaBasic interpreter and related utilities Local RAM is divided into two data areas one for PCM internal use and the remainder for the user s data and programs Dual port RAM is used for communications between the PCM and the Series 90 70 PLC CPU 4274 VME Sm BUS LOGIC RACK CONNECTOR MSS psi GOR ROLLER 32K X16 INTERFACE NMI INTI 4 gt 1 m PCMOKLED O 4 USER 1 LED o 4 RS 232 485 USER 2LED o SEL PORT PORT ONE gt TWO NMI RESET MICROPROCESSOR e 4 1 mE es S 8 F 32 LOCAL BUS Figure 1 3 Series 90 70 PCM Hardware Block Diagram GFK 0255K Chapter 1 Introduction 1 9 GFK 0255K Two serial ports are provided for communication with a programming terminal CRIs bar code readers and other devices These ports are identical in function On the Series 90 70 PCM both ports support RS 232 and RS 485 operation through software configuration The PCM has three LED indicators that enable you to determin
253. efault 0 Available in PCM firmware version 3 00 or later lt typeahead_size gt the typeahead buffer size in characters for the port The port can ac cept up to one less than this number of characters without overflow before an application reads the port When overflow occurs any additional characters will be lost Any size in the range 64 32750 bytes may be specified but the maximum may be limited by avail able system memory Default 320 Available in PCM firmware version 3 00 or later lt PLC_access_password gt lt disable_clock_sync gt where lt PLC_access_password gt the PLC access password for privilege level 2 or higher If passwords are enabled in the PLC CPU and the PLC has passwords at level 2 and higher the PCM will be unable to read or write PLC memory until the PCM sends a valid pass word Passwords are case sensitive and valid passwords may have upper case letters numbers and underbar 7 characters only If an empty string is specified for PLC access password a password consisting of eight NUL characters will be sent to the PLC CPU There is no default disable clock sync N disables backplane messages the PCM normally sends once per second to synchronize its internal time of day with the PLC CPU Any character oth er than N or n enables clock synchronization Available in PCM firmware version 4 03 or later Some applications may be sensitive to the impact that clock synchroniza
254. encountered MegaBasic stops and returns to PROGRAM DEVELOPMENT mode Pressing the Enter key displays the last few lines that were executed If a MegaBasic program terminates instead of looping continuously or if an END statement is encountered there are two possible results If the program was started from MegaBasic in PROGRAM DEVELOPMENT mode MegaBasic returns to PROGRAM DEVELOPMENT mode just as if it were stopped If the program was run automatically by configuring the PCM with Logicmaster 90 software saving the program to RAM BASIC PGM and resetting the PCM however MegaBasic itself will exit This also happens if you type BYE from the MegaBasic command line If your PCM was configured using Logicmaster 90 software and you type BYE or press the Enter key after the PCM has completed running a MegaBasic program the gt character is displayed At this point you are no longer communicating with MegaBasic A hard reset pressing the Restart Reset pushbutton for 10 seconds returns the PCM to MegaBasic PROGRAM DEVELOPMENT mode If MegaBasic was started with PCOP exiting MegaBasic will return you to a PCOP menu Refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 for details Saving Data through a Power Cycle or Reset When the PCM is reset the MegaBasic program is restarted and all of its variables are initialized to zero If data must be saved through a power failure it can be written to a RAM Disk
255. ent Timer 1 TSTARI 1000 REP would generate an interrupt from timer 1 every second beginning one second from the time that the statement is executed Note that the timer 1 interrupt must be defined and enabled before the program can recognize it GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 59 The timer interrupt procedure is specified by these statements 10 Interrupt TIMER1 end 20 Interrupt TIMER1 TIMER INT PROC 30 Interrupt TIMER1 on where TIMER INT PROC is assumed to be the name of the interrupt procedure to process the timeout Although the timer utilities have resolutions of one millisecond you must be careful when using timers with small values especially when many timers are used Some of the more powerful MegaBasic instructions can take a millisecond or more to execute This can potentially cause interrupts to be missed In cases where this may bea problem the INTERRUPT function can be used to determine if interrupts are being missed Programs can be debugged using this function which can later be edited out for increased speed The function call INTERRUPT 3 returns zero when a timer interrupt has been posted but has not been serviced The function call INTERRUPT 2 returns the timer number For more information on the INTERRUPT function refer to the MegaBasic Programming Language Reference Manual GFK 0256 Backplane Interrupts Two interrupts are provided by the PCM for backplane com
256. ent catalog numbers such as an ADC CMM or PCM301 you may need to upgrade to Release 2 0 PLC in order to configure the PCM PCMs with firmware version 2 04 or earlier do not support the Logicmaster BASIC or BAS CCM configuration modes 1 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K s PCOP Configuration 1 Usingthe configuration editor verify that the configuration specifies the desired operation Did you load the configuration data to the PCM In ONLINE mode press MDIR from the Utility screen A file called UCDF should be present on the PCM 2 Edit UCDF from the Advanced functions press READ UCDF to make sure the file contains the correct configuration 3 For CCM configuration is CCM enabled on this port Refer to the procedure above under the heading CCMTx RxFailure 4 For MegaBasic configuration is MegaBasic enabled on the desired port Are STDIN STDOUT and STDERR set to the desired port or other location Have you selected to start the program automatically from reset and entered the program name This is usually desired 5 Ifthe configuration does not take effect check the PCM Runtime Errors screen Possible configuration errors which might be displayed on this page include Insufficient Memory and Module not Found PCOPScreen Goes Blank or PCOP Locks Up 1 Check that there are no drivers or other packages e g communicat
257. ent for exiting from TERMF should never be changed when using PCOP A change to this setting will prevent PCOP from functioning as expected Defaultselection When these selections are correct type N GFK 0255K Chapter 2 Installing the PCM 2 29 Menu item 4 selects a screen that displays the current values for display attributes These values select the foreground and background colors for characters based on the status of the graphics rendition modes reverse intensify underline and blink This selection allows you to change the colors of the display used by TERMF and PCOP The values are coded as two hexadecimal digits representing a string of eight bits The three least significant bits 1 through 3 code the foreground color bit 4 specifies high intensity bits 5 through 7 code the background color and bit 8 specifies blinking TERMSET shows the names of the colors which correspond to the numeric values selected for foreground and background colors These are the colors displayed on CGA EGA and VGA color displays If your computer has a monochrome display you should use the default display attributes To redefine any of the display attributes type Y and respond to the prompts for attribute combination number and hexadecimal attribute value When the settings are correctly displayed type N Menu items 5 6 and 7 select screens that display the scan codes contained in the normal application and cursor key bindin
258. er the PC device before attempting to use the command interpreter Command Format A I PCM commands begin with a single letter which identifies the command The complete command is an ASCII string terminated by an ASCII CR 0D hexadecimal character Command arguments are separated from the command character and each other by one or more spaces Note When using PCM commands in batch files with certain PCM firmware versions see appendix D PCM Batch Files the command letter must be uppercase characters You can avoid batch file errors by using uppercase characters exclusively in PCM commands Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K C 2 gt For example Notation Conventions Arguments are shown as symbolic names within angle brackets lt lt file_name gt represents a string of ASCII characters containing the name of a file pcm filename represents a string of ASCII characters containing the name of a PCM file led use code represents two ASCII characters containing a one byte They may be omitted all hexadecimal value etc Optional arguments are shown in square brackets other arguments are required PCM commands are summarized in the following table Description Show a directory of files in memory Get the PCM revision number Show PCM task information Show the location of the PCM Dump the state of the PCM just
259. er than the PLC watchdog timer setting If two or more COMMREOS can occur during a single PLC sweep the total of the timeout values for all the COMMREQs must be considered Failure to observe this precaution can cause the PLC watchdog timer to expire halting PLC execution when a CCM problem occurs Information on the two COMMREO timeouts is presented below For information on reading PLC watchdog timer settings and configuring the Series 90 70 watchdog timer refer to the Logicmaster 90 70 Programming Software User s Manual GFK 0263 The Series 90 30 PLC watchdog timer is not configurable 3 16 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Status The two status pointer words specify a PLC memory location where the Pointer status word returned by CCM will be written when the COMMREO Memory completes Type Status Pointer Memory Type address 2 word 3 Status Pointer Offset address 3 word 4 Status pointer memory type contains a numeric code that specifies the user reference memory type for the CCM status word The table below shows the code for each reference type For This Memory Type Use This Value l Discrete input table 16 Q Discrete output table 18 R Registermemory 8 AI Analog inputtable 10 PAQ Analogoutputtable 12 The high byte at address 2 should contain zero Status The word at address 3 contains the offset for the CCM status word Poi
260. erence Manual GFK 0265 Series 90 30 Programmable Controller Installation Manual GFK 0356 Logicmaster 90 Series 90 7 30 and 90 20 Programming Software User s Manual GFK 0466 Series 90 30 90 20 Programmable Controllers Reference Manual GFK 0467 Series 90 PLC Serial Communications User s Manual GFK 0582 Series Six Data Communications Manual GEK 25364 Series 90 70 Programmable Controller User s Guide to Integration of Third Party VME Modules GFK 0448 Series 90 70 System Manual for Control Software Users GEK 1192 Control User s Manual GEK 1295 We Welcome Your Comments and Suggestions At GE Fanuc Automation we strive to produce quality technical documentation After you have used this manual please take a few moments to complete and return the Reader s Comment Card located on the next page Henry Konat Technical Writer Preface v GFK 0255K Contents Chapter 1 Intioduchon s eus sea DCOHERLRG dp ea oU RICE RR CHO BRA RA bd qe 1 1 Section I System 1 1 Section 2 Functional Overview esee 1 2 CCM Operation senescere ee Obs aud Meee eren qoe 1 2 MegaBasic Operation 0666666666 666666606666060 600000000000002 1 2 RAM DISK 321 tao Ere Les E seh ee idee 1 2 PCM Operation Modes 620 6666666 666666666660660 eee 1 3 PCM Support Utilities for Personal Computers 0004 1 3 Section 3 PCM Module Description sees 1 4 LED Ind
261. eries 90 30 PCM In order to use an RS 232 cable on port 2 of the Series 90 30 either a special cable must be made according to the serial port pin assignments shown above or a WYE cable must be used Standard Series 90 70 PCM cables can be used for the Series 90 30 PCM when the WYE cable is used GFK 0255K Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 A 4 The prewired cables shown below provide the required signal connections between the RS 232 serial port on a PCM and a serial port on the programmer Each of the cables physically appear the same the only difference is the internal pin connections An IC697CBL701 cable provides the required signal connections between a PCM and a 842831 PCM 25 PIN FEMALE PIN RD TD CTS DTR DCD SHLD GND Y N 0 5 0 25 PIN MALE Cu RD RT CT DC DTR qO00040HnmN 9 PIN MALE 9 PIN FEMALE 242829 PCM 3PL IC690CBL701 RS 232 DEFAULT PORT Figure A 4 PCM to Workmaster Computer Workmaster industrial computer Cabling WORKMASTER loo An IC697CBL702 cable provides the required signal connections between a PCM and an 242832 PCM qJ PIN DCD RD TD DTR RTS CTS GND NON
262. eries 90 70 PCM and only for RS 422 or RS 485 port configurations parity O E N the type of parity checking Odd Even or None data bits 7 8 the number of data bits per character Use 8 unless text with 7 bit characters will be the only data transferred stop bits 1 or 2 the number of stop bits per character The normalselection for 300 baud and higher is 1 flow control H S or N the flow control method Hardware CTS RTS Soft ware X ON X OFF or None With hardware flow control RTS is turned on when the port is ready to transmit Then transmission begins when CTS becomes active RTS remains on until delay value expires after the last character is sent With software or no flow control RTS is not turned on and transmission begins immediately physical interface 232 422 or 485 the physical connection protocol for the port RS 323 RS 422 or RS 485 RS 422 is equivalent to RS 485 All Series 90 30 PCMs support RS 232 only on COMI IC693PCM300 supports RS 422 485 only on COM2 duplex mode 2 4 or p the type of physical connection 2 half duplex 2 wire for RS 422 485 4 full duplex 4 wire for RS 422 485 p point to point Available in PCM firmware version 3 00 or later In point to point mode 6 The receiver for the specified port is always enabled 6 When physical inter face 422 or 485 all RS 485 line drivers for the specified port are enab
263. erpreter to allocate a specified block of PCM RAM to MegaBasic to send a message to MegaBasic to execute a program named BASIC PGM and then to run the MegaBasic interpreter If BASIC PGM is found it is then executed When the command interpreter starts it executes the commands in PCMEXEC BAT just as the MS DOS command interpreter uses the AUTOEXEC BAT file when MS DOS is booted However PCMEXEC BAT is not executed following a hard reset HARDEXEC BA Files When a hard reset occurs the operating system looks for a file named HARDEXEC BAT in the RAM Disk If this file is not found and the PCM has been configured for BASIC or BAS CCM mode anew HARDEXEC BAT is created It containsan R Run command which allocates a block of memory to MegaBasic and then starts the MegaBasic interpreter In this case no MegaBasic program name is specified and MegaBasic starts in command mode D 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 2 User Installed PCMEXEC BAT and HARDEXEC BAT Files You can create your own version of PCMEXEC BAT and or HARDEXEC BAT and load them to the PCM RAM Disk The commands you put in your PCMEXEC BAT will control the PCM whenever it powers up or a soft reset occurs Similarly commands in your HARDEXEC BAT control the PCM when a hard reset occurs Use your computer and any text editor which produces ASCII text files to create these files Then use the L
264. es notsupport Logicmaster 90 configuration as for a Release 1 PCM NONE mode is only available in Logicmaster90 70software PCMCFG PCM CFG indicates that all configuration data for the PCM is selected using PCOP and loaded to the PCM as User Configuration Data UCDF or that a PCMEXEC BAT file specifies the configuration to be used PROG PRT PROG PRT is a special mode used to configure port settings for the PCM withoutautomaticallyrunning a MegaBasic program or CCM PROG PRT mode is selected for special applications using PCOP for configuration The serial port configuration specified with this mode becomes effective only after a hard reset or if no other configuration exists on the PCM PROG CCM PROG CCM and CCM PROG modes area combination of CCM on one port CCM PROG and PCOP program part settings on the other port Note If User Configuration Data UCDF has been loaded to the PCM from PCOP the UCDF configuration is used after a power cycle or soft reset The Logicmaster 90 configuration is ignored The PCOP CLEAR command or MDE Module Delete command can be used to delete the UCDF from the PCM 2 10 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K CCM ONLY Mode When CCM ONLY mode is selected the PCM is used only for CCM operation on one or both ports When this mode is selected in Logicmaster 90 software the following PCM detail screen is displayed 2
265. esented earlier in this section Chapter 5 Advanced MegaBasic Programming 5 103 GFK 0255K Example VMERD Function In the following example 256 bytes of data are read from a PCM in rack 4 slot 7 into registers R00001 through 6R00128 when enabling input 76100001 goes true Unless an error occurs while reading the data output 76000001 is set to true 100001 000001 C CONST ADR 0 1 0824000 In Series 90 70 PCMs VME dual port memory occupies 32K bytes starting at address 0A0000h 0000h regardless of the rack and slot where the PCM is installed In this example the VME bus address 0BA7000h corresponds to the PCM internal address 0A000h 7000h There are several ways a MegaBasic program could move data to this address in VME dual port RAM One of the simplest ways is to use the FILL statement FILL 0A000h 7000h data list where data list isa list of data items expressed as MegaBasic variables constants or expressions For more information refer to the MegaBasic Programming Language Reference Manual GFK 0256 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 104 VME Write Function The VMEWRT function can be used to write data from the Series 90 70 CPU to the VME dual port RAM of the PCM Locate the function block at a place in the program where the output data is ready to send The format of the VMEWRT function block i
266. factory mode on a Workmastercomputer Lists directories installed by TERMF INSTALL program TERM settings for factory mode on a Workmastercomputer Terminal emulator with file transfer protocol Installation utility for setting TERM parameters Adirectory MegaBasic example reading M bits Documents features of BYTESWAP BIN and PORT_CTL BIN Source file with documentation for BITFUNCS BIN MegaBasic utilities package for bit string operations MegaBasic utilities for checksum and reversing byte order in words Documentation of MegaBasic PGM packages Line number referenced documentation of GENERIC PGMand GEN TEST PGM Definitions and procedures to access user references not directly supported by the PCM sbackplanedriver Sample program using GENERIC PGM Sample graph program MegaBasic CRC checksum package PCM serial port control and status utilities In firmware versions 2 51 and later PORT_CTL BIN is provided in firmware This file is needed only with version 2 50 or earlier MegaBasic functions and procedures to analyze and print PLC and I O fault records MegaBasic functions and procedures to access PLC and I O fault tables Sample MegaBasic program How to use READ FLT PGM and PRN FLT PGM to read and display fault information Documentation for using UTILITY PGM Procedures for gathering system information from the Series 90 CPU PCM MegaBasic extentions for VT100 style escape sequences This file prints to STDOUT
267. file on the PCM RAM Disk files are always saved through power up When the program starts up it should open the RAM file check to see if it contains data from the previous run and take the appropriate action For details on creating and using MegaBasic files refer to the MegaBasic Programming Language Reference Manual GFK 0256 4 6 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Compatibility with MS DOS MegaBasic MegaBasic is also available in an MS DOS version which may be ordered from GE Fanuc as catalog number IC690SHP403 for 3 5 inch diskettes or IC690SHP404 for 5 25 inch diskettes This version consists of the MegaBasic Programming Language Reference Manual GFK 0256 and diskettes containing the software The PCM extensions to MegaBasic are not included in the MS DOS version You can develop MegaBasic programs which run in either the PCM or an MS DOS computer if you avoid the PCM extensions good technique is to isolate all the PCM extensions within a single MegaBasic package A different version of the package using the same package name but none of the PCM extensions can be substituted when the program is run in a MS DOS computer Programs and data files for the PCM version of MegaBasic are compatible with the MS DOS version The one difference is the method used to specify files that are not on the current PC disk drive In the MS DOS version you can specify a disk d
268. fined it can be redefined with a new procedure name and or priority but first its old definition must be erased with this statement INTERRUPT lt interrupt name gt END Like the ON and STOP arguments if the interrupt name is omitted the END argument applies to all interrupt definitions Although MegaBasic permits this it should never be executed on a program that runs on a PCM Timer Interrupts A MegaBasic program running on the PCM has 16 available timers in addition to the timers that are automatically associated with many of the data movement routines These 16 timers are associated with interrupts so that a timeout on any of the timers will cause an interrupt to be posted The 16 timers are manipulated from a MegaBasic program with the statements Timer timer number TSTART timer count REP Timer timer number TSTOP Parameter Description TimerNumber A number from 1 to 16 corresponding to timer 1 through timer 16 TSTARTorTSTOP TSTART starts the timer counting from zero TSTOP stops the timer Timer Count The maximum count in milliseconds This is a number from 1 to 86 400 000 the number of milliseconds in a day REP This qualifier specifies that the timer TSTART operation is to repeat Thus aninterrupt from the specified timer is generated repetitively If the timer count argumentis a relative number e g REP is included the interrupt occurs at the specified interval For example the statem
269. for additional PCM commands GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 51 Section 7 Serial Port Setup with IOCTL and PORT CTL BIN This section contains information on using the MegaBasic IOCTL statement to change the existing serial port configuration There is also information on using the procedures and functions in PORT CTL BIN to send and receive serial BREAKs and to use the serial port modem control and status signals Serial Port Setup with IOCTL The MegaBasic IOCTL statement can be used to change the Logicmaster 90 or PCOP configuration of the two PCM serial ports during program execution IOCTL can change the port settings for data rate parity number of data bits per character number of stop bits flow control type and physical protocol Note The IOCTL statement is not available in PCM firmware version 2 04 or earlier The format of the IOCTL statement is IOCTL channel number ioctl string Before the port can be configured a channel for the port must be opened The channel number argument is the channel number which was specified when the port was opened The ioctl string argument sets the port characteristics for both transmit and receive The string must be in double quotes The format of an IOCTL string is BAUD PARITY DATABITS STOPBITS FLOWCTL PHYSICAL DUPLEXMODE TURNOFFDELAY TABUFSIZE BAUD 300 600 1200 Specifies the number of bits per second Note that 38 400 baud 2400 4800 9600
270. formation about Control software topics refer to the Online Help for Control Programming software Content of this Manual This manual contains the following chapters and appendixes Chapter 1 Introduction describes the features of the PCM System operation module specifications hardware features and the use of various software tools are introduced in this chapter Chapter 2 Installing the PCM explains how to install and configure the PCM in a Series 90 70 or 90 30 PLC system and how to install the necessary software Chapter 3 CCM Operation describes CCM operation and features and explains how to the use the PCM for CCM applications Chapter 4 MegaBasic Operation describes MegaBasic operation and features and explains how to the use the PCM for MegaBasic applications Chapter 5 Advanced MegaBasic Programming describes the extensions to MegaBasic as developed by GE Fanuc These extensions allow MegaBasic to take full advantage of the special capabilities of the PCM and the Series 90 PLC system Chapter 6 Troubleshooting Guide contains a self guided demonstration of the steps involved in troubleshooting the PCM and application programs Appendix A PCM Cabling Information provides cabling specifications and wiring diagrams for the Series 90 PCM Appendix B Resetting the PCM from a PLC Program explains how COMMREQ function blocks may be used to reset the PCM Appendix C PCM Commands describes commands for loadin
271. g storing and executing applications iti GFK 0255K Preface Appendix D PCM Batch Files describes how to create and use batch files Appendix E Example MegaBasic Programs provides a Megabasic test program Appendix E TERMF File Descriptions lists the files placed on the PCM programmer s hard disk during the INSTALL procedure iv Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Preface Related PCM Publications For more information on PCM refer to these publications Series 90 PCM Development Software PCOP User s Manual GFK 0487 MegaBasic Programming Language Reference Manual GFK 0256 Programmable Coprocessor Module PCM Quick Reference Guide GFK 0260 PCM Development Software PCOP Quick Reference Guide GFK 0657 PCM Support Software TERME Quick Reference Guide GFK 0655 Important Product Information for PCM Development Software PCOP GFK 0352 Important Product Information for PCM Support Software TERMF GFK 0654 Important Product Information for Series 90 70 PCM GFK 0351 Important Product Information for Series 90 30 PCM GFK 0494 Related Series 90 Publications For more information on Series 90 programmable controllers refer to these publications Series 90 70 Programmable Controller Installation Manual GFK 0262 Logicmaster 90 70 Programming Software User s Manual GFK 0263 Series 90 70 Programmable Controller Ref
272. g sets respectively Key bindings are used to redefine keys for various operational modes A single keystroke may send up to 80 characters via these key bindings Note Custom key bindings have limited value when using TERMF or PCOP with the PCM This description is provided only for completeness When using MegaBasic special key handling only ordinary keys i e those that produce a non null character code can be used for keybindings For example CTRL A can be used to produce the character code 1 If MegaBasic special key handling is selected from main menu item 3 many of these custom binding in these sets will be replaced with MegaBasic defaults To view or modify the normal key bindings type Y select the appropriate function and answer the prompts Lookata table entry Replace a table entry Delete a table entry Add a table entry Show the scan code for the key oF CO l2 When the key bindings are correct type N Menu item 8 selects a screen which displays the current values for the display color palette settings These settings are only available for EGA VCA adapters The EGA color palette has 16 entries The colors are defined in RGB notation i e three digits with values 0 to 3 each to indicate the intensity of Red first digit Green second digit and Blue third digit The range for each color is 000 to 333 giving a palette of 64 possible colors If you wish to change any of these settings
273. g the same baud rate parity number of data bits number of stop bits and the same type of handshaking HARDWARE SOFTWARE or NONE Verify that the cable connections described in appendix A PCM Cabling Information are correct and that the cable is firmly secured at both ends The middle light on the PCM should blink If it does not remove the connector from the PCM jumper pins 4 and 5 on the PCM with a paper clip and press the Reset Restart pushbutton again for 10 seconds If the LED still does not blink at least once there is a problem with the PCM Otherwise the cable programmer configuration or programmer hardware is the problem Reconnect the cable to the PCM If the programmer has more than one serial port be sure the cable is connected to COMI Set the programmer serial port to the PCM default settings To do this when using a computer as the programmer type TERMF DEFAULT DAT or PCOP DEFAULT DAT as appropriate at the MS DOS prompt and press the Enter key Press and hold the Restart Reset pushbutton for 10 seconds to initialize the PCM to its factory default settings Press the programmer Enter key while watching the USER1 LED for serial port 1 or USER2 LED for serial port 2 Each time the key is pressed the LED should blink If the PCM has been configured by Logicmaster 90 in BASIC or BAS CCM mode the Ready prompt should also be repeated on the programmer screen otherwise the gt prompt should appear If the
274. ght angle connector on one end that connects to the PCM On the other end it has a dual connector with one connector for port 1 and the other for port 2 The PCM has three LED indicators that enable you to determine the state of the PCM without having a terminal connected The OK LED top LED indicates the current status of the PCM The function of the USER1 and USER2 LED indicators middle and bottom LEDs respectively can be configured by Logicmaster 90 software the user program or PCOP By default these LEDs are used to indicate transmit and receive activity on serial ports 1 and 2 respectively Several versions of the Series 90 30 PCM are available The best one for a particular application may be selected on the basis of memory and serial port requirements The following table lists the PCM versions by catalog number along with the total RAM memory available on each module Table 1 2 Series 90 30 PCM Features Module Total RAM Port 1 Port 2 IC693PCM300 160K RS 232 RS 485 IC693PCM301 192K RS 232 RS 232 RS 485 IC693PCM311 640K RS 232 RS 232 RS 485 Table 1 3 Series 90 30 PCM Accessories Catalog No Description IC693ACC301A Replacementbattery package of 2 IC693CBL305 Series 90 30 PCM WYE cable IC690CBL701 PCM to IBM XT compatible 9 pin serial connector IC690CBL702 PCM to IBM AT compatible 9 pin serial connector IC690CBL705 PCM toIBMPS 2 compatible 25 pin serial connector Series 90 Prog
275. gramming the PCM in MegaBasic 4 2 Programming the PLC COMMREQ function block Programming advanced MegaBasic 51 PROM EOT Pushbutton restart reset 1 3 Q Q set protection level command R R Run command D 2 R run command 4 11 C 14 PBMEMS 5 16 R TMEMS 5 16 Rack screen 2 6 shared RAM RAM disk 1 2 RAM dual port 5 109 RDEL FAULIT TBL 5 21 RDEL FAULT TBLj5 24 known problems with fault table access 533 Read only memory 3 4 READ FAULT TBL fault table header records CLEAR TSS GFK 0255K PLC FLT TBL 522 PLC_FLT_TS 5 28 PLC_FT J5 22 5 28 PLC RUN STATUS s 38 PLC RUN STATUS VALID 5 38 PLC STATUS WORD 5 36 PLC STATUS WORD VALID 5338 PLC TIME 5 38 PLC TIME AND DATE VALID 5 38 PLCFA RACKS 522 5 32 PLCFA SLOTS 5 32 PLCFA UNITS 5 32 Plug and go operation 2 18 point to point mode C 7 Poit to Point Mode 5 53 PORT_CTL BIN 5 50 5 55 F 1 functions and procedures ALL SENT STATUS 5 56 FLUSH PORT IN LENGTH 5 56 requires an ACCESS statement 5 55 Power up delay 3 15 PRINT statement 4 14 PRINT MSG 5 87 Printing a MegaBasic text file 4 9 PRN FLEPGM 5 21 522 r 1 PROCESS MESSAGE 5 17 5 18 PROCESS MESSACGE statement 5 64 5 72 5 7645 82 arguments 5 64 PROCESS READ statement 5 94 5 97 PROCESS WRITE statement 5 94 5 97 PROCESS XFERj5 61 ES PROG PRT configuration mode 2 10 2 15 PROG CCM configuration m
276. h Page Logicmaster 90 Software for a guide to configuring the PCM Chapter 4 contains the following sections Section Title Description 1 Programming the PCM in Section 1 describes the steps required to MegaBasic programa PCM MegaBasic application 2 Interfacing to the PCM Section 2 covers PCM serial port and PLC Hardware and Series90CPU dataaccess from MegaBasic 3 MegaBasic Programming Section 3 contains exampleMegaBasic Examples programs Chapter 4 GFK 0255K Section 1 Programming the PCM in MegaBasic MegaBasic is a powerful BASIC language interpreter which is built into the PCM MegaBasic programs can be created using 6 Any VI100 compatible terminal TERME the PCM support software running in a Workmaster industrial computer or IBM PC XT PC AT or PS 2 personal computer Many IBM compatible personal computers can also run TERME e PCOP the PCM development software running in one of the personal computers described above MegaBasic programs can be saved in PCM user RAM they can also be loaded and saved to a Workmaster computer or compatible PC by using TERMF or PCOP MegaBasic on the PCM provides backplane access to Series 90 PLC CPUs and other features to support process control and real time programming These MegaBasic extensions developed by GE Fanuc are also built into the PCM and are automatically accessed by all MegaBasic programs PCM MegaBasic programs can be develope
277. has firmware version 2 04 or lower and was configured for BASIC or BAS CCM mode using Logicmaster 90 software Change the configured mode to PROG PRT or PROG CCM GEK 0255K Chapter 6 TroubleshootingGuide 6 3 L5 Backplane Transfer Failure When MegaBasic aborts with a Backplane Transfer Failure error it is indicating that the PLC is not communicating with the PCM If communication with the PLC has never been established i e this is shortly after starting the program and no data has been successfully moved to or from the PLC check the PLC configuration for the PCM slot If the PLC is configured for another module in this slot or no module at all the PCM cannot communicate with the PLC Reconfigure the PLC or move the PCM to the correct slot If this is a Series 90 70 system check that there are no empty slots to the left of the PCM i e between the PLC and the PCM or between the BRM and the PCM Blank slots prevent the PCM from communicating with the PLC and must be eliminated After eliminating the blank slots it is necessary to cycle power on the PLC even if the PCM is in a remote rack Note This condition does not occur with the Series 90 30 system where empty slots are permitted If communication had been occurring with the PLC data had been transferred and the application was running contact the GE Fanuc Hotline for assistance For version 1 04 or earlier of a Series 90 30 PLC Model 331 you may need to upgrade y
278. he AM code for the PCM is 39H It specifies the Standard Non privileged access type VME bus addresses for PCM modules used as VME function block targets depend on the rack and slot location of the PCM The PCM must be addressed in the range allocated to the rack and slot where itis located Address allocations for PCMs are provided in the following table GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 101 Table 5 13 PCM Address Allocation by Slot and Rack for Standard Non Privileged Access 39H Rack Slot Number Number 000000H 020000H 040000H 060000H 080000H 0A0000H 0C0000H OE0000H to to to to to to to to O07FFFH 027FFFH 047FFFH 067FFFH 087FFFH OAZFFFH OC7FFFH OE7FFFH 100000Hthrough 7FFFFFH User Defined for Rack 0 Only E00000H E20000H E40000H E60000H E80000H EA0000H EE0000H to to to to to to to to E07FFFH E27FFFH E47FFFH E67FFFH E87FFFH EA7FFFH EC7FFFH EE7FFFH D00000H D20000H D40000H D60000H D80000H DAO0000H DC0000H to to to to to to to to D07FFFH D27FFFH D47FFFH D67FFFH D87FFFH DA7FFFH DC7FFFH DE7FFFH C00000H C20000H C40000H C60000H C80000H CA0000H CC0000H CE0000H 3 to to to to to to to to CO7FFFH C27FFFH C47FFFH C67FFFH C87FFFH CAZFFFH CC7FFFH CE7FFFH B00000H B20000H B40000H B60000H B80000H BAO000H BC0000H 01 to to to to to to to to BO7FFFH B27FFFH B47FFFH B67FFFH B87FFFH BA7FFFH BC7FFFH BE7FFFH A00000H A20000H A40000H A60000H A80000H AA0000H
279. he MegaBasic variable using the SYSREAD and SYSWRITE statements The SYSTATUS function is used to monitor data transfers between the PCM and PLC Each of these is described in detail on the following pages The maximum number of PLC data areas that can be associated with MegaBasic variables at one time is 32 PLC data areas can be as small as a single point In Series 90 70 PCMs the size of each PLC data area is limited to 2048 bytes In principle Series 90 30 PLC data areas can be as large as 65 535 bytes although there were no data areas that large when this manual went to press MegaBasic arrays or structures can be linked to move multiple data references from or to the PLC CPU in one SYSREAD SYSWRITE operation as shown in the following example This example assumes that PLC registers 250 through 329 contain 16 character ASCII formatted real numbers The numbers are read from the PLC CPU converted from ASCII to binary format and written back to the PLC starting at register 1000 Rem This program reads a large string of ascii numbers and Rem converts them to individual real elements of an array Dim STR1 160 Dim real REAL_ARR 9 SYSLINK STR1 R250 SYSLINK REAL_ARR R1000 SYSREAD STR1 1 0 While I gt 0 REAL 81 51219 1 16 1 16 1 Print REAL ARR I I 1 Next SYSWRITE REAL ARR Print STR1 More than 32 individual PLC data areas can be associated with MegaBasic var
280. he output after writing it Rem Print CLR CMD LINES Input OUTPUT TO WRITE WRITE OUTPUT Print CLR CMD LINES Input VALUE OUTPUT DATA SYSLIN PUT DATAS Q str WRITE OUTPUT 5I5 SYSWRITE OUTPUT DATA UNLINK OUTPUT DATA Print 45 CLR CMD LINES Print 5 CMD LINES Case 3 EXT_MENU MAIN_MENU UNLINK OUTPUT_ARRAY Return Case end Rem Ignore all other characters Next Rem Go back to main menu Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 3460 3470 3480 3490 3500 3510 3520 3530 3540 3550 3560 3570 3580 3590 3600 3610 3620 3630 3640 3650 3660 3670 3680 3690 3700 3710 3720 3730 3740 3750 3760 3770 3780 3790 3800 3810 3820 3830 3840 3850 3860 3870 3880 3890 3900 3910 3920 3930 3940 3950 3960 3970 3980 3990 4000 4010 4020 4030 4040 4050 4 34 Advanced MegaBasic Programming MegaBasic is a powerful implementation of the BASIC language which runs under twelve different operating systems and a host of different hardware configurations One of the strengths of MegaBasic is that the language can be extended to support the underlying hardware This chapter describes the additions called extensions that GE Fanuc has made to MegaBasic These additions or extensions allow MegaBasic to take full advantage of the special capabilities of the PCM and the Series 90 system Page 5 3
281. he table is emptied by doing repeated read and delete operations RDEL FAULT TBL The fault entry changed bits are not cleared after reading the fault table s except for the programmer attachment READ FAULT TBI The PLC CPU returns the second fault in the table when doing a read and delete sequence instead of the first fault in the table RDEL FAULT TBI Series90 30PLC The PLC CPU does notreturn any response at all to a read and delete sequence if the requested fault table is empty Series 90 30 PLC Series 90 30 PLC GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 33 Gathering PLC Information from MegaBasic Programs The UTILITY PGM package supplies several procedures as well as several data buffers and flag variables for gathering system information from the Series 90 CPU To use the procedures data buffers and flag variables supplied in this UTILITY PGM package add the line xxx Access utility pgni to the beginning of the MegaBasic program or in the PROLOGUE section of a user written package The file UTILITY PGM should have been loaded to the PCM RAM Disk before running the MegaBasic program which accesses it The file will be located in the PCOP or PCOP EXAMPLES PCM directory of your hard disk depending on which version of PCOP or TERMF you use During the PROLOGUE processing that takes place as part of the first access to the UTILITY PGM package the following interrupts
282. hich is the same as the Logicmaster 90 folder name used to create the program and block name must first be put into the shared string variable SMSG TXT If L data is to be accessed its sub block name must be added to SMSG TXT starting at character position 9 5 18 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K The request and access codes for PLC memory types are Table 5 4 Request and Access Codes for PLC Memory Types User Reference Request Code Access Code Use L ACC_CODE 1 Read L Series90 70 ACC CODES 1 Write L oP Read iP Series90 70 Write P I R SMEM Read l W_SMEM 3 Write I 0 Read iQ W SMEM Write Q R R_SMEM 3 Read R Write aR T R_SMEM 3 Read T Write WT TM Read YoM W_SMEM 3 Write M TAT Read Wal W_SMEM 3 Write AI TAQ Read AQ W SMEM Write AQ SA R_SMEM 3 Read SA SB R_SMEM 3 Read SB SC R_SMEM 3 Read SC S R_SMEM 3 ACC_CODE 13 5 1 R TMEM Read task memory W TMEM Write task memory R_PBMEM Read program block memory W_PBMEM Write program block memory 3 R SMEM Read system memory W SMEM Writesystem memory GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 19 In the following example the SMSG WTEXT procedure is used to read L20 GEN MSG is the PLC program name folder name and LMEM is the program subblock name associated with the particular L memory that is to be read
283. iable PLC RUN STATUS VALID is used to indicate when the PLC runstatus variable has been updated Optional parameters for this procedure are the same as those previously described for READ PLC STATUS READ PLC CPU ID A procedure that gets the PLC ID string from the PLC CPU long status information LSTAT The length of the string is adjusted to permit proper printing of the PLC CPU ID ie itis converted from zero terminated ASCII format to MegaBasic string format The string variable PLC_CPU_ID contains the ID string after it is read and the integer variable PLC_CPU_ID_VALID indicates when the ID has been read The only optional parameter for this procedure is to select NOWAIT mode if desired Chapter 5 Advanced MegaBasic Programming GFK 0255K Table 5 7 UTILITY PGM Package Procedures cont d Description A procedure that performs a short status read and if the PLC CPU responds properly the integer variable RESPONDING isset to true If the PLC CPU does not respond properly after three 3 tries the CPU RESPONDING integer variable is set to false Every time the CPU responds the local time and date is recorded in string variables TIME OF LAST CPU RESP and DATE OF LAST CPU RESP The validity of the time and date strings is indi cated b y the integer variable TIME AND DATE OF LAST CPU RESP VALID The only optional parameter for this procedure specifies how often to check the PLC CPU s health specifi
284. iables if necessary by using the UNLINK statement to disassociate PLC data areas not needed immediately A MegaBasic program can read and write any of the PLC data areas shown below using the SYSLINK SYSREAD and SYSWRITE statements The names for the areas are shown as they appear inthe SYSLINK statement SIXXXXX Input contacts SQXXXXX Output coils SMXXXXX Internal coils STXXXXX Temporary coils SXXXXX System status SRXXXXX CPU registers GXXXXX Genius global data SAIXXXXX Analog inputs SAQXXXXX Analog outputs GFK 0255K Chapter 4 MegaBasic 4 15 Note For information on how to access Series 90 70 P and L references from PCM MegaBasic programs refer to chapter 5 Advanced MegaBasic Programming In addition the PCM can read fault information for 901 Q AI and AQ references override information for I Q and M references and in Series 90 70 PLCs transition information for 901 Q M and T references To access this information a comma followed by an E O or T for fault override or transition respectively is added to the end of the reference name For example the fault bit for input 39 is accessed as 76139 F The transition bit for temporary coil 15 is accessed as 76115 T Fault override and transition bits can be accessed as single bits or groups of bits They can only be read by the PCM Any attempt to write to these areas results in an error PLC data references may be accessed as
285. ic interpreter A power cycle also causes the PCM to go to RUN mode If the Restart Reset pushbutton is pressed continuously for 10 seconds the PCM performs a reset operation and enters PROGRAM DEVELOPMENT mode CCM operation and MegaBasic programs are stopped This reset is referred to asa hardreset Program and configuration development are performed in this mode PCM Support Utilities for Personal Computers TERME IC641SWP063 is a terminal emulation software package for personal computers It is used to program MegaBasic programs on the PCM and transfer program files between the PCM and the personal computer Setup of TERMF terminal configuration data is performed through a companion program called TERMSET For more information on TERME refer to chapter 2 section 4 TERME Installation and Configuration PCOP IC641SWP061 is a development system for the PCM used for applications requiring configuration beyond that supplied by Logicmaster 90 software PCOP provides functions for configuration programming and running MegaBasic loading and saving files and other status and control functions PCOP also supports folder and file maintenance TERMF and PCOP may be run directly from the MS DOS prompt or they may be accessed through the Logicmaster 90 main menu by selecting PCM development package F3 TERME PCOP and Logicmaster 90 configuration software may be run on a Workmaster II Workmaster or Cimstar I industrial computer with
286. icantly especially if the powerful MegaBasic features are used A good rule of thumb for estimating the size of a typical MegaBasic application intended for an operator interface terminal is 50K bytes plus 4K bytes per screen When MegaBasic executes a user program it must first load the program into an internal workspace During execution the program is continually optimized to provide the best possible performance In order to restart the application following a reset the original copy of the program must be stored on the PCM RAM Disk This reduces the effective amount of memory available for storing programs on the PCM since the PCM must hold both a working copy and an original copy of the program When MegaBasic starts up it takes part of the PCM memory for program workspaces and leaves the rest of memory for the PCM RAM Disk When you LOAD a program into MegaBasic it is copied from the RAM Disk or from your PC into a program workspace When you SAVE a program it is copied from program workspace to the RAM Disk or your PC Chapter 4 MegaBasic 4 9 GFK 0255K The division of PCM memory between RAM Disk and MegaBasic workspace is performed automatically when the PCM is configured by Logicmaster 90 software for BASIC or BAS CCM mode PCOP configuration also allocates PCM memory between RAM Disk and MegaBasic workspace In addition PCOP allows you to modify the workspace allocation Refer to the Series 90 PCM Development Software PCOP
287. icate a logical truecondition A constant 0 used to indicate a logical false condition Aninteger variable that contains the PLC status word as last read from the PLC CPU This word is a set of binary flags and bit fields thatindicate various information about the PLC CPU s state When numbered so that the LSB is bit 0 the following information is available 0 Oversweep flag valid only if constant sweep mode is enabled 1 Constant sweep value was exceeded on last sweep 0 Constant sweep value was not exceeded GFK 0255K FALSE PLC STATUS WORD Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 36 5 37 Table 5 8 UTILITY PGM Package Shared Constants and Variables cont d PLC_STATUS_WORD 1 Constantsweep mode setting cont d 1 Constant sweep mode is enabled 0 Constantsweep mode is disabled 2 PLC faultentry changed flag 1 PLC fault table has changed since last time the table wasread 0 Table has not changed This value is returned by the FLT_CHANGED PLC FLT TBL function 3 I Ofaultentry changed flag 1 I O fault table has changed since last time the table was read 0 Table has not changed This value is returned by the FLT CHANGEDS function 4 PLC fault table entry present flag 1 Thereisa fault record in the PLC fault table 0 There isno fault record in the PLC fault table This va
288. icators m PEPPER HOP EE Mad pU RIED 1 4 OK brine hei CES 1 5 User Defined LEDs USER1 and USER2 na 1 6 Battery ccce oves utet Meet eae Manta teat eae eite 1 6 Serial Connectofs cedar reet ARR RA AI don 1 7 Section 4 Hardware Overview for the Series 90 70 PCM 1 9 Section 5 Hardware Overview for the Series 90 30 PCM 1 11 Section 6 Configuring the PCM eee eee 1 13 Configuring the PCM for CCM Operation nnan 1 13 Configuring the PCM for MegaBasic Operation 1 14 Section 7 Who Should Use PCOP ss 1 15 Chapter 2 Installme the PCM es dies ae ewe eee date eas 2 1 What You Will Need 00 0 eee eee eee 2 2 Section 1 Installing the PCM Hardware 065 2 3 OVERVIEW ope utet eris ced bel tas onere i porco deaf 2 3 Installing a Series 90 70 2 4 Installing a Series 90 30 PCM 00002220 e 2 4 Adding Expansion Memory to the Series 90 70 01 1 2 5 Section 2 Configuring the PCM with Logicmaster 90 Software 2 6 I OConfiguration Rack Screen eee 2 6 Adding a PCM to the Rack Screen 2 6 eee 2 8 PCM Configuration Data 0 0 06 2 9 PCM Configuration Modes 0 0 0 6 eens 2 10 Configuration Modes and the PCOP Display 2 17 Series 90 30 PCM Autoconfig sssssssssss 6666060000 2 18 GFK 0255K Series 90 Programmable Coprocesso
289. ice is explicitly specified On any file access the device name may be added in front of the file name For example RAM BASIC PGM fully specifies a file called BASIC PGM on the PCM RAM Disk PC BASIC PGM is a file located in the current directory of the current PC disk drive To load an existing MegaBasic program file to the PCM MegaBasic workspace from the default device type LOAD filename where filename is the name of the program file Add a device name to explicitly specify the PCM RAM device or the current PC disk drive For PC files you can also specify the MS DOS file directory path LOAD lt device gt lt path gt lt filename gt where lt device gt is the storage device path is directory path to the program when applicable and filename is the program name You can also specify a PC disk drive by using two device names For example Path Description LOAD MYPROG PGM Currentdirectory of default device LOAD RAM MYPROG PGM PCMRAM Disk LOAD PC MYPROG PGM Currentdirectory of current PC disk drive LOAD PC MMYPROG PGM Rootdirectory of current PC disk drive LOAD PC C MYPROG PGM Currentdirectory of PC drive C LOAD PC MMBMMYPROJMMYPROG PGM Directory MB MYPROJ of current PC disk drive LOAD PC C MB MYPROJ MYPROG PGM Directory MB MYPROJ of PC drive C Note that there are no paths on the PCM RAM device 4 4 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 199
290. ield lowcapacitance 4 pairs 24 AWGstranded overall shield lowcapacitance Belden Catalog No 9505 9306 9832 9731 8105 9844 GFK 0255K At shorter distances under 50 feet 15 meters almost any twisted pair or shielded twisted pair cable will work as long as the wire pairs are connected correctly Do not use the shield as a signal ground conductor When using RS 422 RS 485 the twisted pairs should be matched so that both transmit signals make up one twisted pair and both receive signals make up the other twisted pair If this is ignored cross talk resulting from the mismatching could affect the performance of the communications system When routing communication cables outdoors transient suppression devices can be used to reduce the possibility of damage due to lightning or static discharge Care should be exercised to ensure that both the PCM and the device to which it is connected are grounded to a common point Failure to do so could result in damage to the equipment Serial Connectors The Series 90 70 PCM has two serial connectors each one supports both RS 232 and RS 485 operation The serial ports are identical and either port can be used for most applications The two ports are configurable for different communication parameters Note The connector pin assignments for the Series 90 70 PCM are shown below LG a42734 SHIELD RESERVED RS 232
291. ies 90 PCM PCM Cabling Information Appendix Cable and Connector Specifications Cable connector to PCM Ports 1 or 2 Male Subminiature D Type Cannon DB25P solder pin with DB110963 3 Hood AMP shell 207345 1 and connector 205208 1 with crimp pin 66506 1 or solder pin 66570 3 or equivalent standard RS 232C connector Connectors for ports 1 and 2 are located on the Series 90 70 PCM board Both ports are brought out a single connector on the Series 90 30 PCM board A Wye cable is provided with each Series 90 30 PCM board Length maximum 50 feet 15 meters for RS 232C 50 feet 15 meters for RS 422 RS 485 without isolation at the remote end 4000 feet 1200 meters for 5 422 RS 485 with isolation at the remote end Overall shield 24 AWG minimum Connector to external device specified by external device manufacturer The following cables provide acceptable operation at data rates up to 19 2K BPS and distances up to 4000 feet for RS 422 RS 485 Application RS 232 RS 422 or RS 485 at 19 200 BPS or below RS 232 RS 422 or RS 485 at 19 200 BPS or below RS 422 up to 38 400 BPS RS 422 up to 38 400 BPS RS 422 up to 38 400 BPS RS 485 up to 38 400 BPS Construction 5 pairs 24 AWGstranded overall shield 6 pairs 22 AWG solid overall shield 5 pairs 24 AWGstranded overall shield 6 pairs 24 AWG stranded pairs individuallyshielded lowcapacitance 5 pairs 24 AWGstranded overall sh
292. ing a Series 90 30 PCM 2 4 installing a Series 90 70 PCM installing other modules 2 3 installing the PCM hardwaree 2 3 LED indicators 1 4 memory on the Series 90 30 PCM 1 11 memory on the Series 90 70 PCM OK LED1 5 option connector 1 10 overview of the Series 90 30 PCM overview of the Series 90 70 PCM PCM module description 1 4 RS 232 cables A 7 RS 422 RS 485cables A 10 GFK 0255K IO FLT CAT 5229 IO FLT DESC 5229 IO FLT GRP 529 IO FLT SPEC 5 29 IO FLT TBL IO FLT TS 5 29 IO FLT TYPES 5 29 10_FT 5 22 5 29 IO_REF_ADD J5 29 IOCTL 5 52 parameters 5 53 IOCTLS function 4 8 IOFA BUS 5 33 IOFA BUS ADDS 5 33 IOFA_PT_OFFSET 5 33 IOFA RACK 5 22 5 33 IOFA SLOTS 5 33 IORA ADD 5 32 IORA_SEG 5 22 5 32 J J format EEROM device command C 9 K K Kill a task command C 9 Kill a task K command C 9 L L Load command LED indicators 1 4 on Series 90 30 PCM on Series 90 70 PCM LIST command 4 9 Load L command LOAD command Loading MegaBasic programs 4 4 Loading PCM data files using TERME 5 56 Local configuration file GFK 0255K configuring the Series 90 30 PCM with the hand held programmer 2 19 connecting the PCM to the programmer 2 32 diagnosing serial communication problems 2 33 installing a Series 90 30 PCM 2 4 installing a Series 90 70 4 installing other modules 2 3 installing the PCM hardware 3 l
293. ing the Enter key displays a gt prompt from the interpreter when it is active Pressing the Enter key repeatedly adds another prompt on the same line each time you press the Enter key Depending on the Logicmaster 90 configuration for the PCM the MegaBasic interpreter may start at power up or a reset MegaBasic prints a startup banner message by default to port 1 whenever it starts When you see the startup message and a Ready prompt you can type BYE and press the Enter key to exit from MegaBasic to the command interpreter If you see the startup message but no Ready prompt MegaBasic is running a program You can usually stop the program by typing CTRL C Press and hold down the CTRL key while typing C If you cannot access the command interpreter after trying the procedures described above use the Logicmaster 90 configuration software to check the PCM configuration If a configuration has been stored to the PLC load it to the Logicmaster software and then check the PCM configuration mode to be sure it is either BASIC BAS CCM or PCM CFG If the PCM mode is not one of these change it and store the new configuration to the PLC If there is no PLC configuration create one with the PCM configured to PCM CFG mode and then store it to the PLC GFK 0255K C 1 As a last resort try turning off power disconnecting the battery cable from the connector on the circuit board and shorting the two pins on the circuit board connector Thi
294. inter types it recognizes to the corresponding string Unrecognized types result in a NULL string which is ignored If the type was recognized the offset value is converted to a string and added to the pointer type string in line 1070 The complete COMMREQ status address is printed at line 1080 This completes the processing done by USER BKP MSG PROC When the BKP MSG logical interrupt ends the main program loop resumes At line 310 it detects that a COMMREO was received and it resets CMRQ RCVDS at line 320 Lines 370 420 print the data size and the data The data is presented as bytes in hexadecimal format which often makes it easier to interpret 16 bit values separated into bytes If you prefer decimal integer format you can remove the format specifier string 3H3 plus its trailing comma from the print statement in line 400 In lines 480 510 NEXT CMROS is SYSLINKed to the status register address in STAT PTR Thena SYSWRITE statement is used to signal the PLC CPU and NEXT CMRQS is UNLINKed When the loop repeats the test at line 310 fails until the next COMMREO arrives The technique for regulating COMMREQs shown in this example could be used with a ladder program containing several COMMREO function blocks Each WAIT mode COMMREQ block must have its own status separate status register This program responds to the appropriate status register for each COMMREO message The developer of the MegaBasic program does not need to know in
295. ion or networking loaded on the PC by the CONFIG SYS or AUTOEXEC BAT Serial port and high memory usage packages are especially a problem 2 In PCOP Release 2 02 a known bug existed on some PCs that would cause PCOP to jump to the TERMF page immediately If this happens you can work around it by disconnecting the PC to PCM cable at one end proceeding into PCOP beyond the Folder Select screen and then attaching the cable An upgrade to PCOP is recommended 3 Ifthe PCM is running a MegaBasic or CCM application PCOP may detect characters on the serial port and switch to TERME Initiate a hard reset and then press ALT Z to return to PCOP 4 Ifthe screen is either completely blank or the menus are incorrectly displayed use the TERMSET utility function to verify that the proper monitor is selected in TERM DAT The default display adapter and monitor is set for a Workmaster or Workmaster II industrial computer CGA driving a monochrome monitor The default may also be obtained by using DEFAULT DAT 5 Make sure that there is no other equipment other than a PCM attached to the serial port being used by PCOP COMI by default If a foreign device is detected PCOP jumps to TERME Pressing ALT Z usually flickers the screen and returns to TERME Disconnect the other device and connect the cable to a PCM or work offline GEK 0255K Chapter 6 TroubleshootingGuide 6 9 This appendix provides cabling specifications and wiring diagrams for the Ser
296. isatrademark of Digital Equipment Corporation 2 32 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Diagnosing Serial Communication Problems Before proceeding verify that the OK LED on the PCM is on If the LED is off refer to the information in section 1 of this chapter This procedure is used to determine if there is a hardware problem with the programmer serial ports 1 Verify that both the PCM and the programmer are using the same baud rate parity number of data bits number of stop bits and the same type of handshaking HARDWARE SOFTWARE or NONE Note If you configured the PCM using Logicmaster 90 software review section 2 of this chapter If you used the Series 90 30 Hand Held Programmer review section 3 of this chapter When verifying the programmer serial port configuration review section 5 of this chapter 2 Verify that the cable connections described in appendix A PCM Cabling Information are correct and that the cable is firmly secured at both ends 3 Press the PCM Restart Reset pushbutton for 10 seconds The middle light on the PCM should blink If it does not remove the connector from the PCM jumper pins 4 and 5 on the PCM with a paper clip and press the Reset Restart pushbutton again for 10 seconds If the LED still does not blink at least once there is a problem with the PCM Otherwise the cable programmer configuration or programmer hardware
297. itioning control string to the 0 The format of the CUR statement is xxx CUR row col Description Argument Row Aninteger number specifying the desired row Column Aninteger number specifying the desired column where the cursor is tolocated Internally the CUR statement calls the CUR function with the parameters that were passed to the CUR statement and then prints the resulting string As with CUR both parameters are optional and default to the home position values row 1 column 1 In the following example the screen is cleared the cursor is positioned to the center of the screen and then a hello message is printed Access vt100 pgm CLS CUR 12 35 Print Hello Y all In the next example the operation that was performed in the second example for the CUR function is repeated using the CUR statement Access vt100 pgm For 1 2 to 20 by 3 CUR I Print 2i 1 Next CUR Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K CUR 5 10 ATTR The ATTR function formats a Set Graphic Rendition SGR control string for later display on a VT100 terminal or other compatible display device The optional list of parameters specifies the desired attributes for the following text to be displayed on the VT100 device The list of attributes that may be specified includes the constants ATTRIB OFF BLINK BOLD UNDERSC
298. itted the PCM assumes that the PLC reference is in the same formatas the local MegaBasic variable 32 bit integer 64 bit real number or string For numeric data this is usually not true since the CPU and MegaBasic have different numeric data types However there may be some circumstances e g one or more PCMs moving data through the CPU where numeric data does not have to be converted Handle This argument contains an arbitrary user specified integer used when backplane interrupts are enabled For more information on backplane interrupts refer to chapter 5 Advanced MegaBasicProgramming A MegaBasic program may be interrupted when backplane transfers occur rather than waiting for each transfer The handle is used to identify the variable that was transferred If the handle argument is used the type argument must also be present because arguments can be omitted only from right to left GFK 0255K Chapter 4 MegaBasic 4 17 Example In the following example SYSLINK is used to associate a MegaBasic variable called PUSHBUTTON with input 761100 The variable TEMPERATURE is associated with register R25 Def integer PUSHBUTTON Def integer TEMPERATURE SYSLINK PUSHBUTTON 51100 BOOL SYSLINK TEMPERATURE R25 UINT When the MegaBasic program doesa SYSREAD from the PUSHBUTTON variable the PCM reads 761100 converts it to an integer which is either 0 or 1 and copies it to the PUSHBUTTON variab
299. k The OK LED top LED on the faceplate of the PCM begins to flash during power up diagnostics if a PLC CPU has been installed in the rack When the PCM successfully completes diagnostics it continues to flash while waiting for configuration data from the CPU Once the PCM is ready this LED should be continuously on Adding Expansion Memory to the Series 90 70 PCM To increase the total available memory an expansion memory daughter board may be added to a Series 90 70 PCM The daughter board mounts on a single connector on the PCM Expansion memory cannot be added to a Series 90 30 PCM Four versions of the expansion memory board are available Table 2 1 Expansion Memory Boards Catalog Number Memory Size IC697MEM713 64K Bytes IC697MEM715 128K Bytes IC697MEM717 256K Bytes IC697MEM719 512K Bytes To mount the daughter board follow these steps 1 Touch an exposed metal surface of the PLC rack in order to discharge any electrostatic charge you may have 2 Power down the Series 90 70 PLC system and remove the PCM 3 Remove the memory expansion module from its anti static bag 4 Carefully align the pins on the bottom side of the daughter board with the connector on the PCM 5 Align the holes on the opposite end of the PCM with the daughter board standoffs 6 Push the daughter board into the connector 7 Make sure the daughter board is fully seated and the standoffs are snapped into both boards If an expansio
300. le When the MegaBasic program does a SYSREAD from TEMPERATURE the PCM reads R25 and converts it to an integer between 0 and 65 535 If R25 is specified as INT16 rather than UINT the PCM converts it to a number between 32 768 and 32 767 When the MegaBasic program does a SYSWRITE to PUSHBUTTON it sets 791100 if PUSHBUTTON is non zero If PUSHBUTTON is equal to zero 71100 is cleared A SYSWRITE to TEMPERATURE copies the least significant 16 bits of the TEMPERATURE variable to R25 Example Another useful application of MegaBasic s automatic type conversion is to convert PLC integers to MegaBasic real numbers The MegaBasic real numbers can then be operated on with real number arithmetic and copied back to the PLC as integers For example 110 Def real CURRENT 120 SYSLINK CURRENT R45 UINT A SYSREAD from CURRENT converts R45 to a real and copies it to the CURRENT variable It can now be used in real number expressions with no loss of accuracy A SYSWRITE to CURRENT copies the integer part back to R45 Using the SYSLINK Statement It is best to put all the SYSLINK statements at the beginning of a MegaBasic program immediately after the variable declarations or in the prologue section of a package This makes the program easier to read and provides a way to document the different data transfers done with the PLC The only exception to this rule occurs when a single MegabBasic variable is alternately SYSLINKed and UNL
301. led when the command is executed and remain on continuously Default selection GFK 0255K Appendix C PCM Commands C 7 InitializationString COMI duplex mode Continued COM2 Continued WwW In full duplex mode The receiver for the specified port is always enabled When lt physical_interface gt 422 or 485 the RS 485 line drivers for RTS and transmitted data outputs on the specified port are turned on immediately before transmitting and remain on until lt delay_value gt expires after the last character is sent At all other times these drivers are in theirhigh impedancestate tri stated In half duplex mode The receiver for the specified port is disabled immediately before transmitting and remains off until delay value expires after the last character is sent When lt physical_interface gt 422 or 485 the RS 485 line drivers for RTS and transmitted data outputs on the specified port are turned on immediately before transmitting and remain on until lt delay_value gt expires after the last character is sent At all other times these drivers are in theirhigh impedancestate tri stated delay value the time in milliseconds between the end of the last outgoing character and the time RTS is turned off if applicable RS 485 line drivers are tri stated if applica ble the receiver is enabled in half duplex mode if applicable and WAIT mode output statements complete execution D
302. linkage between the MegaBasic interrupt structures and the PCM hardware is done automatically during the MegaBasic initialization Note Do not execute an INTERRUPT interrupt number assignment as you would with other versions of MegaBasic The discussion of foreground and background processing under MS DOS does not apply to MegaBasic on the PCM At any point in a MegaBasic program an interrupt can be defined with the following statement INTERRUPT lt interrupt name gt lt procedure name gt priority This statement associates one of the PCM interrupts specified by an interrupt name with a user procedure which may be either a MegaBasic or an assembly language procedure The priority argument if included can be used to override the default priority of the PCM interrupt However do not assign priorities above 23 to the user program Priorities above 23 are required internally to interface MegaBasic to the operating system and the PCM will act erratically if these are used Chapter 5 Advanced MegaBasic Programming 5 57 Section 8 GFK 0255K The following PCM interrupts and their associated default priorities are available Table 5 9 PCM Interrupts and Associated Defaults Interrupt Name Default Priority BKP_MSG 23 BKP_XFER 22 TIMER16 21 TIMER15 20 TIMER14 19 TIMER13 18 TIMER12 17 TIMER11 16 TIMER10 15 TIMER9 14 TIMER8 13 TIMER7 12 TIMER6 11 TIMERS 10 TIMER4 9 TIMER3 8 TIMER2 7 TIMER1 6 NOW
303. load command display mode and protection mode The display mode determines whether or not the file will be included in a module directory listing The two modes are normal N and hidden H Normal mode is the default The protection mode is used to determine whether the PCM file willbe volatile V semi volatile S or protected P Forcertain file types for example EXE files the protection level is fixed at P by default a protection option in the load command is ignored Data files are volatile by default but this may be overridden by the load command If options are used in the load command they follow the command directly with no intervening spaces For example LH is used to load a hidden module and LHP is used to load a protected hidden module Possible errors are File not found Illegal module type Insufficient memory The PC file name may begin with a device name If there is no device name the default device PC is assumed A PC disk drive and file path specification may be included in pc filename However if a PC disk drive is specified the PC device must also be explicitly specified for example L PC A MYFILE DAT LPC C MMYDIRMMYFILE EXE Load Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K L C 10 M create a memory Module Format M module name size The create memory module command creates a PCM data module using the specified
304. location then send a 060828910 COMMREQ slot 2 If there is an error 70003 will latch ck ko to TASK ID 3 in the PCM at rack 0 gt gt RUNG 9 STEP 0011 lt lt T0002 MOVE INT l l CONST IN Q R0200 R0050 00000 LEN 00001 CONST 0002 CONST 00000003 END OF PROGRAM LOGIC Program MB CRQ3 C NLM90MMB CRQ3 Block MAIN Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 5 74 5 75 MegaBasic Blink LED Program Example amp M amp M amp M S S S Sk Sk Sk S S S S S kk Sk S S kk S Sk S SS S S Sk This example program controls the PCM user LED 1 based on a command value received in a COMMREQ message The LED must be configured for use by the MegaBasic task ck ck ck ck kckck KKK KKK ck ck ck k ck ck k CMRQ_HDRS 32 CMRO TXT 32 rrupt BKP MSG end rrupt MSG USER BK
305. lost This may occur when either the user reference type specified in the command block or the offset address within that reference type is invalid If CCM receives COMMREOS from the PLC faster than they can be processed a MAILBOX QUEUE FULL fault may eventually be logged in the PLC fault table MOD Other S W error COMMREQ MB FULL START It is good programming practice to have no more than one COMMREOQ outstanding at a time on each CCM port The example CCM application in section 6 of this chapter shows how the CCM status register can be used to send one COMMREQ at a time MAILBOX QUEUE FULL faults can also occur if CCM has been stopped by a hard reset or if the PCM has stopped functioning Power Up Delay The first COMMREQ sent to CCM after a power cycle or ACFAIL must be delayed until the PCM has finished power up initialization A good rule of thumb is to wait 5 seconds before trying to send a CCM COMMREQ The absolute minimum time is 1 second Refer to the example in section 6 of this chapter Command Block The command block provides additional information needed by the COMMREQ function The address of the command block is specified for the IN input to the COMMREQ function This address may be in any word oriented user reference R AI or AQ in both the Series 90 70 and Series 90 30 COMMREO P or L in the Series 90 70 COMMREO only The length of the command block depends on the specific CCM command being sent The command
306. lot and ID are extracted from the source field of the message as described above and printed After identifying the source of the message USER BKP MSG PROC prints it along with its data string if any by calling the PRINT MSG procedure which is described below Procedure SEND UNSOLICITED MSG beginning at line 1060 sends the message which was passed as string argument MSG to the rack slot and ID destination specified in the 3 1 and ID arguments The bitwise AND amp and left shift lt lt operators are used in line 1130 to construct the destination field for the message The two byte destination value is put into the message one byte at a time in lines 1140 1150 Then the message is sent by calling SEND MESSAGE Ifthe TXT argument is empty only MSG is passed to SEND MESSAGE otherwise both MSG and TXT are passed The PRINT MSG procedure prints either a backplane message or a message data string passed in the string argument It prints the hexadecimal values of the message bytes and for printable ASCII codes the character as well There is quite a bit of extra complexity but it makes the text data in the main program s messages easy to see Lines 1370 1380 complain when an empty string is passed and skip the rest Line 1400 initializes the line length and the position in MSG of the first character on the first printed line The While loop starting at line 1410 does all the work Line 1420 handles the short prin
307. lue is returned by the FLT_PRESENT PLC_FLT_TBL function 5 I Ofaulttableentry present flag 1 Thereisa faultrecord inthe I O fault table 0 Thereisnofaultrecord inthe I O fault table This value is returned by the FLT PRESENTS function 6 Programmerattachment present flag 1 Thereisa programmer attachment for the indicated control programnumber 0 Noprogrammer is attached to that control program 7 Enable Disableswitchsetting 1 Outputsare disabled 0 Outputs are enabled 8 RUN STOPswitchsetting from the front panel 1 RUN 0 STOP 9 Symbolstatustable changed flag 1 Symbolstatus table has changed requiring a new resolve of any symbols currently resolved by the MegaBasicprogram Note This function is not presently used by the system 10and11 Sparereserved 12thru15 Current PLC CPU state as opposed to switch settings or commanded state Possible values are 0 PLC runenabled 1 PLC rundisabled 2 PLC stopped 3 PLCstopped faulted 4 PLC halted 5 PLC suspended 6 PLC stopped I O enabled Chapter 5 Advanced MegaBasic Programming GFK 0255K GFK 0255K Table 5 8 UTILITY PGM Package Shared Constants and Variables cont d Description Aninteger variable that is incremented by 1 every time the PLC status word is read The value of the variable increments up to 255 and then rolls over to 1 A zero value false indicates that the PLC status word has never been re
308. mory types dot supported 3 2 request and access codes for PLC memory types 5 19 Series Five vs Series 90 CCM memory types 33 Series One vs Series 90 CCM memory types 3 3 Missing argument error code 100 Modes of operation 1 3 Modifying existing BASIC programs for l4 4 Module description battery 1 6 catalog numbers for Series 90 30 PCM 1 12 12 D type connector 1 12 hardware overview of the Series 90 30 PCM 1 11 hardware overview of the Series 90 70 PCM LED indicators 1 4 OK LED 1 5 option connector 1 serial connectors serial ports on the Series 90 30 PCM f2 12 serial ports on the Series 90 70 PCM fo Index 11 VT100 PGM functions and procedures VT100 PGM integer and string constants VT100_5 PGM serial port control and tais eed short status records SMSG WTEXT 5 16 est standard or specified devices 4 13 statements ACCESS ATTR SET TED STOP 4 status record string variables CMRA DATAS CMRQ HDRS 5 725 76 CMRQ_RCVD CMRQ_TXT 5 72 5 76 TEST FLTPGM 5 21 5 22 time stamp subrecords 15 32 timer interrupts 5 59 timers and logical interrupts 5 57 using a text editor to create MegaBasic programs 4 9 UTILITY PGM file 5 34 variables SSTAT 4 16 VME functions 5 100 GFK 0255K OK LED not on 6 1 OPEN statement 4 9 Operation modes 1 3 Option connector 1 10 Output from the PCM serial p
309. mple batch file that starts MegaBasic Using a text editor on your computer create a file called TEST BAT which contains the single line R BASIC EXE After saving the file invoke TERMF on your PC and then enter the PCM command interpreter interactive mode as described in appendix C PCM Commands Load the batch file to the PCM by typing L TEST BAT and pressing the Enter key GFK 0255K Do not attempt to load batch files to the PCM using the MegaBasic LOAD command The MegaBasic LOAD command converts files to MegabBasic program format which is not understood by the PCM command interpreter Using the MegaBasic LOAD command for batch files will prevent them from executing as expected To run the batch file type TEST and press the Enter key You should see the command in TEST BAT followed by the MegaBasic start up banner indicating that the command interpreter executed the command to run MegaBasic If you type BYE again you should once again be communicating with the command interpreter in interactive mode Verify this by pressing the Enter key and note that the prompt appears on a new line PCMEXEC BAT Files When the PCM powers up or a soft reset occurs the operating system looks for a file named PCMEXEC BAT inthe RAM Disk If itis not found and the PCM has been configured by Logicmaster 90 software in BASIC or BAS CCM mode a new one is created This file contains a single R Run command which instructs the command int
310. munication Interrupt Description BKP XFER The BKP XFER interrupt number 22 is executed whenever NOWAITmode SYSREAD or SYSWRITE data transfers between the PLC and PCM are completed BKP_MSG The BKP MSG interrupt number 23 is used when a message is received from elsewhere in the Series 90 system This may be the result of a COMMREO block sent by the PLC CPU ladder program or a message from another PCM The BKP XFER interrupt occurs whenever the PCM and CPU complete a NOWAIT data exchange either through SYSREAD or SYSWRITE If no user procedure has been supplied for this interrupt all backplane transfers proceed transparently The only indication that data is being moved is the changing values of variables and the SYSTATUSS function If NOWAIT backplane transfers are to be handled by a user interrupt procedure the default interrupt definition must be erased and a new definition activated by the user program as shown below 10 Interrupt BKP XFER end 20 Interrupt BKP XFER USER BKP XFER PROC 30 Interrupt BKP XFER on where USER BKP XFER PROC is the name of the user procedure to handle the backplane interrupt processing The interrupt must be redefined before any NOWAIT backplane transfers occur Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 60 The BKP MSG interrupt occurs when data is received from transfers other than SYSREAD and SYSWRITE
311. n OP data mask MSK address modifier module address Parameter Description Enable Power flow input that when true enables the execution of the function Type Function type either byte or word to select the corresponding type of VME bus access to be performed Operation A constant which specifies whether an AND or OR function is to be used to combine the data and the mask 0 specifies AND 1 specifies OR Mask A word value containing a mask to be ANDed or ORed with the data read from the bus If the type is byte only the low 8 bits of the mask are used AddressModifier Hexadecimal value coded to specify the rack in which the module resides and the access mode of the VME bus access to be performed Address A double word specifying the hexadecimal address of the word or byte to be accessed It may be a constant or the reference address of the first low word of two words containing the module address The address is based on the rack and slot where the module is located Refer to AddressAllocation by Rack and Slot in this section OK Power flow output that is true when the function is enabled and completes successfully When the VMERMW function receives power flow through its enable input the function reads a word or byte of data from the module at the specified address ADR and address modifier AM This byte or word of data is combined AND OR with the data mask MSK Selection of AND or OR is
312. n Device No Flow Control or Hardware Flow Control A 9 Figure A 14 PCM to PCM without Hardware Flow Control RS 422 RS 485 00 0 0 A 11 Figure A 15 CCM2 to PCM RS 422 RS 485 2 eee le A 11 Figure A 16 PCM to OIT without Hardware Flow Control 185 422 35 485 A 12 Figure A 17 PCM to Series One Series 111766 12 145 422 1 5 485 A 12 Figure A 18 2 Wire RS 422 RS 485 PCM Hookup 2 6 ne A 13 Figure A 19 CCM2 or Host Computer to Multiple PCMs Multidrop 0000s cece eee A 14 Figure A 20 PCM or Host Computer to Multiple PCMs 4 Wire 1 0202 A 15 Figure B 1 Soft Reset iie eet dened Cote dels ET eie n des le aces ies B2 Figure B 2 Hard Reset oo mese ratto npe D y e pa ER Ra ve Canta se gare Rd ie deg B 3 xiv Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Contents js 1 10 2 1 2 m 1 12 m 2 5 3 2 0 zs 2 17 5 28 m 3 2 7 3 2 2 3 3 is 3 3 E 3 4 x 3 7 ri 3 8 0 3 20 0 3 21 ra 3 22 is 3 23 E 4 10 5 3 e 5 6 aig 5 7 5 19 0 5 21 E 5 22 es 5 35 m 5 36 E 5 58 E 5 65 s 5 65 7 5 83 5 102 xo Series 90 70 PCM Expansion Memory and Accessories 2222222222 Series 90 30 PCM Features s nica see eR Emm EXHI RATER RE UE RR a e E Y Series 90 30 PCM Accessories 6666 666666662666620 eee eee es Expansion Memory Boards 62662 6 666666 666666666606666 eee
313. n memory board is installed on a PCM that has already been configured for no expansion memory or for a different expansion memory size the Logicmaster 90 configuration must be updated and stored to the PLC CPU GFK 0255K Chapter 2 Installing the PCM 2 5 Section 2 Configuring the PCM with Logicmaster 90 Software The second step in the PCM installation procedure is to add a PCM to the Series 90 I O configuration using Logicmaster 90 configuration software The configuration software is used to describe the modules present in the PLC racks Rack and slot location and other features for individual modules are specified by completing setup screens that represent the modules in a rack Editing features make it easy to copy move replace or delete module configurations After completing the Logicmaster 90 configuration you must store it to the PLC where your PCM is installed The configuration has no effect until it is stored to the PLC The Logicmaster 90 status line must display CONFIGEQUAL after the configuration is stored to the PLC Note For a Series 90 30 PCM using standard CCM default operation this step is not required Refer to the information on autoconfig at the end of this section for information on the default CCM operation I O Configuration Rack Screen From the main menu of the Logicmaster 90 configuration software press I O F1 A screen representing the modules in a rack is displayed This example represents
314. n part of the package the CPU RESPONDING flag is checked Every time through the main loop that the CPU is not responding 32 bel characters are printed GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 47 READ PLC FAULT BIT The READ PLC FAULT BIT procedure gets one bit of the PLC fault summary status from the SRP This fault summary bit is obtained either in a wait for data mode default or a NOWAIT mode In NOWAIT mode the user must check the PLC FAULT BIT VALID flag to determine when the data has actually arrived in the PLC FAULT BIT integer variable In NOWAIT mode the user is also permitted to specify a repeat delay time so that the selected fault summary bit is read and updated on a continuing basis When the delay time is specified as something other than 0 0 as fast as possible the TIMERS interrupt is used to supply the delay between repeats of the read request The format of the READ PLC FAULT BIT procedure call is xxx READ PLC FAULT BIT rack slot bus module wait flag delay where all parameters are optional and if omitted a single read of the rack 0 fault summary bit takes place in wait mode The wait flag is normally programmed with the NOWAIT constant from the PCMEXT PGM package that is automatically accessed by the MegaBasic program The delay parameter is only used if NOWAIT mode is active and is the minimum number of milliseconds that the UTILITY PGM package will wait before rereading the PLC run status
315. nchr 5 1 0 0 e begin on KEY Case 1 Rem To display new inputs first UNLINK with Rem the old inputs and SYSLINK with the new ones Rem The SYSREAD at the top of the loop will then Rem read the inputs from the new location Rem Print 5 CLR CMD LINES Input 5 NEW INPUT TO DISPLAY BASE INPUT UNLINK INPUT ARRAY SYSLINK INPUT ARRAY I str BASE_INPUT 515 BYTE Print 5 CLR CMD LINES Print 5 CMD LINES Case 2 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 SYS The sta NK IN Rem Rem Rem Rem SYSL BASE Thi at SYS For ex Rem Rem Rem Rem Rem Rem Rem Rem EY Cas Rem Rem Repe 4 32 Rem To write an input SYSLINK with the input Rem which is to be written and do a SYSWRITE to write Rem the data Since the input to be written always Rem changes UNLINK the input after writing it Rem Print CLR CMD LINES Input INPUT TO WRITE WRITE INPUT Print CLR CMD LINES Input VALUE INPUT_DATA SYSLINK INPUT DATA I str WRITE INPUT 5I5 BOOL SYSWRITE INPUT_DATA UNLINK INPUT DATA Print 5 CLR CMD LINES Print 45 CMD LINES Case 3 Rem Go back to main menu NEXT_MENU MAIN_MENU UNLINK INPUT_ARRAY Return Case end Rem Ignore all other characters ext 5 5 5 5 Rem This is the output display subroutine It displays a block Rem of sixty four outp
316. ncluded with the PCM programming software VT100 5 PGM contains routines for writing to a VT100 compatible screen Since VT100 5 PGM must be available to the main program following a reset it is loaded from the EXAMPLES PCM directory into the PCM RAM Disk Ready load pc vt100 5 pgm Into a new workspace n 150 lines 3930 code bytes Ready save ram RAM VT100 5 PGM file not found create it y 150 lines 3930 code bytes y The DIR command shows that the RAM Disk contains three files BASIC PGM VT100 5 PGM and HARDEXEC BAT HARDEXEC BAT is the startup program used by the PCM after a hard reset Ready dir VT100 5 pgm BASIC pgm HARDEXEC bat Ready Chapter 4 MegaBasic 4 27 GFK 0255K GFK 0255K If a soft reset is initiated the PCM comes up executing the example program By following the displayed instructions this program can be used to monitor and change references in the PLC s R 901 and Q tables Rem EXAMPLE MEGABASIC PROGRAM FOR PCM Rem Rem This program implements a simple operator interface which can Rem be easily modified for a particular application This program Rem provides examples of the most commonly used MegaBasic commands Rem and extensions It can be run using either port of the PCM and Rem assumes that a VT100 OIT or PC running Termf is connected Rem Rem First access the MegaBasic subroutine package which handles Rem screen formating It must have been previously loaded into
317. nd D4 hexadecimal as well as the two bits that differ among 82 82 C2 and C3 Line 820 announces that a generic response arrived while line 980 announces each Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK COMMREQ COMMREO data is processed as in the previous example Rem This example shows how to distinguish between PLC responses Rem to generic request messages and COMMREQ messages 5 Rem The program uses the MegaBasic bitwise AND operator 8 to Rem hide specific bits in an integer value This feature is Rem available in PCM firmware version 2 50 and later Note that Rem variables used as 8 operands MUST be defined as integers Rem ck ck ck ko Sk k ko ko gt Access ram generic pgm Dim 80 HDRS 32 Dim RCV TXT 256 Dim CMRQ DATAS 256 Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Throw away messages already in the backplane queue 5 Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Repeat PROCESS MESSAGE RCV_HDR RCV_TXTS If RCV_HDRS then Exit ext Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Rem Assign USER_BKP_MSG_PROC to the BKP_MSG interrupt d Rem KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
318. not valid an application fault COMMREQ BAD TASKID is logged in the PLC fault table This can occur if the task on the COMMREQ is misprogrammed if the PCM has been hard reset so that MegaBasic is not running or if the PCM is not configured correctly for MegaBasic GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 69 GFK 0255K The OK and FT function faulted output parameters can provide power flow to optional logic which can verify successful completion of the COMMREOQ Note that the Series 90 30 COMMREO has no OK output OK and FT may have these states ENable Error OK output FT output active false ctive true notactive no execution false false The COMMREO always passes power flow to the OK output in NOWAIT mode In WAIT mode the function passes power flow to the OK output unless the timeout period is exceeded or a zero timeout period has been specified The FT output may be set true if 6 The specified target address is not present 6 The specified task is not valid for the device 6 The data length is 0 The status pointer address part of the command block does not exist This may be due to an incorrect user reference type selection or an address that is out of range within that reference type If there are errors in the portion of the command block used specifically by the PCM these errors are reflected in the value returned in the status location not in the FT output OK and FT
319. nt Soft Reset Hard Reset Logicmaster 90 Mode Mode Configuration Configuration Displayed Configuration Displayed Mode UCDF Used by PCOP Used by PCOP NONE Factory Default FACTORY Factory Default FACTORY PCM CFG Factory Default FACTORY Factory Default FACTORY CCM ONLY LM90 CCM Config LMCFG Factory Default FACTORY PROG PRT None Factory Default LM CFG Factory Default FAC MOD LM90 PROG Port Def LM90 PROG Port Def PROG CCM None LM90 CCM Config LM CFG Factory Default FAC MOD LM90 PROG Port Def NONE PCM User Config USER Factory Default FACTORY PCM CFG PCM User Config USER Factory Default FACTORY CCM ONLY SS PCM User Config USER Factory Default FACTORY PROG PRT PCM User Config USER Factory Default FAC MOD LM90 PROG Port Def PROG CCM Yes PCM User Config USER Factory Default FAC MOD CCM PROG LM90 PROG Port Def Note that BASIC and BAS CCM modes have been omitted from the table When MegaBasic is started by the Logicmaster 90 configuration PCOP will display either LM CFG when it can communicate with the PCM or NOCOMM when it cannot GFK 0255K Chapter 2 Installing the PCM 2 17 Series 90 30 PCM Autoconfig The Series 90 30 PLC Model 331 or higher CPU provides automatic default configuration called Autoconfig for many of the system modules The configuration provided for the Series 90 30 PCM is similar to configuring the PCM in Logicmaster 90 30 software for CCM ONLY mode Thus if Logicmaster 90 30 software has not
320. nt of free PCM memory as two decimal numbers Total available memory is xxxxxx bytes Largest available block is yyyyyy bytes The first is the total of all available memory The second is the size of the largest free memory block Both sizes are expressed in bytes No errors are returned Note The largest available block size is often used to determine the amount of memory to allocate to MegaBasic The MegaBasic data space must be smaller than the largest available block size Appendix C PCM Commands C 5 C D F GFK 0255K This command returns the ID number of the PCM hardware configuration The value is GFK 0255K Get hardware ID G Format an ASCII string containing two hexadecimal digits which specify the ID One of the following codes is returned Description Series90 70 PCM with no daughter board Series 90 70 PCM with a 512K daughter board 640K bytes total Series 90 70 PCM with a 256K daughter board 384K bytes total Series 90 70 PCM with a 128K daughter board 256K bytes total Series 90 70 PCM with a 64K daughter board 192K bytes total Series 90 30 PCM model IC693PCM300 160K bytes Series 90 30 PCM model IC693PCM301 192K bytes Series 90 30 PCM model IC693PCM311 640K bytes Graphics Display Coprocessor Module with a video daughter board Series90 70 AlphanumericDisplay Coprocessor Module Series90 30 Alphanumeric Display Coprocessor Module get PCM firmware revision number
321. nt status 4 22 D file Directory command 5 51 C 5 D type connector 1 12 Data block 3 17 3 19 Data block length 3 16 Data coherency 4 24 string record 4 24 vector 4 24 Data length 3 8 71 Data size E aBasic program and 4 9 ACCESS 4 11 changing the MegaBasic workspace size GFK 0255K Communications request COMMREQ Compacting programs 4 12 with MS DOS MegaBasic 4 7 Config mode 2 9 CONFIG SYS 6 9 F 1 Configuration data 2 9 Configuration file local 2 31 Configuration modes 2 10 BAS CCM 2 102 13 BAS CCMmode 4 3 BASIC 2 12 BASIC mode 4 3 Configuration modes and the PCOP display 2 17 Configuration problems e s configure LEDs B command C 4 Configuring the PCM 1 13 adding a memory expansion board to the Series 90 70 PCMJ2 9 adding a PCM to the rack screen 2 8 B cec for the Series 90 30 PCM 1 13 autoconfig of the Series 90 30 PCM 2 18 config mode 2 9 configuring the Series 90 30 PCM with the hand held programmer 2 19 default configuration for the Series 90 30 PCM 1 1342 18 for CCM operation for MegaBasic operation I O configuration rack screen local configuration file 2 31 PCM configuration data 2 9 PCM configuration modes 2 10 PCM configuration modes and the PCOP display 2 17 Series 90 30 PCM plug and go operation 1 13 2 18 TERME installation and configuration 2 24 Index Index 4 Index ERA
322. nt with the empty SEND TXT Table 5 11 shows the range of valid message type values when the message has extra data in SEND TXT the range which is valid when there is no extra data and the values which are used by the PLC CPU In lines 490 520 another message is sent to the same destination This message includes 20 characters of text data in SEND TXT so AO hexadecimal 160 decimal was chosen as the message type After sending the two messages the program waits for messages in the endless loop at lines 560 570 The USER BKP MSG PROC interrupt procedure in this example starting at line 580 uses the technique of the previous example to identify each message by testing the type field If the test at line 750 passes the message came from the PLC Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 86 Lines 830 and 840 check for messages being returned because they are undeliverable If you try to send a message to a physically invalid rack slot combination it will be returned by the PCM operating system with non zero error codes in the first two bytes Messages addressed to a valid rack slot which is empty or to a non existent ID in a rack slot where there is a PCM are returned over the backplane These messages contain 20 hexadecimal 32 decimal in byte 6 Finally messages which are not returned messages or messages from the CPU are processed in lines 900 950 The rack s
323. nter Offset within the selected memory type Note The status pointer offset is a zero based value R00001 for example is at offset zero in the register table R00300 is at offset 299 Idle Timeout The idle timeout value is the maximum time the PLC CPU waits for Value CCM to acknowledge receipt of the COMMREQ This value is ignored in NOWAIT mode If WAIT mode is selected address 4 specifies the idle timeout period in 100 microsecond increments Maximum The value at address 5 specifies the maximum time the PLC CPU Communica waits for CCM to complete the COMMREQ This time is also specified tion Time in 100 microsecond increments and is ignored in NOWAIT mode Data Block The CCM data block contains the CCM command number in address 6 plus any command data words required for each specific command For more information on CCM COMMREO data blocks see section 4 in this chapter GFK 0255K Chapter 3 CCM Operation 3 17 CCM Status Word The CCM status word is written to one of five PLC memory types at the location defined by the status pointer memory type at address 2 and the status pointer offset at address 3 in the command block The content of this word is defined as Low byte Completion code or major error code lindicatessuccess Highbyte Secondary error code Clear the status word before issuing the COMMREO to CCM Different memory locations should be used for status words associa
324. nual November 1999 GFK 0255K 5 54 Serial Port Control Using PORT CTL BIN The file PORT CTL BIN is distributed with TERMF and PCOP and is built into PCM firmware version 2 51 or later It provides functions and procedures for sending and detecting serial breaks for controlling the output state of serial port modem control signals and for detecting the state of modem status signals If your PCM has firmware version 2 50 or earlier you mustload PORT CTL BIN to the PCM RAM disk before you can use any of its MegaBasic statements or functions If you have version 2 50 you may use TERME as described in chapter 5 section 6 Loading and Storing PCM Data Files Using TERME For earlier versions you must use PCOP Your MegaBasic program must use the ACCESS statement to make PORT CTL BIN available to your program For firmware versions 2 50 and earlier program xxx Access RAM PORT_CTL BIN For firmware versions 2 51 and later program xxx Access PORT_CTL BIN PORT CTL BIN provides two procedures for sending a serial break BREAK ON and BREAK OFF Their format is BREAK ON port number BREAK OFF port number Ihe port number argument specifies the serial port 1 or 2 where the break is to be sent BREAK ON sets the Transmit Data line of the specified port to its logic 0 space state while BREAK OFF sets it to the logic 1 mark state A MegaBasic timer may be used to control the time duration of the break F
325. o A During a space state logic 0 B is negative with respect to A When connecting the PCM to a non Series 90 device using the 155 422 RS 485 standard the non Series 90 device s line receiver must contain fail safe capability This means that in an idle open or shorted line condition the output of the line receiver chip must assume the mark logic 1 state When using RS 422 RS 485 the twisted pairs should both be matched so that both transmit signals make up one twisted pair and both receive signals make up another twisted pair The PCM is supplied with a 120 Ohm terminating resistor in each RS 422 RS 485 receiver circuit If the module is at either end of an RS 422 RS 485 multidrop or point to point link these resistors should be in the circuit If the module is an intermediate drop on the multidrop link the appropriate resistors should be disconnected from the circuit by removing their jumpers A 10 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K a44235 PIN PIN OOo 00000 a lt Pap sow 9 gt P 13 RD A cane es o9 SD B 21 25 RD B E519 0 0 0 4 RD A 8 9 SD A o c RDB 5 XX 21 sD B a PPM o9 RTL 12 E 12 PORT 0 x RT 24 lt N al RT x 0 0 PORT 2 o e Rsa to LL 10 RTS A 04 2 o9 RTS B 22 22 R
326. o other intelligent modules configured for CCM on one port Minimum System Series 90 70 CPU Model Window Time CPU31 732 5ms CPU71 772 3ms CT80 781 782 788 789 2ms CTI9D 914 924 915 925 1ms CPX2 782 928 935 1ms CGR772 935 1ms The window time limit must be increased when the PCM is configured for CCM on both ports and when the PLC contains two or more PCMs or other intelligent modules The requirement for fast predictable PLC sweep times conflicts with the requirement for efficient CCM communication Different applications will assign different weights to these conflicting requirements Some applications will emphasize control of sweep time some will emphasize efficient CCM communication while others will need a good balance of the two This complex mix of application requirements plus the large number of possible combinations of PCMs and other intelligent modules makes it virtually impossible to provide a useful rule of thumb for the system window time Developers of time critical CCM applications will need to tune the system window time for their specific needs GFK 0255K Chapter 3 CCM Operation 3 29 Series 90 30 System Communications Window In Series 90 30 CPU versions earlier than 4 4 the system window time is fixed Starting with version 4 4 however the default mode of system window operation is RUN TO COMPLETION which is actually limited to 50 milliseconds PLC programs may use the SVCREO function
327. oblem If you still cannot determine the cause of the problem after debug you may need to send a copy of your program to the GE Fanuc Hotline 6 6 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K s CCM Data Tx Rx Failure 1 Verify that the Logicmaster 90 or PCOP configuration for the PCM port specifies CCM with the correct serial settings and CCM characteristics If not correct the specifications or change the device 2 Confirm that the PCM is in RUN mode that is it was powered up or placed in RUN mode by a soft reset If the PCM was hard reset most recently CCM will not function an ACK gt is returned To begin CCM communications initiate a soft reset of the PCM 3 If this is an RS 485 network ensure that there are no RS 422 devices on the network check converter boxes amplifiers repeaters etc If there are RS 422 devices on the network you must derate the link to an RS 422 network Are all RS 485 lines properly terminated Is the final node terminated Are the cables properly made Do they contain enough lines for full duplex operation See appendix A PCM Cabling Information Are signal ground voltage differences reasonable Are signal pairs twisted together in the cable 4 Fora Series 90 70 PLC system check that there are no empty slots to the left of the PCM e g between the PLC CPU and the PCM or the BRM and the PCM Blank slots prevent the PCM
328. ocal configuration file 2 31 TE pue and configuration 2 24 using TERMSET to configure TERMF or PCOPJ226 what you will need 2 2 Insufficient memory error 60606 3 Insufficient memory error 6 4 Integer constants ATTRIB OFF C UD REVERSE 5 7 UNDERSCORE 5 7 Interactive modeC 2 Interfacing to the PCM hardware and Series 90 CPU 4 13 INTERRUPT function 5 60 Interrupts backplane interrupts 5 60 BKP_MSG 5 34 INTERRUPT statement 5 57 timer interrupts TIMER1 5 39 Invalid IOCTL string error code 122 5 4 IO FAULT HDRS 522 IO FAULT HDR NUM READS 523 IO FLT ACT 529 IO FLT ADD 529 Index Index 8 Index LOAD 4 4 RUN STAT COMMREQ command block 5 71 idle timeout value 5 71 length 5 71 maximum communication time 5 71 status pointer 5 71 wait no wait flag 5 71 compacting programs com Er with MS DOS MegaBasic 4 7 controlling COMMREQs 5 76 data coherency 4 24 data types string record 4 24 vector determining the size of a MegaBasic program encrypting prog rams 4 12 error codes 5 3 argument of wrong type 102 argument out of range 101 backplane timeout 118 backplane transfer failure 112 5 4 bad LED definition 110 5 3 bad timer definition 108 Basic extensions incompatible 116 5 4 buffer space exceeded 120 CPU name string too long 115 5 4 Device unavailable 123 5 4 duplicate remote variable 111
329. ode Program and data size MegaBasic 4 9 ACCESS 4 11 changing the MegaBasic workspace size Index Index 14 Index Restart reset pushbutton 1 3 RESTORECURS 57 REVERSE 5 7 RS 232 cables A 7 RS 422 RS 485cables A 10 RTS OFE 5 56 RTS ON 5 56 Run R command C 44 D2 RUN command 4 8 Run mode errors 6 6 Run to completion mode 3 28 S S Save command 5 51 C 15 SAMPLE PGM 426 F 1 Save S command 5 51 C 15 SAVE command 4 4 4 9 4 26 SAVECURS 5 7 Saving data through a power cycle or reset Saving MegaBasic programs 4 4 Scratch pad 5 4 Screen formatting commands 5 5 VT100 PGM 5 5 UM functions and procedures 5 6 VT100 PGM integer and string constants VT100_5 PGM 5 5 SEND_MESSAGE 5 87 SEND_UNSOLICITED_MSG Serial connectors 1 7 for the Series 90 30 PCM for the Series 90 70 PCM Serial port control and status 4 14 Serial port framing error code 126 5 4 Serial port multiple error code 127 5 Serial port overrun error code 125 5 Serial port parity error code 124 5 4 Serial port setup with IOCTL and PORT_CTL BIN 5 52 Index 15 FLTS_SINCE_CLEARS NUM_FLTSS NUM_READ J 5 28 known problems with fault table access 5 33 READ FLITPGM 5 21 5 22 F 1 functions and procedures 5 21 FLT_CHANGED WORD WORD 5 21 shared definitions and constants 5 22 CLEAR TS 5 22 IO FAULT HDR
330. ode Caution It is recommended that the flag be set to NOWAIT Otherwise the time spent by MegaBasic could negatively impact the CPU sweep Format of the COMMREQ Instruction The COMMREO instruction has four input parameters and two output parameters When the COMMREO function receives power flow a command block of data is sent to the communications TASK The command block begins at the reference specified using the parameter IN The PCM to be communicated with is indicated by entering its rack and slot number for SYSID enable 0 Ok output Series 90 70 only REQ 2 7 2 0 7 77 7 IN Specifies the location of the command block It may be any word oriented user reference P L R AI or AQ Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 68 SYSID A hexadecimal value that gives the rack and slot location of the PCM to which the COMMREQ is being sent Entries have this format 102 o rack 1 0 slot 2 If the SYSID is incorrectly programmed for a rack and slot that does not contain a PCM the PLC will detect the error and will not send the communications request Additional examples Hex Word Value 0004h 0304h 0209h 0702h TASK The following table lists the applicable task numbers for the PCM Task Number Description 3 MegaBasic If the task number programmed for the PCM is
331. ode 112 113 114 115 116 117 118 119 120 122 123 124 125 126 127 5 4 Section 2 Screen Formatting Commands Because the PCM is often used with alphanumeric display devices additional MegaBasic statements have been provided to deal with these devices At present the display statements are only available for terminals that use DEC VT100 compatible control sequences VT100 PGM supplies several procedures and functions as well as predefined control sequences for driving VT100 style displays A companion file VT100 5 PGM is also available The difference between these two files is that VT100 PGM prints to STDOUT while VT100 5 PGM prints to the device opened as 5 To use the functions procedures and data structure definitions supplied in VT100 PGM add the line xxx Access vt100 pgm to the beginning of a MegaBasic program or in the PROLOGUE section of a user written package The file VT100 PGM should have been loaded to the PCM RAM Disk before running a MegaBasic program which accesses it The file is located in the PCOP or PCOP EXAMPLES PCM directory of your PC hard disk depending on which release of PCOP or TERMF you use The functions and procedures found in VT100 PGM are summarized in the following tables and are fully described on the pages following these tables GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 5 Table 5 2 VT100 PGM Functions and Procedures Fun
332. oftware PCOP User s Manual GFK 0487 for information on configuration and programming the PCM using PCOP When the PCM is configured by Logicmaster 90 for BASIC or BAS CCM mode a hard reset pressing the Restart Reset pushbutton for 10 seconds places the PCM programming port at the MegaBasic command level If your PCM is connected to an ASCII terminal or to a personal computer running TERME you can enter MegaBasic commands and program lines If you are using TERME you can load an existing program from a file on the PC A soft reset pressing the Restart Reset pushbutton for less than 5 seconds will cause MegaBasic to load and run a user program with the reserved name BASIC PGM if one is present in PCM RAM If there is no user program named BASIC PGM MegaBasic behaves as if it had received a hard reset To type new MegaBasic program lines enter a line number followed by one or more program statements separated by semicolons Use a carriage return to terminate the program line Lines may be up to 254 characters long New lines may be entered in any order regardless of the line number The line number simply tells MegaBasic where to insert the new line in the current program GFK 0255K Chapter 4 MegaBasic 4 3 Loading and Saving MegaBasic Programs The default device for PCM file locations is RAM the PCM RAM Disk File access using the MegaBasic LOAD and SAVE commands or the ACCESS statement assumes the RAM Disk unless another dev
333. ogramming 5 25 FLT_CHANGED The Fault Changed CHANGEDS function checks either fault table to see if faults have been added to or removed from the table since the last time it was checked The return value of the function is a boolean true false 1 0 value The return value is true if the selected fault table contents have changed since the last check of the fault table and false if there have been no changes The format for using the FLT CHANGEDS function is xxx result FLT_CHANGED select Parameter Description Select FLT TBLor PLC FLT TBL A boolean true falseorl 0 value The following example uses the FLT CHANGEDS function 50 Access READ FLT pgm 100 Dim PLC FLTSS 16 42 3000 If FLT CHANGED PLC FLT TBL then 3100 READ FAULT TBL PLC FLTS PLC FLT TBL 1 16 3200 An example using the FLT CHANGEDS function to check the I O fault table is 50 Access READ FLT pgm 100 Dim IO FLTSS 32 42 3000 If FLT CHANGED then 3100 READ FAULT TBL IO FLTS IO FLT TBL 1 32 3200 Note When the optional parameter for selection of the fault table is omitted the parentheses around the parameter list must also be omitted Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 26 WORD The WORD function provides access to 2 byte integer fields present in the fault records header records and short status r
334. only Note Some versions of the GE Fanuc Operator Interface Terminal OIT have an RS 232 DCE connector labeled Secondary Port as well as a DTE connector labeled Primary Port Other versions have only a DTE connector A 8 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K a44831 PIN TXD 2 TD I ae X 0 RXD E gt 0 CTS 2 omr 0 SPIN fel 8 DCD 09 DEVICE gt 0 PCM RTS s o 0 GND 7 ev Ly 2 25 PIN 25 PIN MALE FEMALE Figure A 12 PCM to a 5 Pin Device Full Hardware Flow Control In the following illustration the 5 pin device cannot flow control the PCM 844832 PIN TXD 2 TD 0 RXD X 3 RD 0 CTS 20 DTR um 5 PIN 0 pevine RTS 8 DCD 9 Pom 4 RTS o 5 cts 0 0 0 0 GND 7 GND 0 25 PIN 25 PIN MALE FEMALE Figure A 13 PCM to a 5 Pin Device No Flow Control or Hardware Flow Control GFK 0255K Appendix A PCM Cabling Information A 9 RS 422 RS 485 Cables The RS 422 RS 485 signal nomenclature used in this manual can be cross referenced to EIA standard RS 422 as shown below CCM Signal Name RS 422 Standard Signal Name RS 422 SD B RS 422SD A RS 422 RD B RS 422RD A A During a mark state logic 1 B is positive with respect t
335. ons Request COMMREO function Section 4 describes the CCM COMMREO data blockand includes a summary of the data blocks for theSeries 90 command set Section 5 describes the status word returned by a CCM COMMREQ Also included is a table of return status error codes Section 6 provides a complete Series 90 PLC ladder logic program containing CCM COMMREO function blocks for the PCM The sample program is suitable for both Series 90 30 and Series 90 70 PLCs Section 7 describes the effect this configurable portion of the Series 90 70 PLC CPU execution sweep can have CCM communication Also included is how to adjust the window time from the PLC program Title Series 90 CCM Target Memory Types Series 90 CCM Memory Addressing Conventions Communications Request COMMREQ CCM COMMREQ Data Block CCM COMMREQ Status Word CCM COMMREQ Example PLC System Communications Window Section 1 Chapter 3 GFK 0255K Series 90 CCM Target Memory Types Series 90 CCM supports a subset of the memory types available in Series Six CCM Tables 3 1 and 3 2 below list the Series 90 CCM memory types The types for the CCM single bit write function listed in table 3 2 are functional memory types They map to the same input and output tables as memory types 1 and 2 but are assigned unique memory type numbers because they are used to perform bit set and bit clear special operations
336. ontinuing to execute the next line in the program WAIT mode is the default 4 20 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 1 Description Both the SYSREAD and SYSWRITE statements may include this argument which tells the PCM to transfer the data at a periodic rate The frequency argument is an integer from 1 to 65 535 which specifies the number of millisecondsbetween eachtransfer This argument may only be specified when the NOWAIT argumentis also supplied The frequency argument should not be less than the CPU sweep time When the value of the frequency argument is zero the variable is transferred as often as possible The minimum time for a transfer is once per CPU sweep assuming that all system communication processing by the CPU can be done in its allotted window and that the size of the variable is less than 256 bytes Transfer times will be longer if the variable size is greater than 256 bytesor the CPU is heavily loaded with communication processing If the number of milliseconds specified by the frequency argument 15 shorter than the time the variable can be transferred in the variable is transferred as fastas possible For fast update times specify a frequency argument of zero This results in the fastest possible update time and requires less internal processing by the PCM than using a small frequency argument since no timers are associated
337. or information on MegaBasic timers see chapter 5 section 8 Timers and Logical Interrupts The CHECK BREAK and BREAK STATUS functions may be used detect a received break Their formats are brk rcvd CHECK BREAK port number brk status BREAK STATUS port number The port number argument specifies the serial port 1 or 2 where the break is to be detected When CHECK BREAK iscalled it returns 1 if a break has been detected since the last time it was called or the start of program execution on the first call BREAK STATUS returns 1 when break is active at the time it is called and 0 when break is not active The PCM serial ports detect a break when 12 or more consecutive zero or SPACE bits are received on the Receive Data input The break condition goes away when the next 1 or MARK bitis received GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 55 The RTS ON and RTS OFF procedures are used to turn the Request To Send RTS output of the serial ports on and off respectively while ON and DTR OFF perform the same operations for the Data Terminal Ready DTR output Their formats are RTS ON port number RTS OFF port number DTR ON port number DTR OFF port number The port number argument specifies the serial port 1 or 2 where the RIS or DTR output is to be turned on or off The CTS STATUS and DCD STATUS functions may be used to detect the status of the Clea
338. ords 5 33 I O fault table records I O reference address subrecords structure IOFA BUSS 5 33 IOFA BUS ADDS IOFA PT OFFSET IOFA_RACK 5 33 IOFA_SLOTS IORA_ADD IORA SEG 5 32 Idle timeout value 5 71 Illegal backplane operation error code Illegal NOWAITI O operation error code 119 5 4 E er variable type error code 114 LENGTH 5 56 CHR function 4 14 6 6 itialize device I command C 7 PUT statement 4 14 put to the PCM serial ports 4 14 PUT function 4 14 NSTALL DOC F 1 Installing the PCM 1 adding expansion memory to the Series 90 70 2 52 9 cabling A 5 configuring the PCM with Logicmaster 90 software 2 6 Z 5 3 Index 7 SMSG_WTEXT 5 16 5 18 structures and constants 406 002088 5 16 R PBMEMS R_TMEMS SMSG_TEXT W PBMEMS 5 16 W_TMEM 5 16 Get hardware ID G command C 6 get LED configuration O command 6 11 11 get PCM firmware revision number H command C 6 GET MEM LIM GRAPHPGM F 1 H H get PCM firmware revision number command C 6 Half Duplex 5 53 half duplex mode 6 8 Hand held programmer 2 19 Hard reset 1 3 HARDEXEC BAT D L D 2 D 3 Hardware adding expansion memory to the Series 90 70 PCM 2 5 2 9 battery 1 6 cable and connector specifications A 1 cabling A 5 catalog numbers for Series 90 30 PCM E D type connector 1 12 install
339. orts 4 14 OUTPUT function 4 14 P P request status data command Password protected data Path MS DOS 508161 2 25 PCM batch files D 1 creating a simple batch file HARDEXEC BAT D 1 D 2 PCMEXEC BAT D 1 D 2 running batch files TEST BAT D 1 PCM CFG configuration mode 2 14 PCM commands execute a batch file C 4 accessing the command inte preter C 1 B configure LEDs 14 25 C Clear the PCM C command format D file Directory 5 51 C 5 displaying a list of PCM commands C2 entering interactive mode C 2 F show Free memory C 5 G Get hardware ID H ET firmware revision number C 6 I Initialize device C 7 J format EEROM device C 9 K Kill a task C 9 L Load L Load command D 3 M create a memory Module notation conventions C 3 IC 11 O get LED configuration P request status data Q set protection level R Run C 14 R Run command R run command S Save 5 51 C 15 summary of PCM commands U reconfigure the PCM C 15 V Verify a file W Wait GFK 0255K DA LEDs USER1 and USER2 1 6 USERI and USER2 LEDs 1 6 watchdog timer WYE cable Module description PCM 1 4 Monochrome display adapter MDA MS DOS compatibility with MS DOS MegaBasic 4 7 MS DOS version of MegaBasic 4 2 MV CUR statement 5 6 5 15 MV CUR function 5 6 5 13 MYFILE BAT N NO_CPU 4 22 NONE configur
340. ote that the check CPU health procedure mustrun with a rep rate greater than zero and successfully geta response before this integer variable is set to true An integer variable that contains the PLC run status field from the PLC status word bits 12 15 that is the result of the READ PLC RUN STATUS procedure See the PLC STATUS WORD discussion for the coding of the values in this variable An integer variable that indicates when the run status has been read updated The value of this variable increments up to 255 and then rolls over to 1 A zero value false indicates that the PLC run status has never been read A string variable of maximum length 8 as a result of the READ PLC CPU ID procedure The actual length depends on the current length of the CPU s ID string Aninteger variable that indicates true false whether the PLC CPUID has been read Aninteger variable that indicates the presence true or absence false of a fault in the rack slot bus or module selected through the READ PLC FAULT BIT procedure Aninteger variable that indicates when the fault summary bit has been read updated The value of this variable increments up to 255 and then rolls over to 1 A zero value false indicates that the fault summary bit has never been read Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 Name PLC STATUS WORD VALID PLC TIME PLC DATE PLC TIME AND DATE VALID CPU
341. our PLC to the latest version in order to correct the problem 1 Insufficient Memory Error When this message is received the PCM does not have enough available RAM in a large enough block to execute the requested operation It is possible that memory has simply been fragmented through excessive use of the RAM Disk or other memory Initiate a soft reset of the PCM by pressing the Restart Reset pushbutton for less than 5 seconds Then try the operation again If the operation that received the original message was to save a MegaBasic program from within the MegaBasic interpreter save the program to your hard disk by typing SAVE PC filename to ensure that your work is not lost Too Many Files RAM Disk Overflow If files modules have been saved to the RAM Disk through the life of this PCM or if the PCM has been used for some other purpose before this application the RAM Disk may be too full to permit the desired operation Make sure that all files in the RAM Disk have been backed up by saving them to your computer s hard disk Then clear the PCM by using PCOP utility functions or by disconnecting the battery and shorting the battery terminal pins on the circuit board connector while rack power to the PCM is off If you are using PCOP check the PCM folder for unnecessary or unused files which could be deleted or moved to another directory on the hard disk of the programmer Then load the PCM folder to the PCM and attempt the operation
342. ous memory sizes to support different applications All PCM memory is supported by a long life lithium battery located on the module Each PCM occupies a single slot in a Series 90 rack Up to 63 PCMs may be installed in a single Series 90 70 PLC system to improve access to serial I O devices and to access PLC memory In the Series 90 30 PLC the Model 331 or higher model CPU may have up to 4 PCMs in the main rack The number of PCMs allowed in a rack may be restricted if the power consumed in the rack exceeds the rating of the power supply The PCM can be configured to run CCM and or MegaBasic programs using Logicmaster 90 configuration software Additional configuration capabilities are provided through the PCM development software package PCOP or by using PCM batch files 1 1 Chapter Section 1 GFK 0255K Section 2 Functional Overview CCM Operation For CCM applications each port behaves like an independent window into the PLC for access by other devices using the CCM protocol such as industrial computers and color graphic terminals The implementation of CCM on the PCM supports access to most user references Many applications which accessed Series Six user references using CCM can now support the Series 90 PLC with little or no change Either port of the PCM can be configured in CCM MASTER SLAVE or PEER mode In this capacity the PCM acts much like a Series Six CCM module transfering data between the PLC and an ex
343. ovember 1999 GFK 0255K Contents Appendix D PCM Batch Files 54552522 quern ERR ER RC UAR dC RC Ce aa D 1 Running Batch Files D 1 PCMEXEG BAT Hiles tre 1 1 dea 1 DRE RE AE natn D 2 HARDEXEC BATFiles sese cece eee eens D 2 User Installed PCMEXEC BAT and HARDEXEC BAT Files D 3 Appendix E Example MegaBasic Program 20 55 1511 E 1 Appendix F TERMF File Descriptions 0 ccc 666666666666666 002 F 1 Appendix G Synchronous Serial Mode 61390 2 0 1 Port1Pin Assignments G 1 Synchronous Operation Modes for Port 1 0 c eee eee G 2 Synchronous Mode PCMAS Port 1 Control Registers G 3 NEC720011I O Addresses 1 0 0 0 ccc ccc cece E G 3 NEC72001 Synchronous Clock Source Selection CR15 G 4 For Further 1 1 s G 4 GFK 0255K Series 90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 xiii Contents Figure 1 1 Series 90 70 PCM ia chere ERR ep d Rena EAR RR CRUCE eee Re E edd 1 4 Figure 1 2 Series 90 300 POM latest ea ea ee t E 1 5 Figure 1 3 Series 90 70 PCM Hardware Block Diagram 06066 6666666 666666666666660 6666060002 1 9 Figure 1 4 Series 90 30 PCM Hardware Block Diagram 0606 66666666 666666666666666 eee eee 1 11 Figure 2 1 Series 90 70 PCM Configurations 6 666666666666660 626626206200000 e
344. personal computer to program the PCM TERMF or PCOP must be installed and then configured This section describes how to install TERMF on your computer and how to use TERMSET the configuration program for TERMF and PCOP For information on installing PCOB refer to the PCOP Quick Reference Guide GFK 0657 in the front of this manual or to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 Installing TERMF The PCM support software package TERMF IC641SWP063 includes one 5 25 inch and one 3 5 inch installation diskette Choose the diskette that fits a diskette drive in your computer 1 Select the TERMF installation diskette which fits your computer s A drive and place itin your computer TERMF must be installed from drive A A To install TERMF to hard drive C type a install at the MS DOS prompt and press the Enter key B Ifyour computer has more than one hard drive or your hard drive is partitioned into two or more logical drives you can install TERMF to hard drive D or E rather than C To install TERMF to hard drive D type a install d and press the Enter key at the MS DOS prompt 2 The TERMF installation program creates these directories on the specified hard drive if they do not already exist PCOP PCOP EXAMPLES PCM PCOP UTILS The files listed in appendix E TERMF File Descriptions are copied to these directories If a previous version of TERMF or PCOP was already on the hard drive before this
345. port Software User s Manual November 1999 GFK 0255K Index Backing up your program 4 5 Backplane communication 5 114 backplane processing for the Series 90 30 PCM backplane processing for the Series 90 70 PCM Backplane interrupts 15 60 5 61 BKP XFERj5 60 5 61 NOW AITI O statements Backplane data in MESSAGE TXT 5 83 identifying the source of backplane messages message type source of the message 5 83 structure of backplane messages 5 65 application defined 5 65 destination message type 5 65 priority 5 65 reserved 5 65 source 5 65 status 5 65 to another PCM 5 86 value of MSG TYPE 6 5 83 Backplane processing for the Series 90 30 PCM 5 115 Backplane processing for the Series 90 70 PCM 5 114 Backplane timeout error code 118 5 4 Backplane transfer failure 6 4 Backplane transfer failure error code 112 5 4 Bad LED definition error 600060 3 Bad timer definition error code 108 5 3 BA a configuration mode 2 13 5 BASIC configuration mode 23 Basic oa incompatible error code 5 4 116 5 4 Batch files D 1 running batch files TESTBAT D 1 Batter y 1 6 Index 1 Symbols execute a batch file command C 4 A ACC_CODES 5 16 access codes for PLC memory types5 19 ACCESS statement 4 11 Access to PLC fault tables and PLC status 521 Accessing P L and password protected data 5 16 Accessing PLC d
346. posed metal surface of the PLC rack to discharge any electrostatic charge you may have picked up Then remove the PCM from the protective bag 5 Slide the PCM completely into the slot The three LEDs are located at the top of the module 6 Pressthe module firmly against the front rails of the PLC rack but do not use excessive force 7 Power up the PLC rack The OK LED top LED on the faceplate flashes during power up diagnostics It continues to flash while waiting for configuration data from the CPU If no signal is received across the backplane for 2 minutes the PCM assumes that the CPU is not there and continue to power up without it Once the PCM is ready this LED should be continuously on Installing a Series 90 30 PCM To install a Series 90 30 PCM follow these steps 1 Use Logicmaster 90 software or the Hand Held Programmer to stop the PLC This prevents the PLC program from initiating any command that may affect the operation of the module 2 Power down the Series 90 30 PLC system 3 Locate the desired rack and slot 4 Hook the top of the PCM case to the PLC baseplate and then guide the latch on the bottom of the case into its slot in the baseplate The three LEDs are located at the top of the module 2 4 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 Press down firmly to lock the module in place but do not use excessive force 6 Power up the PLC rac
347. r ATTR statement with no parameters An integer constant 5 that turns on the blinking text screen display attribute An integer constant 1 that turnsonthehigh intensity bold text screen display attribute An integer constant 4 that turns on the underline textscreen display attribute An integer constant 7 that turnsontheforeground background reversed text screen display attribute An integer constant 1 used in the MV CUR function or MV CUR statement to move the cursor up An integer constant 2 used in the CUR function or MV CUR statement to move the cursor down An integer constant 3 used in the MV CUR function or MV CUR statement to move the cursor right An integer constant 4 used in the MV_CUR function or MV CUR statement to move the cursor left A string constant lt esc gt used as the prefix for many of the VT100 control strings A string constant esc H used to set the cursor position to the home position row 1 column 1 A string constant lt esc gt 7 used to save the present cursor position and screen display attributes A string constant lt esc gt 8 used to restore the previously saved cursor position and screen display attributes A string constant lt esc gt 3 used to set the currentlineto double wide double high top half display format A string constant lt esc gt 4 used to set the currentlineto double wide double high bottom h
348. r Module and Support Software User s Manual November 1999 GFK 0255K Scratch Pad Memory Allocation Footnotes for table 3 6 Series 90 790 CPM CPU Series 90 915 CPM CPU Series 90 925 CPM CPU Series 90 772 CPX CPU Series 90 782 CPX CPU Series 90 928 CPX CPU Series 90 935 CPX CPU Series 90 772 CGR CPU Series 90 935 CGR CPU Series 90 30350 CPU Series 90 30351 CPU Series 90 30352 CPU Series 90 30360 CPU Series 90 30363 CPU Series 90 30364 CPU 0100 0101 Suspended 0110 Stopped IO Enabled Run Enabled Run Disabled Stopped Stopped Faulted CPU Major Type Codes 0000 0001 0010 0011 PLC 59070 PLC CPU 12 0ch Series 90 70 PLC CPU 59030 PLC CPU 16 10h Series 90 30 PLC CPU CPU 790 90 Sah CPU 915 15 0fh CPU 925 25 19h CPX 772 73 49h CPX 782 83 53h 928 28 1ch CPX 935 35 23h CGR 772 74 4ah CGR 935 36 24h CPU 350 44 2ch CPU 351 37 25h CPU 352 39 27h CPU 360 40 28h CPU 363 41 29h CPU 364 42 2ah Series 90 70 Minor Types for CPU 731 31 1Fh Series 90 731 CPU 732 32 20h Series 90 732 CPU 771 71 47h Series 90 771 CPU 772 72 48h Series 90 772 CPU 780 80 50h Series 90 780 CPU 781 81 51h Series 90 781 CPU 782 82 52h Series 90 782 CPU 788 88 58h Series 90 788 CPU 789 89 59h Series 90 789 CPU _914 92 5ch Series 90 914 CPU 924 24 18h Series 90 924 CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU
349. r Moduleand Support Software User s Manual November 1999 vii 3 2 3 4 3 6 3 12 3 13 3 15 3 15 3 15 3 18 3 19 3 23 3 25 3 28 3 28 3 28 3 30 3 30 GFK 0255K Section 3 Configuring the Series 90 30 PCM with the HHP Freezing the Configuration 006666666666666 666660666660666 eee ee Section 4 TERMF Installation and Configuration Installing TERME sssssss III e Adding the PCOP Directory to the MS DOS Search Path Section 5 Using TERMSET to Configure TERMF or PCOP Local Configuration File 2 6 6 666666666606606 0600000002 Connecting the PCM to the Programmer Diagnosing Serial Communication 2001025 7774 CCM Operation 553 erat RIA PR RA d ACE IRR RD Section 1 Series 90 CCM Target Memory Types CCM Serah Pad 2 REP RR Rer Re Det een Diagnostic Status gt gt gt Section 2 Series 90 CCM Memory Addressing Conventions Target SourceMemory Addresses 00 000000 e eee eee Data Length oe sek eret eee Gach bette ee Boe CCM Comparisons nn Section 3 Communications Request COMMREQ Format of the COMMREO Function Block 774 Other COMMREO Faults 0 00 cece cee enn eee eens PowerUp Delay i ik ERREUR noes Command Block ket abo geese a vena br
350. r Table 3 9 shows the unit length and accessible increment for each memory type Specifies the address within the Series 90 CPU where the data transfer is to begin The source memory address descriptions and ranges are the same as for target memory as shown in table 3 8 Word Command Word Word 7 Target ID Word 8 Target Memory Type Word 9 Target Memory Address Word 10 Data Length Word 11 Source Memory Address Word 12 GFK 0255K Chapter 3 CCM Operation The following table summarizes those Series Six commands which are not supported by Series 90 CCM Table 3 12 Series Six CCM Commands NOT Supported by Series 90 CCM Command Number Description 6004 6009 Quick Access Buffer Manipulations 6106 6116 6010 Set CPU Memory Write Protect 6011 Reinitialize CCM Task 6012 Set OIU Timers and Counters 6104 I OOverride TableManipulations 6105 6114 6115 6108 CharacterString Manipulations 6118 unformatted ead write 6128 6118 6128 6117 Write to Target from Source User Logic 6130 Set CCM Retries 6131 Set CCM Timeouts 3 22 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Section 5 CCM COMMREQ Status Word A general description of the status word for a COMMREO appears in section 3 of this chapter There are several points to remember when interpreting the contents of the CCM COMMREO status word 1 CCM never returns a status word value
351. r To Send CTS and Data Carrier Detect DCD inputs respectively Note that DCD is also known as Receive Line Signal Detect RSLD and Carrier Detect CD Their formats are CTS STATUS port number DCD STATUS port number cts state dcd state Again the port number argument specifies the serial port 1 or 2 where the status is to be tested These functions return 1 when the corresponding status input is TRUE and 0 when FALSE Note that when a serial port is configured as RS 485 the DCD STATUS function always returns TRUE Note If the serial port is configured for hardware flow control using RTS and DTR ON OFF procedures is not recommended These functions and procedures are available in PCM firmware version 3 00 or later 1 ALL SENT STATUS port number returns 1 if the port has no more characters to send and 0 if the port is still sending characters 2 IN LENGTH port number returns the number of characters which are in the type ahead buffer of the selected port and are waiting to be processed 3 FLUSH PORT port number empties the type ahead buffer of the selected port This procedure available in PCM firmware 4 03 or later permits masking any combination of parity overrun and framing errors on either serial port Because serial port errors cause MegaBasic program termination unless the program explicitly handles them you may prefer to mask these errors MASK PORT ERRORS port number
352. r events which will flash the LED before task 7 programs it Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K 6 8 Clear the PCM Format C This command deletes all RAM Disk files on the PCM including the UCDE resets the PCM and initializes it in factory mode The C command returns an error if any files are in use When this happens the PCM must be put in factory mode U FDEF before it can be cleared file Directory Format D lt option gt This command prints the names of the files stored in the PCM RAM Disk or other file devices It returns no errors A single letter option separated by a space from the D command may be used The following table shows the data returned by this command and its options Option Description D The D command used alone shows the names of non hidden files in the PCM RAMDisk DH This command option shows all files hidden and non hidden in the PCM RAM Disk Hidden files may include files loaded to the PCM using the Hidden attribute as wellas file data blocks appended to files created by PCM applications DP This command option shows files in the PCM system EPROM These files provide VTOS functionality DR This command option shows files in the PCM option EPROM These files provide functionality such as MegaBasic CCM etc show Free memory Format F In interactive mode this command displays the amou
353. r kind of error will prevent the COMMREO from completing and setting R00107 to a non zero value Additional logic should be provided to detect these faults using PLC fault or system contacts and to recover from them For more information on Series 90 fault and system contacts refer to the Series 90 30 90 20 Programmable Controllers Reference Manual GFK 0467 or the Series 90 70 Programmable Controller Reference Manual GFK 0265 GFK 0255K Chapter 3 CCM Operation 3 25 05 04 91 lisD5 GE FANUC SERIES 90 70 DOCUMENTATION v3 01 Program to Send CCM COMMREQs As Often As Possible START OF LD PROGRAM EXAMPLE VARIABLE DECLARATIONS PROGRAM BLOCK DECLARATIONS INTERRUPTS START OF PROGRAM LOGIC gt gt RUNG 5 lt lt FST SCN BLKMV BLKMV INT INT CONS 7 0 CONS 0 CONST 6 CONST 0 or 00000 CONST 00000 CONST 00000 lt lt RUNG 6 gt gt FST_SCN MOVE_ MOVE UINTI UINT CONST IN 0 200001 CONST 7 00000 LEN 00001 LEN 00001 00001 gt gt RUNG 7 lt lt COMMDLY COMMENT Program EXAMPLE C NLM90NEXAMPLE 3 26 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K 05 04 91 LirD5 GE FANUC SERIES 90 70 DOCUMENTATION v3 01 Program to Send CCM COMMREQs As Often As Possible Y ok
354. r the Series 90 70 PCM DCD_STATUS 5 56 Default configuration for the Series 90 30 PCM 1 13 2 18 DEFAULTDAT 2 26 2 33 b 2 6 9 Deleting PCM data files using TERME 5 50 Development package PCM 1 3 Device unavailable error code 123 Diagnosing serial communication problems 2 33 Diagnostic status words 3 6 DIR command 4 8 4 27 DIR OFF 5 56 DIR ON 5 56 DISMISS statement 4 11 Dual port RAM S 109 Dual port RAM available for applications 5102 Duplex Mode Full Duplex Half Duplex 5 53 Point to Point Duplicate remote variable error code 111 5 3 DW_DH_BOT 5 7 DW_DH_TOP 5 7 DW SH 5 7 E Encrypting programs 4 12 END statement 4 6 Enhanced graphics adapter EGA GFK 0255K file Directory D command Files loading and storing PCM data files using TERME FILL statement 4 5 5 109 5 110 FLT_CHANGED short status records 5 30 FLT_CHANGED FLT_PRESENT short status 1660708 5 00 FLT_PRESENT 5 21 FLTS SINCE CLEAR FLUSH_PORT 5 56 format EEROM device J command C 9 Format of the COMMREO function block 3 13 5 68 B 1 Full Duplex 5 53 full duplex mode Functional overview CCM operation extensions to MegaBasic 1 2 hard reset 1 3 MegaBasic operation 1 2 PCM development packag e 1 3 PCM operation modes 5 PCM support utilities for personal computers PCOP RAM disk 1 2 restart reset p ushbutton
355. ract message type and source information from a message Note that the MegaBasic bitwise AND and right shift gt gt operators are available in PCM firmware versions 2 50 and later Megabasic displays the firmware release as PCM VTOS vX XX whenever it starts where X XX is the firmware release number For more information on the message type and source fields see Table 5 10 Dim MESSAGE HDRS 32 Dim MESSAGE TXT 256 PROCESS MESSAGE MESSAGE HDR MESSAGE 9 MSG TYPES asc MESSAGE 089 8 SOURCE asc MESSAGE HDR 9 256 asc MESSAGE_HDRS 10 RACK SOURCES amp 0 SLOT SOURCES gt gt 4 10 ID SOURCES lt lt 9 amp 1111111b Line 510 puts the message type value into MESSAGE TYPES and line 520 puts the two byte 16 bit source value into SOURCES In line 530 the amp operator is used to hide or mask all but the four least significant bits of SOURCE when they are copied to RACKS The lt lt operator is used in line 540 to shift the 5 bits in SOURCE which contain the slot value into the five least significant bits of the result Then the amp operator assures that only these five bits are copied to SLOTS Similarly these same operators are used in line 930 to copy just the seven ID bits to ID 5 82 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K The following table explains the interpretation of MSG TYPES RACK SLOTS and
356. ram before it can be SYSLINKed It can be a string of any length an integer a real or a numericarray of up to3 dimensions String arrays sub strings and individual elements of arrays cannot beSYSLINKed CPUSymbol Thisargumentcontains the PLC reference with optional suffix for override transition or fault data as described above It can be either a quoted string e g R500 or a string variable that contains a properly formatted CPU reference Type This argument contains the MegaBasic type of the CPU reference as it exists in the PLC This type may differ from the type of the local variable defined in the MegaBasic program For example a MegaBasic local variable may be defined as an integer which in MegaBasic is a 32 bit number If the correspondingCPU variableisaregister which is a 16 bit number the type argument can be used to convert it to 32 bits when it is read by the MegaBasic program If a type is specified the PCM automatically performs a type conversion between the CPU type and thelocal type whenever the variable is read or written MegaBasic has three native data types 32 bit integers 64 bit real numbers and strings The following PLC CPU data types may be specified BOOL single bit BYTE 8 bits INT16 16 bit signed integer UINT 16 bit unsigned integer DINT 32 bit signed integer e REAL32 32 bit IEEE real number e REAL64 64 bit IEEE real number If the type argument is om
357. ram will execute slowly In this case the response of the application may be improved by transferring the data less frequently For a sample MegaBasic program which uses SYSLINK SYSREAD and SYSWRITE extensively see appendix E Example MegaBasic Program GFK 0255K Chapter 4 MegaBasic 4 23 UNLINK Statement The UNLINK statement is used when a MegaBasic program no longer needs to transfer a variable that has been SYSLINKed The UNLINK statement tells the PCM that it is no longer necessary to maintain the data structure set up by the PCM to track the variable This structure can then be reused to SYSLINK another variable The UNLINK statement has the form UNLINK variable name Once a variable has been UNLINKed it cannot be used with SYSREAD SYSWRITE or SYSTATUSS until it is S YSLINKed again Any attempt to do so results in a Remote variable unknown error Data Coherency When a frequency argument is used with SYSREAD or SYSWRITE the variable is periodically updated Special steps must be taken to ensure that the PCM s copy of a PLC CPU variable is not updated while the MegaBasic program is manipulating it This is especially important for arrays of data All data updates take place at the end of a MegaBasic statement Once an update begins the next statement does not execute until the update is completed Consequently coherency of a PLC variable is guaranteed if it can be processed in one statement Whenever a
358. rammable Coprocessor Module and Support Software User s Manual November 1999 1 12 Section 6 Configuring the PCM Before a PCM can be used in a Series 90 70 or 90 30 PLC system it must be configured for the CCM or MegaBasic functions it is to perform For some CCM only applications the Series 90 30 PCM requires no configuration at all The Model 331 or higher model CPU provides an autoconfig setting for CCM to permit automatic operation These autoconfig default settings for the Series 90 30 PCM in CCM mode are described in the next chapter Configuration information can be provided in two ways through Logicmaster 90 configuration or the Series 90 30 Hand Held Programmer and or a user configuration created by the PCOP development software For most MegaBasic and CCM applications Logicmaster 90 configuration is all that is needed Logicmaster 90 configuration of the PCM is described in section 2 of the next chapter When the PCM is configured for a MegaBasic application by Logicmaster 90 or the Series 90 30 Hand Held Programmer PCM batch files may be used to set certain PCM parameters PCM batch files are described in appendix D of this manual For some advanced applications the PCM may be configured using the PCOP development software The configuration created by PCOP is called UserConfiguration Data UCDF The UCDF is similar in function to the CONFIG SYS file in a DOS personal computer system The PCM uses the inform
359. rds to read The defaultis 0 which returns only the fault table header Note All parameters except String are optional In the following example fault records are read from the I O fault table starting with the first record and reading up to 32 records The fault records are placed in the string IO_FLTSS 50 Access READ FLT pgm 100 Dim IO FLTS 32 42 2000 READ FAULT TBL IO FLTSS IO FLT TBL 1 32 In the next example only the I O fault table header string IO FAULT HDR is read 50 Access READ FLT pgm 100 Dim TEMPS 42 300 READ FAULT TBL 5 Chapter 5 Advanced MegaBasic Programming 5 23 GFK 0255K RDEL FAULT TBL The Read and Delete Fault Table RDEL FAULT TBL procedure reads and deletes the first entry in either fault table The deleted first entry is returned in a user defined string The string must be at least 42 bytes long one fault record length The format for using the RDEL FAULT TBL procedure is xxx RDEL FAULT TBL str select Parameter Description String Thestring where the procedure puts the fault record if any read from the PLC CPU Select IO FLT TBLor PLC FLT TBL Theselect parameter is optional Thedefaultis IO FLT TBL In this example the first fault record in the PLC fault table is placed in the string FLT and then deleted 50 Access READ FLT pgm 100 Dim FLTS 42 400 RDEL FAULT TBL FLT PLC FLT TBL In the next example the first fault record in
360. re generally processed immediately by the PCM If a PCM user program sends a large number of NOWAIT request messages in a short time by executing SYSREAD and SYSWRITE statements for example the outgoing message queue may fill faster than the PLC CPU can empty it The queues may fill even faster when CCM and a user program are both running Eventually one or both of the queues may fill up When a queue is full a new message for that queue is delayed until the PLC CPU can make room for it by servicing a message already in the queue In order to guarantee that every message is transferred to the PLC CPU on the next sweep the total number of pending messages must not exceed the capacity of the PCM s backplane queue No more than 8 low priority messages plus 8 high priority messages may be pending at any time In addition the system communications window must be configured for run to completion mode or if it is configured for limited mode the window time limit must be long enough to service the queues Repeated Transfers When a MegaBasic variable is transferred repeatedly a timer is used to transfer it automatically at a specified interval If a repeat value of zero is used the variable is retransferred immediately after the previous transfer completes This can be used to transfer data on every sweep provided that the following requirements are met The PCM is configured for MegaBasic only Less than eight variables are being transferr
361. re still in good condition so that the procedures in the UTILITY PGM package may be used in a NOW AIT repetitivemanner The format of the UTILITY INIT procedure callis xxx UTILITY INIT where there are no parameters An example of the UTILITY INIT procedure is Access utility pgm CHECK CPU HEALTH 1000 READ PLC FAULT BIT 0 1 1 1 NOWAIT 2000 READ PLC RUN STATUS NOWAIT 500 UTILITY INIT where several repetitive operations using the UTILITY PGM package are started Then at some later time they are all stopped by the UTILITY INIT procedure call Another example of the UTILITY INIT procedure is Access utility pgm Interrupt TIMER4 end Interrupt TIMER4 DELAY_STARTUP_PROC Interrupt TIMER4 on TIMER 4 TSTART 10000 Def proc DELAY_STARTUP_PROC UTILITY_INIT CHECK_CPU_HEALTH 1000 Return Proc end where the checking of the CPU s health is delayed 10 seconds from system startup before being checked every second The use of UTILITY_INIT in this example is due to the use of TIMER4 for the delay timer TIMER4 is also used by the UTILITY PGM package for control of the repeat rate of the check of the CPU s health As a result the interrupt linkage for the UTILITY PGM package must be re established before beginning the CHECK_CPU_HEALTH procedure Chapter 5 Advanced MegaBasic Programming 5 49 UTILITY_INIT GFK 0255K Loading and Storing PCM Data Files Using TERMF This section contains information
362. redictable After a generic request message is sent to the PLC CPU several MegaBasic statements are usually executed before the response message arrives The most efficient way to handle unpredictable messages is with the BKP 6 interrupt This program fragment shows how to use it Dim MESSAGE HDRS 32 Dim MESSAGE TXT 256 Def proc USER BKP MSG PROC Repeat PROCESS MESSAGE MESSAGE HDR MESSAGE 5 If MESSAGE HDR then Return Rem process the data here ext Proc end Interrupt BKP MSG end Interrupt BKP MSG USER BKP MSG PROC Interrupt BKP MSG on 5 66 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 67 Interpreting COMMREQ Messages Execution of a COMMREO function block in the PLC CPU will cause one of these four message types to be sent to the target PCM All COMMREO messages contain rack 0 slot 1 ID 9 in the source field The following table explains how these four message types differ Description The body of the COMMREO message is contained in a message string that is copied to the string provided as the second argument to PROCESS MESSAGE The word at offset 18 in the header specifies the length of the text string in bytes The length can also be found by calling the LEN function with the message string as an argument A message type of 131 indicates that the PLC CPU is waiting for the completion of message processing This message t
363. respectively In the PCM version of MegaBasic the channel numbers 0 1 and 2 are assigned to the logical devices standard input standard output and standard error respectively They are set to COMI by default although they can be changed if necessary with a PCM batch file or PCOP Changing them is required for example to prevent the MegaBasic startup banner from appearing on a display terminal attached to the PCM For information on changing the port assigned to standard channels refer to the R Run command in appendix C PCM Commands in this manual or to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 Channel numbers 3 and 4 are reserved for future use by GE Fanuc Your programs should assign channel numbers from 5 through 31 to avoid possible conflicts with future PCM releases GFK 0255K Chapter 4 MegaBasic 4 13 Input and Output to the PCM Serial Ports The PCM has two high performance serial ports that can be used to connect the PCM to any device that uses the RS 232 RS 422 or RS 485 physical connection protocol The COMI and COM2 device drivers which come with the PCM support asynchronous communication at data rates up to 38 4K bits per second There are several ways to input characters from a serial port to a MegaBasic program The simplest although not the recommended method is the MegaBasic INPUT statement When an INPUT statement is executed the MegaBasic program waits until the Enter key is pres
364. rive for files in the device portion of the file path For example Path Description MYDATA DAT Currentdirectory of the currentdrive MB MYPROJ MYDATA DAT Directory MB MYPROJ of the current drive A MYDATA DAT Currentdirectory of drive A C MB MYDATA DAT Directory MB of drive C In the PCM version however the usual device part of the file path is used to distinguish between the PCM RAM Disk and the current disk drive in the PC Consequently a second device must be specified in the path of PC files which are not in the current drive Path Description RAM MYDATA DAT PCM RAM Disk PC MYDATA DAT Currentdirectory of the current PC drive PC MB MYPROJ MYDATA DAT Directory MB MYPROJ of the current PC drive PC A MYDATA DAT Currentdirectory of PC drive A PC C MMBMMYDATA DAT Directory MB of PC drive C You can also hide this difference between the PCM and MS DOS versions of MegaBasic in the single package which you change when switching between them Define string variables in this package for all file path and name specifications and assign different string values to them in the PCM and MS DOS versions of the package Then use the string variables as arguments in all MegaBasic statements and functions which specify the files by name Unlike PC disk drives in DOS version 2 0 or later the PCM RAM Disk does not support multiple directories GFK 0255K Chapter 4 MegaBasic 4 7
365. rmat of the READ PLC RUN STATUS procedure call is xxx READ PLC RUN STATUS wait flag delay where both parameters are optional and if omitted a single read of the PLC run status takes place in wait mode The wait flag is normally programmed with the NOWAIT constant from the 201153657 package that is accessed automatically by the MegaBasic program The delay parameter is only used if NOWAIT mode is active and is the minimum number of milliseconds that the UTILITY PGM package will wait before rereading the PLC run status An example of the READ PLC RUN STATUS procedure is Access utility pgm READ PLC RUN STATUS NOWAIT 500 OLD 1 Repeat While OLD Let NEW PLC RUN STATUS Next OLD NEWS Print Print date time PLC CPU Case begin on NEWS Case 0 Print is running with I O enabled Case 1 Print is running with I O disabled Case 2 Print is stopped with I O disabled Case Print is stopped with I O disabled and faults Case Print is halted with I O disabled Case Print is suspended with I O disabled Case Print is stopped with I O enabled chr 7 32 Case end Next where the CPU run status is read every 1 2 second Every time that it changes a time stamped descriptive message is printed For state 6 stop I O enabled 32 bel characters are also sent to the terminal as a type of alarm notification Chapter 5 Advanced MegaBasic Programming 5 43 G
366. rocedures For example 100 Interrupt NOWAIT RD end 110 Interrupt NOWAIT RD USER ISR PROC 120 Interrupt NOWAIT RD on where USER ISR PROC isthe name of the user procedure that handles NOWAIT READ processing Multiple NONAIT READs and NOWAIT WRITEs can be done simultaneously over a single channel as long as the maximum buffer space for the channel is not exceeded The transfers are processed in the order that the statements are executed If an interrupt is defined for NOWAIT RD or NOWAIT WR 5 and 4 and the interrupt occurs the MegaBasic interrupt procedure must use either the PROCESS READ or PROCESS WRITE statement to complete the processing and obtain a pointer to the variable the handle and an error code The formats of the PROCESS READ and PROCESS WRITE statements are PROCESS READ 1 gt ptr handle error PROCESS WRITE vbl ptr handle error 5 94 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K Argument Description Variable Pointer AMegaBasicpointer After the statement is executed the pointer points to the string variablethat was transferred Handle Contains the transfer handle passed by the NOWAIT READ or NOWAIT WRITE statement that initiated the transfer If none was passed the handle argument is set to zero Error Set to an error code or zero when there is no error This example is a NOWAIT READ interrupt procedure
367. rocess are included in the following table After that each section describes one step of the installation procedure in detail Notall steps arenecessary for every application Section Title Description Page 1 Installingthe PCM Section 1 contains the first step in the installation 2 3 Hardware procedure This step is always requried It describes the physical installation of the PCM in a Series 90 rack Hardware descriptions are also included 2 Configuring the PCM Section 2 contains the second step in the installation 2 6 with Logicmaster 90 procedure This step is always required for a Series Software 90 70 application and for most Series 90 30 applications those not relying on autoconfig It describes how to add a PCM to the Series 90 00 configuration using Logicmaster90configuration software 3 Configuring theSeries The PCM parameters can be edited with the Hand 2 19 90 30 PCM with the Held Programmer if you have 8 Release 3 or later HHP CPU and a Release 2 51 or later PCM Section 3 describes how to do this 4 TERMFinstallation Section 4 describes how to install TERMF software 2 24 andConfiguration ona programming computer and configure TERMF for the computer This step is required for MegaBasic programming 5 Using TERMSET to Section 5 describes how to run TERMSET to modify 2 26 Configure TERMF or the TERM DAT file If you are using PCOP refer to PCOP the Series 90 PCM Development Software PCOP User s Manual GF
368. s enable 0 function OK logic WRT data to be BYTE written IN LEN address 00001 modifier AM module address Parameter Description Enable Power flow input that when true enables the execution of the function Type Function type either byte or word to select the corresponding type of VME bus access to be performed Length Aninternal parameter that depending on the function type specifies the number of bytes or words to be transferred In Specifies the first PLC user reference location where the data to be written to the PCM is stored This parameter may be a constant in which case the constant value is written to all VME addresses covered by the function s length AddressModifier Hexadecimal value coded to specify the address modifier of the PCM The PCM AM code is always 39H see above Address A double word specifying the hexadecimal address where the first word or byte is written to the VME bus It may bea constant or the reference address of the first low word of two words containing the module address The address is based on the rack and slot where the PCM is located Refer to Address Allocation by Rack and Slot in this section OK Power flow output that is true when the function is enabled and completes successfully When the VMEWRT function receives power flow through its enable input LEN data units words or bytes from the PLC locations beginning at the input parameter
369. s 130 131 194 and 195 15 67 NOWAIT mode OK and FT parameters 3 14 5 70 other COMMREQ faults 3 15 power up ee cai programming the PLC COMMREQ function block 5 68 resetting the PCM from a PLC program SYSID parameter 3 13 5 69 TASK parameter 3 14 5 69 WAIT mode 3 12 Communication failure 6 2 Communication unsolicited 5 64 CCM COMMREQ mir ary CCM COMMREQ status word CCM status word command block data block 3 17 data block length 3 16 idle timeout value 3 17 maximum communication time status pointer memory type 3 17 status pointer offset 3 17 wait no wait flag 3 16 controlling COMMREQs 5 76 data block format of the COMMREO function block IN parameter 3 13 5 68 E reting COMMREQ messages Me EN blink LED program example 55 MegaBasic COMMREO command block MegaBasic COMMREQ example 5 72 types 130 131 194 and 195 3 NOWAIT mode OK and FT parameters 3 14 5 70 other COMMREO faults 3 15 power up programming the PLC COMMREQ function block SYSID parameter 3 13 TASK parameter WAIT mode 3 12 Index 3 Communications request CHECK BREAK CHECK CPU HEAITH 5 46 CHG PRIV TeS CHG_PRIV procedure 5 83 CLEANUPBAT F 1 CLEAR command Clear the PCM C command C 5 CLEAR_TS 5 22 5 28 CLS statement 5 6 5 8 CMRQ_DATA 5 76 CMRQ HDRS 5 76 CMRQ RCVD 6 5 76 5 77 CMR
370. s always complete immediately NOWAIT READ and NOWAIT WRITE therefore are not recommended for these devices GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 91 NOWAIT OPEN The NOWAIT OPEN function opens a channel for subsequent asynchronous communication Its format is handle NOWAIT OPEN lt name gt mode buffer size error Argument Description Name The name of the device to be read or written It may be a device such as 001 or a file suchas PC data out Ifitisa filename the name must be fully qualified as device filename Fora device the name can bea literal string ora string variable containing a properly formatted name Mode Specifies how the file is to be opened It is formatted as shown below Read Bit If set to 1 the channel for the device or file has read privilege If the file does not exist an error is returned Write Bit If set to 1 the channel for the device or file has read and write privilege Ifa file already exists its contents are erased If it does not exist the file is created Append Bit If set to 1 the channel for the device or file has read and write privilege If the file already exists its contents are not erased If it does not exist an error is returned Unused must be 0 Read bit Write bit Append bit 5 Unused must be 0 5 92 Series 90 Programmable Coprocessor Module and Support Software User s Manual
371. s clears PCM memory Reconnect the battery and turn the power on again If there is no MegaBasic startup banner or command prompt and you are sure the PCM configuration mode is correct refer to chapter 6 Troubleshooting Guide Interactive Mode When the PCM connects you to the command interpreter after power up or a reset you should see this prompt When you return to the command interpreter from MegaBasic you may not see a prompt on your screen immediately but pressing the Enter key should display a prompt At this point the interpreter is in its default mode which is used to communicate with the PCM development software package PCOP Default mode does not respond to you with text messages nor does it echo the keys you type back to your screen You must switch to INTERACTIVE mode by typing two exclamation points and pressing the Enter key This message will appear INTERACTIVE MODE ENTERED type for a list of commands If your PCM firmware version is earlier than 3 00 you will see DEBUG rather than INTERACTIVE in this message To display a list of PCM commands type a question mark and press the Enter key If you are using PCOD you need to type three exclamation points and then press the Enter key in order to return to it PCOP cannot communicate with the command interpreter while it is in interactive mode When using Megabasic make sure all your programs have been saved to your comput
372. s more data than is available in a particularmemory type 5 05 A COMMREO attempted to read or write an odd number of bytes toregister memory or the diagnostic status words 6 A COMMREO attempted to read or write one or more non existent registers 7 A COMMREO specified the transfer of zero data bytes 8 08 A COMMREO attempted to write to protected memory 9 A COMMREO attempted to transfer data to or from an invalid memory type or absolute source address 10 0A A COMMREO attempted to read or write one or more non existent diagnosticstatuswords GFK 0255K Chapter 3 CCM Operation 3 23 GFK 0255K Table 3 13 CCM Serial Port Secondary Error Codes High Byte of Diagnostic Status Word 1 cont d Description A COMMREO attempted to transfer data beginning at an invalid scratch pad address or an input output table address not on a byte boundary e g 1 9 17 Serial communication was aborted after a data block transfer was retried three times or a number specified by the configuration Serial communication was aborted after a header transfer was retried three times or a number specified by the configuration Serial communication was aborted after a Q Request was retried three times or a number specified by the configuration An attempt was made to set the Q Response data on a device not configured asa slave One or more of the following errorsoccurred during a data block transfer e Aninvalid STX character
373. s word 16 bit access to the memory location For more information on the EXAM and FILL statements refer to the MegaBasic Programming Language Reference Manual GFK 0256 The next section of this chapter contains an example of PLC VME functions and MegaBasic EXAM and FILL statements Chapter 5 Advanced MegaBasic Programming 5 109 GFK 0255K Section 12 Programming Example using VME Functions The following programming example uses the VME functions of the Series 90 70 PLC to communicate with a PCM The PCM is located in slot 3 of rack 0 corresponding to the address programmed in the VME functions Modules in that rack and slot location may use addresses 020000H 027FFFH as shown in table 5 4 in section 4 of this chapter Note that the AM code is always 39H A semaphore located at address 0A4000H in the PCM is used to prevent simultaneous access to the data by the PCM and the PLC The address programmed in the VME functions indicates rack slot and data offset in the PCM dual port RAM The segment word on the PCM side is always 0A0000h Allowable offsets are in the range 4000h 7FFFh Refer to the preceeding section in this chapter The 4000h in the VME address corresponds to the offset 4000h in PCM dual port RAM In the example ladder when R1 contains 2 the semaphore at offset 4000h on the PCM is read If the semaphore has the value 1 the value of R1 is incremented to 3 If the semaphore is 0 R1 remains 2 As long as
374. scribed in the table below Many PCM applications use one of three configuration modes CCM ONLY BASIC or BAS CCM Some applications use PCM CFG PROG PRT PROG CCM or CCM PROG These modes all require that the PCM itself be configured using the PCOP software package Table 2 2 PCM Configuration Modes Mode Description CCM ONLY CCM ONLY mode permits complete configuration for CCM execution on one or both PCM ports After a soft reset the PCM automatically starts CCM on the designated port s BASIC BASIC mode is used to configure the PCM for a standard MegaBasic application The ports are configured for use by the MegaBasic program and for connection to the TERMF package port 1 which is used to program the MegaBasic application The program must be saved to the PCM RAM Disk RAM as BASIC PGM After a soft reset the PCM automatically starts the MegaBasic program BASIC mode is not available in Release 2 of Logicmaster 90 70 software This mode is notsupported by PCM firmware version 2 04 or earlier BAS CCM BAS CCM modeissimilarto BASIC mode except that port 2 is configured for CCM execution and is therefore notavailable to the MegaBasic application program After a soft reset the PCM automatically starts the MegaBasic program along with CCM on port2 BAS CCM mode is not available in Release 2 of Logicmaster 90 70 software This modeis notsupported by PCM firmware version 2 04 or earlier NONE NONE is only used when the PCM do
375. sed All the keys pressed including the Enter key are collected and echoed to the screen as they are pressed You can delete and retype characters The INPUT1 and INPUT2 statements are similar to INPUT except that INPUT1 suppresses the Enter key echo and INPUT2 suppresses all character echoing and editing Because the INPUT statements wait forever if the Enter key is not pressed they should never be used in applications which need to perform other functions on a regular time schedule The MegaBasic INCHR function is recommended for these applications it can be programmed to time out when no input is typed It can also be programmed to return its input after a specified number of characters has been typed or when any one of a specified set of terminating characters is typed The NOWAIT IO functions developed for MegaBasic by GE Fanuc are also recommended These functions provide the capability for interrupt drivenI O from MegaBasic For information on these functions refer to chapter 5 section 9 COMMREQs and Other Backplane Messages Other MegaBasic I O statements and functions which are not recommended are INP INP and OUT These require direct access to the PCM serial hardware Using them can seriously interfere with the operation of higher level MegaBasic I O statements and functions as well as CCM which can operate simultaneously with MegaBasic Most program output is done with the MegaBasic PRINT statement It provides a large num
376. selects the PLC_FLT_TBL A string variable of length 12 containing the header information from the I O fault table This string is filled in as a result of a call to the READ_FAULT_TBL procedure that selects the default IO FLT TBL Astring variable of length 12 containing the data returned by ashort status request to the PLC CPU This variable is updated by every call to FLT PRESENTS or FLT CHANGEDS and may also be updated by a SYSREAD Astructure definition of the header records from either faulttable Astructure definition of the short status record Astructure definition of timestamp fields Astructure definition of the I O fault table records Astructure definition of the I O reference address field of theI Ofaultrecord Astructure definition of the I O fault address field of the I Ofaultrecord Astructure definition of the PLC fault table records Astructure definition of the PLC fault address field of the PLC faultrecord Constant Structure IO FLT TBL PLC FIT TBL PLC FAULT HDR IO FAULT HDR SHORT STATUS CLEAR TS 55 NUM CONTROL PROGS TS SEC IO FT IORA SEG IOFA RACK PLC FT PLCFA RACK These structures are predefined in READ FLT PGM Any field of these structures can be accessed by name for example IO FLT RECS I 42 42 10 FLT ADD IOFA RACKS Other examples can be found in PRN FLT PGM and TEST FLT PGM PRN FLT PGM shows the use of the structures defined in READ FLT PGM Refer to a
377. ser s Manual GFK 0582 Users who already use PCOE are comfortable with it and have existing User Configuration Data UCDF Files in their PCMs should continue to use PCOP UCDFs can be created and stored to the PCM only by using PCOP New users who are uncomfortable with the MS DOS command line interface in personal computers will often be more productive using PCOP Users who need the PCM command interpreter and file server active on serial port 2 during normal operation i e while MegaBasic is using serial port 1 can set this up only with PCOP Users of PCMs with firmware versions 2 04 and earlier must use PCOP to run MegaBasic These users should consider upgrading firmware as an alternative Contact the GE Fanuc PLC Technical Support Hotline at 1 800 GEFANUC for details If you decide to use PCOP please refer to the Series 90 PCM Development Software User s Manual GFK 0487 and skip section 4 TERMF Installation and Configuration of chapter 2 in this manual GFK 0255K Chapter 1 Introduction 1 15 Installing the PCM This chapter explains how to install a Programmable Coprocessor Module PCM in a Series 90 PLC system and how to install the necessary software There are several easy steps in preparing the PCM for CCM communication or developing and executing a MegaBasic program This chapter is divided into the sections listed below The necessary equipment and software packages required for the installation p
378. sic Program Packages 666666 666666666666660 660000002 4 11 Changing the MegaBasic Workspace 5226 e eee eee 4 11 Compacting and Encrypting Programs 2222200202 4 12 Section 2 Interfacing to the PCM Hardware and Series 90 CPU 4 13 Input and Output to the PCM Serial 5 777 4 14 Serial Port Control and Status 0 6 66 4 14 Accessing PIC Datanet msr cotta eate rete eee me AEE 4 15 SYSLINK hd eae ee d Ce Ros pha op ae RC Ge a a eO Coe 4 17 SYSREAD SYSWRITE and SYSTATUSS 212 5 ert erre Cr aree 4 20 Status Record 4d out ee ote OH e Pu tace a ted MCA as es wats 4 22 UNLINK Statement e be yes kr De re Hr E 4 24 Data Coh rency Mes rede ees 4 24 Accessing the PCM sLEDs 4 4 25 Section 3 MegaBasic Programming Examples 4 26 Chapter 5 Advanced MegaBasic Programming 6666666666666 66666666662 5 1 Section 1 MegaBasic Error Codes 225 5 5 3 Section 2 Screen Formatting Commands 6 5 5 SI ELI 5 8 CURG e unte ete une egeo UM cen d ndr ater uie ted unde iae 5 9 0 ERN E AV d Audet 5 10 PRD cu siue EE IE E M EE E EU tabes 5 11 ALIB get unes wok ie aed costs seed ui elato d ene d 5 2 224 4 4 ones ROC d o ned 5 3 MV CUR 9 5 5 15 GFK 0
379. since each variable is transferred only once every 100 milliseconds the MegaBasic program can be spend most of its time on other processing In either case the SCALE DISPLAY and SEND ALARM procedures are identical to the procedures in the previous example and are called with the same arguments Chapter 5 Advanced MegaBasic Programming 5 63 GFK 0255K COMMREQs and Other Backplane Messages The previous section describes processing of data sent by the PLC CPU in response to SYSREAD and SYSWRITE statements It is also possible for MegaBasic programs to receive unexpected messages from the CPU or elsewhere in the PLC These messages can be messages from COMMREO function blocks in the PLC program responses to request messages sent to the CPU for example by the GENERIC PGM package or messages from another PCM Since they reach the PCM on the PLC backplane they are referred to in this section as backplanemessages Section 9 PROCESS MESSAGEStatement When backplane messages arrive the PCM stores them in a temporary holding queue MegaBasic programs must use the PROCESS MESSAGE statement to move them into MegaBasic variables The format of the PROCESS MESSAGE statement is PROCESS MESSAGE header string lt message string gt The PROCESS MESSAGE arguments are described in the following table Field Description This parameter must contain the name of a string variable which has been dimensioned to at least 32 bytes Executing
380. single items or arrays Arrays containing up to 64K bytes of contiguous PLC data may be transferred using a single MegaBasic statement At least 256 bytes of large arrays are transferred during each PLC execution sweep Data transfers between the PLC CPU and a PCM are most efficient when they contain 256 bytes orless PLC data which is accessed by PCM programs should be collected into contiguous groups when the PLC program is developed There is a PLC status variable called SSTAT which may be read by the PCM Through this status variable the PCM can find out information about the PLC state sweep time and various other status information The SSTAT variable is described in chapter 5 Advanced MegaBasic Programming PLC nicknames are not directly accessible from the PCM Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 16 SYSLINK The SYSLINK statement is used to identify variables located in the PLC CPU SYSLINK tells the PCM to establish a link with the CPU allowing the PCM to access user reference data in the CPU Before any PLC data can be read or written by the PCM it must be SYSLINKed The SYSLINK statement has the form SYSLINK local name cpu symbol type handle Argument Description LocalName This argument contrains the name of the MegaBasic variable to be associated with the PLC data The MegaBasic variable must be defined in the MegaBasic prog
381. sor movement commands that may be printed at a later time i e a relocatable section of a screen display The direction is one of C UB C DN C RT or C LE which are the cursor up down right and left direction constants MV CUR A statement that takes direction and count parameters and prints the appropriate relative cursor movement control string See MV CUR function above The row and column parameters are optional The default row is the top row row 1 and the default column is the leftmost column column 1 Thelist of parameters is completely optional The default SGR string produced when no parameters are supplied results in turning all screen attributes off 3 The direction and count parameters are optional The default direction is C UP and the default count is one location Several integer and string constants are also defined in the VT100 PGM package These constants are summarized in the following table 5 6 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 7 Table 5 3 Integer and String Constants Description Aninteger constant 0 used in the ATTR function or ATTR statement parameter list to indicate that all existing screen display attributes are to be reset Typically this is the first parameter in a sequence that also sets one or more attributes When simply turning off all attributes itis recommended that you use the ATTR function o
382. space for operating system data If the specified value is too small or exceeds the total amount of memory on the PCM this error message Insufficient memory is returned If the command is entered with no argument the operating system uses all the RAM on the PCM and the GET MEM LIM utility will indicate that no limit has been set When a limitis set it does not actually take effect until the PCM is reset GFK 0255K Appendix C PCM Commands C 17 PCM Batch Files The PCM supports batch files which are superficially similar to those used with MS DOS You can specify a batch file to be executed interactively In addition you can create batch files which are executed automatically when power is applied or a soft reset occurs or when a hard reset occurs These files must be named PCMEXEC BAT and HARDEXEC BAT respectively Note Your PCM must have firmware version 2 50 or greater in order to use PCM batch files PCM batch files may consist of any number of commands All the commands described in appendix C PCM Commands may be used in batch files Unlike MS DOS there are no commands such as IE ECHO or GOTO which work only in batch files When using PCM commands in batch files for PCMs with firmware release 2 51 or earlier the command letter must be upper case You can avoid batch file errors by using uppercase characters exclusively in PCM batch files Appendix D Running Batch Files Suppose you want to create a si
383. ss memory for the RAM Disk which only needs to hold the program and use the remainder of PCM memory for MegaBasic workspace If your PCM has firmware version 2 50 or greater you may change the workspace size for MegaBasic in a PCMEXEC BAT file See appendix D PCM Batch Files for information on PCM batch files See appendix C PCM Commands for information on using the D option ofthe R Run command to assign a workspace size The MegaBasic workspace size can also be changed using the PCM development software PCOP Refer to the Series 90 PCM Development Software PCOP User s Manual GFK 0487 for information on using PCOP to allocate PCM memory GFK 0255K Chapter 4 MegaBasic 4 11 Compacting and Encrypting Programs CRUNCH EXE is a program compaction utility It is supplied with both TERMF and PCOP software It is installed in the NPCOPNUTILS directory on the PC hard disk for TERMF and in the PCOP directory for PCOP The program is run from the MS DOS prompt to process programs in PC files It removes comments and extra spaces including indentation from programs CRUNCHed programs can be LISTed and modified but they are far less readable than unCRUNCHed programs CRUNCH is useful for squeezing large applications into PCM memory Fully commented programs with indentation are often more than twice as large as their CRUNCHed versions During development you can save the unCRUNCHed version of your application to your PC and keep only the
384. sses Table 3 8 Target Source Memory Addresses 1 Register Specified the register with which the data 1 Maximum Units transfer is to begin 2 Input Table Specifies the input or output point with which 1 Maximum Units 3 Output Table the data transfer is to begin Source memory address must be ona byte boundary i e 1 9 17 6 CCMScratch Pad Specifies the scratch pad byte with which the 0 255 Memory data transfer is to begin 9 CCMDiagnostic Specifies the diagnostic status word with 1 20 Status Words which the data transfer is to begin 13 Bit Set Input Specifies the input or output point to be set 1 Maximum Units 14 Bit Set Output 17 Bit Clear Input Specifies the input or output point to be 1 Maximum Units 18 BitClearOutput cleared 1 The maximum addressable ranges for each memory type depends on the model of CPU and memory configuration 2 ForI Oreferences the Series 90 and Series Six CCM implementations use point oriented addressing rather than the byte oriented addressing of the Series One Three and Five PLCs The starting address is interpreted by the Series 90 PLC as the bit number at which the transfer is to begin Series 90 source memory addresses must be on a byte boundary See the examples that follow Software packages which use the byte oriented addressing method to interface with a Series One Three or Five PLC may need to be modified for the Series 90 PLC 3 Scratch pad and diagnostic status words are
385. st significant byte on the left ck ck ck ko k ko ko ko proc PRINT MSG 5 9 Local Rem Position in current line Local J Rem Starting char position in MSG of current line Local M LEN Rem Chars from MSG left to print Local L LEN Rem Length of current line Local CODE Rem Current ASCII code in MSG M LENS len MSGS f LEN 0 then Print PRINT MSG error length string Else L LEN 16 0 0 While M LEN lt 0 If L LEN gt M LEN then L L For I 1 to 2 LEN Print asc MSGS I J Next I For I L LENS 1 to 16 i Next I Print fn For 1 1 to L LEN CODE asc MSG I J f CODES gt 880 or CODES gt asc then Print Else Print chr CODE Next Print M LE Next Print Rem Rem Rem Rem Rem Rem Rem Def 1 Return 600 Proc end Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 540 550 560 570 580 590 5 90 Section 10 Asynchronous Serial Input and Output Most of the MegaBasic statements and functions for reading and writing devices cause the MegaBasic program to wait until the input or output has completed During this time all Mega
386. stack for the task which was executing at the time and the top 32 words of all other tasks The PD command causes the PCM to write this information to a binary file called PCMDUMP OUT on the PC default directory This data can be formatted as text with the PCMDUMP EXE utility or the MegaBasic program PCMDUMP 2314 The information is useful when the PCM resets or locks up unexpectedly PL Show the PCM rack slotlocation The PCM returns two ASCII digits The first digitspecifies therack number and the second digit specifies the slot number The ASCII digits may be followed by a string that contains the CPU ID If the PLC CPU does not have an ID no string is returned If the PCM cannot establish communication with the CPU the message NO CPU is sent PM Show the type and mode of the most recent PCM reset The PCM returns two ASCII digits The first digit specifies the type of the most recent PCM reset 0 Powerup reset 1 Soft reset 2 Hard reset 3 ACFAILreset 4 Reset caused by receipt of new soft switch data 5 Internal software error reset 6 Backplane COMMREO reset The second digit specifies the type of configuration data used during the most recent reset 0 User configuration data 1 Factory default configuration data 2 Logicmaster 90 configuration 3 A combination of Logicmaster 90 and factory default data PT Show the status of PCM tasks For each active task the PCM returns the task number and
387. stant sweep mode of the PLC status word is checked and an appropriate message reflecting the current state of the constant sweep mode is printed Note that the div 2 part of the If statement eliminates bits below the constant sweep mode bit and the mod 2 part eliminates bits above leaving a logical value that is only the contents of the constant sweep mode bit Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 5 40 READ PLC TIME AND DATE The READ PLC TIME AND DATE procedure obtains the PLC time and date in a form that is ready to print The time is supplied in the PLC TIME string variable and the date is supplied in the PLC DATE string variable As with the previous procedure there are two optional parameters for the READ PLC TIME AND DATE procedure The first parameter specifies the mode that the procedure is to operate in wait mode is the default and NOWAIT mode is optional When NOWAIT mode is active the PLC TIME AND DATE VALID integer flag variable is used to determine when the time and date has been read updated Also in NOWAIT mode a second parameter can specify the minimum delay between repeats of the READ PLC TIME AND DATE information Omitting the second parameter results in a single read of the time and date as well as turning off any previous repetitive read operation for the time and date When the delay time is specified as something other than 0 0 as
388. tain the following information Field Description CLEAR TS Asix byte field containing the time stamp when the fault table was last cleared Refer to the discussion below of time stamp subrecords for a definition of this field A two byte integer WORD field containing a count of the number of faults that have occurred since the last time the fault table FLTS SINCE CLEAR wascleared NUM FLITS A two byte integer WORD field containing a count of fault records presently in the fault table NUM READ A two byte integer WORD field containing a count of the actual number of fault records returned as a result of the READ FAULT TBL call PLC Fault Table Records When requesting a non zero number of fault records from the PLC fault table you may receive one or more PLC fault records The actual number of records returned may be determined from the NUM READS field of the PLC FAULT HDR record described above Each PLC fault record consists of 42 bytes with the following format Field Description PLC FT Aone byte flag indicating the type of fault record and how much of the PLC FLT SPEC field is valid data The codes used for this field are 0 Faultrecord is a PLC fault record only the first 8bytesof PLC FLT SPEC data are valid 1 Faultrecord is a PLC fault record all 24 bytes of PLC FLT SPECS data are valid Spare reseved Three bytes PLC_FLT_ADD A four byte field containing the address of the modul
389. tation of GENERIC PGM and GEN TEST PGM These files are installed with TERMF in the PCOP or PCOP EXAMPLES PCM directory of your PC hard disk depending on which release of PCOP or TERMF you use To use the functions in GENERIC PGM add the line xxx Access RAM generic pgni at the beginning of a MegaBasic program The file GENERIC PGM should be loaded to the PCM RAM Disk before running a MegaBasic program which accesses it The procedures found in GENERIC PGM are listed in the following table Procedure Description CHG PRIV Change the current privilegelevel for MegaBasic communication with the PLC SMSG_WTEXT Format and send a message to the PLC Several shared structures and constants are also defined in GENERIC PGM These include Constant Structure Description SMSG_TEXT The string used with SMSG_WTEXT which contains the program and block names ACC_CODES A string containing the access codes for various PLC reference data types R_TMEM Definition of request code to read task memory P R_PBMEM Definition of request code to read program subblock memory L W_TMEM Definition of request code to write task memory P W_PBMEM Definition of request code to write program sub block memory L 5 16 Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K CHG PRIV CHG PRIV isused to change the privilege level for communication between
390. tatus LEDs Soft configuration no dip switches or jumpers for most users Occupies a single slot in the Series 90 30 I O rack Memory on the Series 90 30 PCM consists of PROM and local RAM PROM contains the operating system the CCM protocol a built in MegaBasic interpreter and related utilities Local RAM is divided into two data areas one for PCM internal use and the remainder for the user s data and programs 90 30 RACK Bree SERIAL LOGIC RACK CONNECTOR st BACKPLANE SERIAL SERIAL CONTROLLER CONTROLLER N t 1 N PORT PORT PCMOKLED O ONE TWO USER 1 LED o 49 USER 2 LED o MICROPROCESSOR RESET NMI RS 232 485 SEL 1 PB OF gt 1 SYSTEM PROM LOCAL RAM 256K X8 192K X 8 VARIES VARIES pg dvo di LOCAL BUS Figure 1 4 Series 90 30 PCM Hardware Block Diagram GFK 0255K Chapter 1 Introduction 1 11 GFK 0255K Two serial ports are provided for communication with a programming terminal CRIs bar code readers and other devices These ports are identical in function and support 15 232 and or 145 485 RS 422 operation through software configuration On the Series 90 30 PCM connections to both ports are made through a single 25 pin D type connector A WYE cable is supplied with each PCM module This cable is 1 foot in length and has a ri
391. ted When CONFIGINVALID is indicated the configuration may not be stored to the PLC A CONFIGINVALID status is most likely to occur when Aslot ina Series 90 70 rack to the left of a module that generates interrupts such as the PCM is vacant Input reference addresses I and AI overlap Bus Transmitter and or Receiver Modules in a multi rack Series 90 70 PLC are missing ASeries 90 70 Version A BTM module is not located to the right of all other modules GFK 0255K Chapter 2 Installing the PCM 2 7 Adding a PCM to the Rack Screen A PCM must first be entered before its memory expansion board may be selected To do this follow these steps 1 Press Other F8 and then PCM F1 from the I O Rack Configuration screen rack l l l E orca 7339991 ONU 01733 7231 o 2 SERIES 90 70 MODULE IN RACK 71 SOFTWARE CONFIGURATION Catalog CATALOG DESCRIPTION 1 IC697PCM711 PROGRAMMABLE COPROCESSOR MDL PCN lt lt CURSOR TO THE DESIRED CATALOG NUMBER AND PRESS THE ENTER KEY gt gt gt gt PRESS PGDN KEY FOR NEXT PAGE PGUP KEY FOR PREVIOUS PAGE gt gt D NLHSONLESSUN ig ONFIG VALID 2 Press the Enter key to enter the catalog number shown in reverse video and display the PCM detail screen rack i l l l l E orca 73992931 ONE 01733 o o 2 SERIES 90 70 MODULE IN RACK g SLOT SOFTWARE CONFIGURATION Catalog IWE
392. ted line that occurs at the end when the length of MSG is not an exact multiple of the linelength Line 1430 prints the hexadecimal values for each line Line 1440 pads the short line if any with enough spaces to make it as long as the preceding lines Line 1450 prints some spaces and the single quote which introduces the ASCII characters The For Loop in lines 1460 1530 prints either a character if it is printable or a dot if not Line 1540 prints a trailing single quote and ends the printed line Line 1550 adjusts the count of characters left to print and the position in MSG of the first character on the nextline Then the While Loop exits if all the characters have been printed otherwise it continues The main program uses separate message header and text strings for messages to be sent on the PLC backplane and messages received from the PLC backplane They are dimensioned in lines 70 100 Separate strings are necessary to prevent scrambled messages that would occur if one backplane message arrived while the main program was getting ready to send another one Programs which send a lot of messages sometimes need to identify them easily The SEND UNSOLICITED MSG procedure can add a serial number to the messages it sends This MegaBasic fragment shows how 1152 SERIAL NUM SERIAL NUM 1 1154 If SERIAL NUM 256 then SERIAL NUM 1156 MSG 7 chr SERIAL NUM GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 87 GFK 0255K
393. ted with different COMMREQs in order to avoid the possibility of two outstanding COMMREQs writing to the same location A single status word location should never be used for more than one COMMREO unless they are all WAIT mode requests Follow these guidelines for programming the status word 1 CCM never returns zero for the status word If the user program needs to know that the command is complete it can zero the status word before issuing the COMMREO and then check the status word for a non zero value 2 CCM uses a status code value of 1 to indicate that the operation was completed without errors 3 Display the status word in hexadecimal format to read the two bytes of data When an error occurs the least significant byte is greater than 1 Refer to section 5 of this chapter for a complete list of secondary error codes for CCM 3 18 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Section 4 CCM COMMREQ Data Block Data blocks for CCM on the PCM are similar to the command registers used by the Series Six CCM modules The first word of the data block must be a command word in the range 6000 to 6199 decimal Description Usedfor general utility type functions involving only local data storage on the PCM These commands may be used in all CCM modes MASTER SLAVE PEER NON INITIATOR and PEER INITIATOR Used for operations that require initiating serial communication
394. ternal device Configuration of the port parameters is done in the Logicmaster 90 configuration package using CCM mode In SLAVE or PEER mode an external CCM device such as a computer can request and send PLC CPU data to the PCM s ports In MASTER or PEER mode the application program in the PLC CPU can use the COMMREO instruction to initiate data transfers to a CCM device attached to a PCM port MegaBasic Operation Asa programmable coprocessor the PCM may be programmed with a powerful BASIC language interpreter called MegaBasic to perform data acquisition data storage and retrieval real time computing and operator interface functions GE Fanuc has added extensions to MegaBasic to permit the reading and writing of user references in the PLC These extensions also access program and system status information permitting the development of operator interface programs to control and monitor processes MegaBasic programs may be developed off line using a standard text editor on a personal computer or on line with a terminal attached to the PCM programming port A separate version of the MegaBasic interpreter also allows programs to be developed off line in the MS DOS environment The MS DOS version however does not support the PCM extensions to MegaBasic A MegaBasic program must be loaded to PCM RAM prior to being run on the PCM If the program is saved to the PCM RAM Disk RAM the PCM can be configured so that the MegaBasic program is
395. the PCM MegabBasic task and the PLC CPU Service Request Processor SRP For more information on privilege levels and passwords refer to the Series 90 70 Programmable Controller Installation Manual GFK 0262 and the Logicmaster 90 70 Programming Software User s Manual GFK 0263 The format for using the 086 PRIV procedure is xxx CHG PRIV n str Parameter Description Therequested privilege level str An optional string variable containing the password for that level In the following example 3 is the requested privilege level and ABCD is the password for that level 150 CHG_PRIV 3 ABCD No password is supplied in the next example 200 CHG_PRIV 2 In either case an ACK NACK message is returned from the Service Request Processor SRP to the MegaBasic task indicating a grant or refusal to grant the requested privilege level The returned message may be obtained by the MegaBasic program through the use of the PCM extension PROCESS_MESSAGE procedure either through a MegaBasic interrupt or through periodic use of the PROCESS_MESSAGE statement Section 8 of this chapter contains a sample program which uses a MegaBasic interrupt to determine whether the CHG PRIV command succeeded The GEN TEST PGM package provided with TERME also contains an example using the PROCESS MESSAGE statement Note When CHG PRIV fails because an invalid password was provided a Password access failed fault is logged to the PLC fault t
396. the ones for the gt outchn1 option Redirectstandard error output to the channel specified by errchnl Choices are identical to the ones for the gt outchn1 option Use a stack size of xxxx hexadecimal bytes 400 is the default Allocatexxxxhexadecimal bytes of data space to the task The balance is reserved for RAM Disk or other tasks Specify the executable task type the defaultis 1 priority based For PCM version 3 00 or later a 2 time slice optionisalso available Use a specified task ID value in the range 4 OF hexadecimal by default the lowest unused value Release 2 51 and earlier PCMs limit the task number toa range of 4 7 Allocate an execution time slice of xx hexadecimalmilliseconds Timeslice options only apply to release 3 00 or later PCMs Link the task to memory module name may occur multiple times Run the task in background mode Note If the task and the PCM command interpreter share a serial port the command interpreter remains active and may interfere with the task Keep the task s environment block in memory after task termination Option gt outchnl lt inchnl errchnl Sxxxx Dxxxx Ex Ix Txx Mname B K Defaultselection The default selection is whatever port is being used by the command interpreter normally this is COM1 Allstrings in the command line which do not begin with the special characters lt or are assumed to be command line d
397. till encounter communications problems between PCOP or TERMF and the PCM the problem may be with PCOP or TERME Press CTRL BREAK to return to MS DOS If this does not work press CTRL AIT DELETE to reboot the programmer Then start up the PCOP or TERMF software again If PCOP still does not go online or TERMF problems remain a configuration mismatch probably exists between the PC and the PCM see above MegaBasic Application Appears Not to Run Refer to the errors described under the headings Backplane Transfer Failure Insufficient Memory MegaBasic Data Size and Soft Reset An error may not be reported when the program is started on a soft reset PLC Fault Table Entries 1 Ifthe PLC fault table indicates that the PCM has been lost e g loss of module check the PCM OK LED If itis not lit refer to the steps described in the beginning of this chapter If the problem continues it may be an application programming error setting the PCM watchdog timer off 2 Ifthe PLC fault table indicates that the rack and slot containing the PCM has an Addition of module fault the PCM has not been properly configured for that slot Check the Logicmaster 90 configuration and location of the PCM 3 Ifthe PLC fault table has any other fault for the PCM rack and slot such as one of the COMMREO faults the problem is related to your application 4 The PLC fault entry Unsupported feature in configuration indicates the PCM
398. tion file are missing or if errors are encountered while initializing the new configuration the PCM is placed in its factory default configuration The configuration file argument must be either FDEF factory or UCDF user UDCF configuration data is stored only by PCOP Any other file name results in one of these error messages Module not found file name Illegal module type file name Verify a file Format V file name This command causes the PCM to verify the checksum of the specified file on the PCM RAM Disk The file must have checksum protection If the checksum calculated for the file matches the checksum stored in it the PCM returns just the prompt If the checksums do not match the PCM prints an invalid file error code followed by the prompt The Q command is used to enable and disable checksum protection for files Appendix C PCM Commands C 15 S U V GFK 0255K Format W lt time gt This command causes PCM command interpreter to wait for the specified time in seconds before initiating or responding to any activity on the serial ports After the specified time the PCM prints the gt prompt or executes the next command in the BAT file This command is provided to allow tasks running in background mode to access the PC file server Since the PCM command interpreter and file server usually share the same serial port the command interpreter has to be kept from using the port while th
399. tion messages have on PLC sweep time or backplane message rates If these issues are more important than time of day accuracy use this option Default synchronization enabled Examples I COMI 9600 S I 0082 4 561165 90 Programmable Coprocessor Moduleand Support Software User s Manual November 9 GFK 0255K The first example sets the port 1 data rate to 9 600 baud and selects software flow control Selections for parity data bits and stop bits are the omitted items between the four consecutive commas they are unchanged The second example sets port 2 for RS 485 two wire half duplex operation at 38 400 baud odd parity 8 data bits and one stop bit using software flow control a ten millisecond time delay and a 1024 character typeahead buffer I CPU 45 PASSWD I CPU 45 MYPASWD N I CPU 45 The third example sets the PCM privilege to the access level protected by the password PASSWD The fourth example sets the PCM privilege to the access level protected by MYPASWD and also disables PCM clock synchronization The last example re enables PCM clock synchronization but has no effect on PLC access level J format EEROM device Format J ROM This command causes an electrically erasable ROM EEROM device installed in a PCM 301 to be erased and formatted as the file device ROM Once the EEROM has been formatted files can be loaded to and run from it just as they are in RAM Note that only the
400. ttery cable from the connector on the circuit board and then short the two pins on the circuit board connector This clears PCM memory Reconnect the battery and turn the power on again Initiate a hard reset by pressing the Restart Reset pushbutton continuously for 10 seconds Check to see if the light goes on Also check to see if PCOP or TERMF is communicating with the PCM 4 Ifthe BD OK LED still is not lit and PCOP or TERMF does not respond or go online the board may need to be returned for repair Check the PLC fault table for a Bad or missing module fault If there is a fault return the board for repair If there is no fault contact the GE Fanuc Hotline for assistance Reset Blinks User LED1 or LED2 If the User LEDs on the PCM blink alternating between LED1 and LED2 each time the Restart Reset pushbutton is pressed the PCM has not completed its power up diagnostics This condition occurs when the PLC CPU firmware or Logicmaster 90 software used to configure the PLC is out of date with respect to the PCM The model number of the PCM is not recognized by the PLC or Logicmaster 90 configuration data Upgrade both the PLC CPU firmware and Logicmaster 90 software If both the PLC CPU and Logicmaster 90 software are up to date and the User LEDs on the PCM continue to blink the PCM is at fault and should be returned for repair GFK 0255K L5 Communication Failure General Verify that both the PCM and the programmer are usin
401. tus information and returns the fault table changed boolean from the PLC status word for either fault table WORD _ A function that converts the first two bytes of a string to an integer Although some Series 90 PLC services require the requester to be a programmer i e a device authorized to change the PLC program none of the procedures or functions in this section requires it As a result there is no interference between these functions or procedures and Logicmaster 90 software except that the use of RDEL FAULT TBL will cause faults to disappear from the Logicmaster 90 fault table displays and the Logicmaster 90 clear fault table function may cause the MegaBasic program to miss faults Chapter 5 Advanced MegaBasic Programming 5 21 GFK 0255K Several shared structure definitions and constants are also defined in READ FLT PGM These include Table 5 6 READ FLT PGM Shared Definitions and Constants Description Aconstant 1 used to indicate the selection of the I O fault table in the above functions and procedures These functions and procedures default to the I O fault table when the table selection parameter is omitted A constant 2 used to indicate the selection of the PLC fault table in the above functions and procedures A string variable of length 12 containing the header information from the PLC fault table This string is filled in as a result of a call to the READ FAULT TBL procedure that explicitly
402. two font files of 256 characters each The font sizes in the two files must be the same Value Video Adapter Type Display Page Length DisplayControl Sequences Normal Display Video Mode Display Long Lines Character Font Defaultselection GFK 0255K Chapter 2 Installing the PCM When all the display settings are correct return to the main menu by typing N or any key except Y at the prompt that asks whether you want to change the settings Then type E to save the changes and exit from TERMSET If you do not want to save the new settings type Q In addition to the settings previously described some custom configuration options are available from the TERMSET main menu These options are seldom if ever used with TERMF or PCOP They are included here to help you configure TERMF as a general purpose terminal emulation program for use with serial devices other than the PCM These options are explained in the remainder of this section 5 Item 3 in the TERMSET main menu selects a screen that describes the keyboard input queue special key handling multi character transmission delay size of the received character buffer key assignments for exiting from TERMF and for sending a break from the serial port and the delay count which determines the length of the break To change any of these parameters type Y A short explanation of each parameter is given below Value Description KeyboardInput Options include Queue
403. ually causes the physical LED state to change Chapter 4 MegaBasic 4 25 Section 3 MegaBasic Programming Examples There are two examples in this section one showing the steps to develop a simple MegaBasic program and the second showing how to get the example program SAMPLE PGM running on the PCM These examples assume the PCM has been configured using Logicmaster 90 for BASIC mode or by PCOP for BASIC operation Program development is begun by connecting the programming cable from the programmer to the PCM setting the default directory to PCOP EXAMPLES PCM and typing TERMF to start up the TERMF terminal emulation program Then press the PCM Restart Reset pushbutton for 10 seconds to place the PCM in PROGRAM mode The MegaBasic banner is displayed on the screen followed by the Ready prompt MegaBasic Version 5 602 under PCM VTOS v2 50 IEEE Software floating point on an 80186 88 CPU Copyright C 1985 1990 by Christopher Cochran MegaBasic Support BBS 415 459 0896 PO Box 723 Fairfax CA USA 94930 Serial 0000 Ready Now enter the single line of the program shown below After typing the line save the program to the RAM Disk as BASIC PGM using the SAVE command Answer Y to the program creation prompt Ready 10 print hello world Ready save basic pgm RAM BASIC PGM file not found create it y 2 lines 20 code bytes Ready When a soft reset is initiated the MegaBasic banner is displayed and the
404. using PROCESS READ Def Proc USER NOWAIT RD Local VBLPTR HANDLE ERR Repeat PROCESS READ 178212185 HANDLE S ERR If 17812185 0 then Return If ERR then PROCESS ERR ERR Rem Process data Next Proc end Beginning with PCM firmware version 3 00 NOWAIT READ operations on COMI and 001 12 may be terminated by receipt of a specific character This is done using a slightly different NOWAIT OPEN for the COM port For example I NOWAIT OPEN COM1 13 6 DIM 25 20 NOWAIT_READ I A This NOWAIT_READ will complete if a lt CR gt CHR 13 is received or when twenty characters are received The termination character is placed into the string before the string is returned to the MegaBasic program The current length of the string will reflect the actual number of characters received Serial Port Error Codes Returned by PROCESS READ When a serial port error occurs ina PROCESS READ statement the variable specified by the Error argument will contain a non zero value This value will consist of one two or three bits OR ed together Code Status 10H Parity error 20H Overrun error 40H Framing error Note These codes are different than the ones listed in section 1 of this chapter which apply to the MegaBasic INCHR function The PROCESS ERR procedure called in line 530 of the example above is not shown The specific actions required to recover from serial port errors will depend on the application Chapter
405. uts at a time The user can change the value of Rem an output or display a different group of outputs No error Rem checking is done and the display freezes while the operator Rem is entering data Rem Def proc DO OUTPUT MENU Rem Local BASE OUTPUT Rem Sets which inputs to display Local WRITE OUTPUT Rem Used for writing to PLC Local OUTPUT DATAS Rem Used for writing to PLC Local I Rem General purpose loop counter Local CMD LINES Rem Used to write command line Local CLR CMD 155 Rem Used to clear command line Dim integer OUTPUT ARRAY 7 Rem Used for reading PLC Rem Rem The following few lines draw the static part of the input Rem menu screen using the same format as the main menu Rem CLS ATTR CUR 4 8 Print 45 DW DH TOPS Print 5 OUTPUT TABLE DISPLAY CUR 5 10 int 45 DW DH BOTS int 5 OUTPUT TABLE DISPLAY R 20 int DISPLAY NEW SET OF OUTPUTS UR 21 rint WRITE AN OUTPUT UR 22 rint 5 3 EXIT TO MAIN MENU CUR 24 24 ATTR BLINK Print 5 ENTER NUMBER ATTR Rem Build some strings for handling the command line Rem LINES ATTRS BLINK 4 ENTER NUMBER ATTRS ATTR_OFF CLR LINES CURS 24 24 32 CUR 24 24 6 6 0 GFK 0255K Chapter 4 MegaBasic 4 33 GFK 0255K Rem SYSLINK the OUTPUT ARRAY variable with 501 in the PLC Rem The SYSREAD command below will then copy
406. ve on a particular channel Typically a NOWAIT_WRITE_ABORT would be used to flush output upon receipt of a break or upon detection of a loss of connection no DCD CTS TRUE status If interrupts are being used for the NOWAIT_WR handling an interrupt will be generated to signal the completion of the NOWAIT_WRITE The error field of the PROCESS WRITE statement will indicate that the write was aborted The format of a NOWAIT_WRITE_ABORT is NOWAIT_WRITE_ABORT lt channel handle gt All NOWAIT_WRITE operations active on the channel will be aborted by this statement GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 97 Example NOWAIT Program The following example program illustrates the use of NOWAIT statements for serial I O Rem Program to exercise NOWAIT functions of MegaBasic for serial Rem input and output Access ram vt100 pgm Dim TEXT STRIS 80 Dim TEXT STR2 80 Dim TEXT 51239 80 Def integer HANDLE1 Def integer HANDLE2 Def integer HANDLE3 nterrupt NOWAIT RD end nterrupt NOWAIT WR end nterrupt NOWAIT RD READ INT nterrupt NOWAIT WR WRITE I nterrupt on HANDLE1 OWAIT_OPEN COM HANDLE2 OWAIT_OPEN COM HANDLE3 OWAIT_OPEN COM Len TEXT STR1 5 Len TEXT STR2 5 Len TEXT STR3 5 OWAIT READ HANDLE1 TEXT STRI1 OWAIT READ HANDLE1 TEXT STR2 OWAIT READ HANDLE1 TEXT STR3 CLS Rem Enter non terminating loop Repeat ext Def proc
407. wait for a reply This mode of operation is referred to as WAIT mode The maximum length of time the PLC will wait for CCM to respond is specified in the command block of the COMMREQ If CCM does not respond within that time program execution resumes If the COMMREO command block specifies that the PLC program should not wait for a reply a CCM command is sent and program execution resumes immediately The timeout values for the command block are ignored This mode is referred to as NOWAIT mode Caution NOWAIT mode should always be used Otherwise the time spent waiting for CCM communication will significantly degrade PLC sweep time If WAIT mode is used the sum of the maximum PLC sweep time plus the longer of the two COMMREO timeout values must be no larger than the PLC watchdog timer setting Information on the two COMMREO timeout values is presented later in this section 3 12 Series90 Programmable Coprocessor Moduleand Support Software User s Manual November 1999 GFK 0255K Format of the COMMREQ Function Block The COMMREO function block has four inputs which specify the command block location in PLC memory and the identity of CCM A fault output indicates errors The Series 90 70 COMMREO function block also has an OK output the Series 90 30 COMMREO does not enable RE ox Series 90 70 only REQ 2 7 72 7 7 77 7 Specifies the memory location of the command block It may be any word oriented user reference
408. will result in an Unsupported feature in configuration fault for the PCM in the PLC fault table When BAS CCM mode is selected the PCM automatically runs a MegaBasic program named BASIC PGM if itexists on port 1 and CCM on port 2 When this mode is selected in the Logicmaster 90 software the following PCM detail screen is displayed l l l E OC OST PROGRAMMABLE COPROCESSOR MDL es 1 gt SERIES 90 70 MODULE IN RACK 1 SOFTWARE CONFIGURATION Catalog 8 1 HELP ALT H for Serial Port Restrictions CCM YES SLAVE 2 19200 NONE ODD NORMAL LONG NONE 1 Port 2 CCM Enable CCM Mode Interface Data Rate Flow Contrl Parity Retry Count Tineout Turn Delay CPU ID ONFIG VALID Conf ig Mode Port 1 BASIC Interface RS232 Data Rate 0 Flow Contrl HARDWARE Parity NONE Stop Bits 1 Bits Char 8 D D 17190155101 igi REPLACE The configuration mode is set to BAS CCM The remainder of configurable parameters are as described previously for BASIC mode on port 1 and CCM mode on port 2 2 13 Chapter 2 Installing the PCM PCM CFG and NONE Modes When PCM CFG or NONE mode is selected in Logicmaster 90 software there are no other parameters on the detail screen to be set These modes require configuration data stored in the PCM Either a PCMEXEC BAT file or User Configuration Data UCDF may be used For information PCMEXEC
409. with the PLC In some applications it is possible that when the BKP_MSG interrupt is installed by the MegaBasic program incoming messages have already arrived and are waiting to be processed The backplane interface allows up to sixteen incoming messages to be pending Additional incoming messages are rejected by the PCM and logged as faults in the PLC fault table To process any incoming messages that may have arrived before the BKP_MSG interrupt was installed the MegaBasic program should call the BKP MSG interrupt procedure as soon as it is installed and any other necessary data structures are initialized Alternatively the program could simply flush out the old messages as shown in the following message Interrupt BKP MSG end Interrupt BKP MSG USER INT PROC Interrupt BKP MSG on Repeat PROCESS MESSAGE MSG HEADERS MSG STRINGS If MSG HEADER Then exit Next When the BKP XFER interrupt occurs any data read from the PLC is in a temporary buffer and has not been copied into its associated MegaBasic variable In addition the status information for the variable has not yet been updated To complete the transfer the BKP XFER interrupt procedure must use the PROCESS XFER statement PROCESS XFER pointer handle Argument Description Pointer A MegaBasic integer variable which when PROCESS XFER completes contains a pointer to the variable that was transferred Additionalinformation can be found by passing th
410. y If there are two or more PCMs ina Series 90 30 system or if a PCM shares a system with other intelligent modules The queue cam fill up even more quickly When the queue is full the PCM allocates a buffer in memory for each additional message Eventually the PCM may run out of free memory Messages from the CPU to the PCM including both responses to PCM messages and the messages sent by PLC COMMREO function blocks are generally processed immediately by the PCM The handling of repeated SYSREAD and SYSWRITE requests works as described above for the Series 90 70 PCM see Repeated Transfers GFK 0255K Chapter 5 Advanced MegaBasic Programming 5 115 Chapter Troubleshooting Guide 6 This chapter provides procedures for diagnosing PCM operational problems If the procedure given does not lead to a diagnosis or if a problem is encountered that is not covered here contact the GE Fanuc Series 90 Hotline 1 800 GEFANUC for assistance OK LED Not On 1 Confirm that power is being supplied to the I O rack containing the PCM Verify that the PLC CPU BD OK LED is on Reseat the PCM in the rack 2 Turn the power off and then back on Initiate a hard reset of the PCM by pressing the Restart Reset pushbutton continuously for 10 seconds Connect PCOP or TERME Ifthe Ready prompt is displayed TERMF or the PCOP screen indicates that it is online the PCM BD OK LED is burned out 3 Turn the power off again disconnect the ba
411. y To display the current directory for an attached PC type DIR SPO Finally when using the PCM version of MegaBasic device names must include a colon For example to open the second serial port type OPEN 5 COM2 The colon is optional with the MS DOS version Modifying Existing BASIC Programs for MegaBasic It is possible to load many programs developed for other BASICs directly into MegaBasic Using either the CHECK or RUN command will cause the MegaBasic interpreter to indicate any instructions that are not supported Lines with unsupported statements or functions can be replaced with equivalent MegaBasic statements or functions While this is a quick way to convert a program to MegaBasic or estimate the size of an application it is not recommended for the final application because it does not take advantage of the strength and efficiency of programs written specifically for MegaBasic Series 90 Programmable Coprocessor Module and Support Software User s Manual November 1999 GFK 0255K 4 8 Printing a MegaBasic Text File When a PCM MegaBasic program is saved it is stored in a special format It can be printed when in this format only by using the MegaBasic LIST command which by default prints it to the screen To print the program or obtain the text version for editing off line you must LIST itto a PC file First invoke MegaBasic and load the program Then type OPEN 5 PC filename lst tocreatean output file
412. y the MegaBasic program This function is not presently used by the system 0 Nochanges RUN STOP switch setting from the front panel 1 RUN 0 STOP 5 1 6 1 7 1 8 4 12 2 14 1 15 1 Chapter 5 Advanced MegaBasic Programming GFK 0255K Time Stamp Subrecords Time stamps are used in the fault header records to indicate when the fault table was last cleared They are also used in fault records to indicate when the faults occurred The structure of these time stamps is explained in the following table Time Stamp Description TS SEC Aone byte BCD integer range 0 59 indicating the seconds count TS MIN A one byte BCD integer range 0 59 indicating the minutes count TS HOUR A one byte BCD integer range 0 23 indicating the hour count TS DAY A one byte BCD integer range 1 31 indicating the day of the month TS MON A one byte BCD integer range 1 12 indicating the month TS YEAR A one byte BCD integer range 0 99 indicating the year PLC Fault Address Subrecords In the PLC fault records the fault address has this structure Integer Description PLCFA RACK Aone byte integer indicating the rack number of the source of the fault PLCFA SLOT Aone byte integer indicating the slot number of the source of the fault PLCFA_UNIT Aone byte integer indicating the unit task or connection point of the source of the fault I O Reference Address Subrecords In the I
413. ype are used when the WAIT optionis specified in the COMMREQ command block This option is not recommended however because execution of the PLC program will not continue until the MegaBasic program sends a status message back to the CPU When multiple tasks are active in the PCM a significant amount of time may elapse before the MegaBasic program can do so The body of the COMMREO message is contained in the last 12 bytes of the messageheader No information is provided on the length of the message unless it is built into the message itself Type 1300r 131 194 195 The body of the COMMREO message is contained in the last 8 bytes of the message header No information is provided on the length of the message unless it is built into the message itself A message type of 195 indicates that the PLC CPU is waiting for the completion of message processing This message type are used when the WAIT option is specified in the COMMREQ command block This option is not recommended however because execution of the PLC program will not continue until the MegaBasic program sends a status message back to the CPU When multiple tasks are active in the PCM a significant amount of time may elapse before the MegaBasic program can do so This MegaBasic program fragment shows how to extract data from a COMMREO message Dim MESSAGE HDRS S 32 Dim MESSAGE TXT 256 Dim COMMREQ DATAS 256 PROCESS MESSAGE MESSAGE HDR MESSAGE TXT ES
Download Pdf Manuals
Related Search
Related Contents
KX-TDA100 Fujitsu ESPRIMO P900 Cine 7_7 HD_ Version 1_8_07_11.qxp MULTIPLEXER 16 CANALI FULL DUPLEX A COLORI hi-speed usb to sata/ide adapter user manual MTD Products Aktiengesellschaft √ SaarbrΩcken Détecteur de végétation (traitement sélectif) 詳細情報 Intel DZ75ML-45K Copyright © All rights reserved.
Failed to retrieve file