background image

Programmable Controllers

Cat. No. W353-E1-06

SYSMAC
CPM1/CPM1A/CPM2A/CPM2C/SRM1(-V2)

PROGRAMMING MANUAL

Summary of Contents for SRM1 - PROGRAMING 02-2001

Page 1: ...Programmable Controllers Cat No W353 E1 06 SYSMAC CPM1 CPM1A CPM2A CPM2C SRM1 V2 PROGRAMMING MANUAL ...

Page 2: ...CPM1 CPM1A CPM2A CPM2C SRM1 V2 Programmable Controllers Programming Manual Revised February 2008 ...

Page 3: ...iv ...

Page 4: ...ans word and is abbreviated Wd in documentation in this sense The abbreviation PC means Programmable Controller and is not used as an abbreviation for any thing else Visual Aids The following headings appear in the left column of the manual to help you locate different types of information Note Indicates information of particular interest for efficient and convenient operation of the product 1 2 3...

Page 5: ...vi ...

Page 6: ...CPM2A CPM2C Only 147 2 11 CompoBus S I O Slave Functions CPM1A CPM2A CPM2C Only 147 2 12 CompoBus S I O Master Functions SRM1 V2 and CPM2C S Only 148 2 13 Analog Controls CPM1 CPM1A CPM2A Only 150 2 14 Quick response Inputs 153 2 15 Macro Function 157 2 16 Calculating with Signed Binary Data 158 2 17 Differential Monitor 159 2 18 Expansion Instructions CPM2A CPM2C SRM1 V2 Only 160 2 19 Using the C...

Page 7: ...tructions FAILURE ALARM AND RESET FAL 06 and SEVERE FAILURE ALARM FALS 07 385 7 14 Step Instructions STEP DEFINE and STEP START STEP 08 SNXT 09 385 7 15 Timer and Counter Instructions 388 7 16 Shift Instructions 404 7 17 Data Movement Instructions 411 7 18 Data Control Instructions 421 7 19 Comparison Instructions 432 7 20 Conversion Instructions 439 7 21 BCD Calculation Instructions 457 7 22 Bina...

Page 8: ...efined Errors 552 9 5 Operating Errors 553 9 6 Error Log 555 9 7 Host Link Errors 557 9 8 Troubleshooting Flowcharts 557 Appendices A Programming Instructions 559 B Error and Arithmetic Flag Operation 565 C Memory Areas 569 D I O Assignment Sheet 587 E Program Coding Sheet 589 F List of FAL Numbers 593 G Extended ASCII 595 Index 597 Revision History 603 ...

Page 9: ...x ...

Page 10: ... of Support Software Name Model No Manual Catalog No CX Programmer version 3 1 WS02 CXPC1 EV3 CX Programmer Operation Manual W414 CX Programmer version 4 0 WS02 CXPC1 EV4 g p W425 SYSMAC Support Software C500 ZL3AT1 E SYSMAC Support Software Operation Manual Basic W247 SYSMAC Support Software Operation Manual C series PCs W248 SYSMAC CPT Support Software WS02 CPTB1 E SYSMAC CPT Support Software Qu...

Page 11: ...ces the instructions that are used to build the basic structure of the ladder diagram and control its execution Section 7 explains instructions individually and provides the ladder diagram symbol data areas and flags used with each Section 8 explains the internal PC processing as well as the time required for processing and execution Section 9 describes how to diagnose and correct hardware and sof...

Page 12: ... THE REQUIREMENTS OF THEIR INTENDED USE OMRON DISCLAIMS ALL OTHER WARRANTIES EXPRESS OR IMPLIED ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ LIMITATIONS OF LIABILITY ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁ...

Page 13: ...ability of the products in combination with the end product machine system or other application or use The following are some examples of applications for which particular attention must be given This is not intended to be an exhaustive list of all possible uses of the products nor is it intended to imply that the uses listed may be suitable for the products Outdoor use uses involving potential ch...

Page 14: ...DIMENSIONS AND WEIGHTS ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Dimensions and weights are nominal and are not to be used for manufacturing purposes even when tolerances are shown ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ PERFORMANCE DATA ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁ...

Page 15: ...xvi ...

Page 16: ...ction is important for the safe and reliable application of the Programmable Con troller You must read this section and understand the information contained before attempting to set up or operate a PC system 1 Intended Audience xviii 2 General Precautions xviii 3 Safety Precautions xviii 4 Operating Environment Precautions xx 5 Application Precautions xxi ...

Page 17: ...is manual provides information for programming and operating the Unit Be sure to read this manual before attempting to use the Unit and keep this manual close at hand for reference during operation WARNING It is extremely important that a PC and all PC Units be used for the specified purpose and under the specified conditions especially in applications that can directly or indirectly affect human ...

Page 18: ...C is overloaded or short circuited the voltage may drop and result in the outputs being turned OFF As a countermeasure for such problems external safety measures must be provided to ensure safety in the system WARNING When handling the Memory Backup Battery never drop disassemble distort short circuit recharge heat to a temperature exceeding 100 C or throw into fire The Battery may explode catch f...

Page 19: ... to shock or vibration Caution Take appropriate and sufficient countermeasures when installing systems in the following locations Locations subject to static electricity or other forms of noise Locations subject to strong electromagnetic fields Locations subject to possible exposure to radioactivity Locations close to power supplies Caution The operating environment of the PC System can have a lar...

Page 20: ...1314 to ensure proper op eration of the system The life of relays largely varies depending on switching conditions Be sure to test operating conditions using actual Units and use the product within the spe cified number of switchings so as not to cause any performance problems Us ing the product with performance problems may result in defective insulation between circuits or burning of the relays ...

Page 21: ... may result in burning Double check all wiring and switch settings before turning ON the power sup ply Incorrect wiring may result in burning Check the user program for proper execution before actually running it on the Unit Not checking the program may result in an unexpected operation Handling Precautions When using storing or transporting the product keep within the specifications listed in the...

Page 22: ...e sure to confirm that the rating of a new part is correct Not doing so may result in malfunction or burning When the CPU Unit is replaced resume operation only after transferring to the new CPU Unit the contents of the DM and HR Areas required for operation Not doing so may result in an unexpected operation Transportation and Storage When transporting the Units use special packing boxes Do not su...

Page 23: ...of the operat ing parameters available for the CPM1 CPM1A CPM2A CPM2C and SRM1 V2 You may then want to read Section 5 Memory Areas Section 6 Ladder diagram Programming and related instructions in Section 7 Instruction Set before complet ing this section 1 1 PC Setup 2 1 1 1 Changing the PC Setup 2 1 1 2 CPM1 CPM1A PC Setup Settings 3 1 1 3 CPM2A CPM2C PC Setup Settings 7 1 1 4 SRM1 V2 PC Setup Set...

Page 24: ...m execution will have to be restarted to make changes in DM 6615 to DM 6644 effective When DM 6602 bits 00 to 03 are set to protect the program memory DM 6602 cannot be changed using the PC Setup operation of the Support Software To change DM 6602 use the I O Monitor or DM Edit operation The PC Setup can be read but not overwritten from the user program Writing can be done only by using a Programm...

Page 25: ...eset 1 Maintain See note 3 DM 6602 00 to 03 Program memory write protection 0 Program memory unprotected 1 Program memory write protected except DM 6602 itself 17 04 to 07 Programming Console display language 0 English 1 Japanese 08 to 15 Not used DM 6603 00 to 15 Not used DM 6604 00 to 07 00 If data could not be saved with the built in capacitor AR 1314 ON a memory error will not be generated 01 ...

Page 26: ...for IR 001 DM 6624 00 to 07 Input constant for IR 007 Setting same as for IR 001 08 to 15 Input constant for IR 008 Setting same as for IR 001 DM 6625 00 to 07 Input constant for IR 009 Setting same as for IR 001 08 to 15 Not used DM 6626 to DM 6627 00 to 15 Not used DM 6628 00 to 03 Interrupt enable for IR 00003 0 Normal input 1 Interrupt input 2 Quick response 79 04 to 07 Interrupt enable for IR...

Page 27: ...1 bit 8 bits 1 bit Odd 08 1 bit 8 bits 1 bit None 09 1 bit 8 bits 2 bits Even 10 1 bit 8 bits 2 bits Odd 11 1 bit 8 bits 2 bits None Other settings will cause a non fatal error and AR 1302 will turn ON DM 6652 00 to 15 Transmission delay Host Link See note 4 0000 to 9999 In ms Other settings will cause a non fatal error and AR 1302 will turn ON DM 6653 00 to 07 Node number Host Link 00 to 31 BCD O...

Page 28: ...starting up in RUN Mode however the forced set reset status is cleared Even if the IOM Hold Bit Status at Startup or Forced Status Hold Bit Status at Startup is set to Maintain the IOM Hold Bit SR 25212 or Forced Status Hold Bit SR 25211 status may be cleared if the power remains OFF for longer than the backup time of the built in capacitor For details on the hold ing time refer to the CPM1A or CP...

Page 29: ...roduced before 1 September 2000 Refer to 1 3 Changes in SW2 for details DM 6601 00 to 07 Not used 17 08 to 11 IOM Hold Bit SR 25212 Status at Startup 0 Reset to 0 1 Maintain previous status 12 to 15 Forced Status Hold Bit SR 25211 Status at Startup 0 Reset to 0 1 Maintain previous status DM 6602 00 to 03 Program memory write protection 0 Program memory unprotected 1 Program memory write protected ...

Page 30: ...ration is started DM 6620 00 to 03 Input time constant for IR 00000 to IR 00002 0 10 ms 1 1 ms 2 2 ms 3 3 ms 4 5 ms 5 10 ms 6 20 ms 7 40 ms 8 80 ms 19 04 to 07 Input time constant for IR 00003 and IR 00004 Setting same as bits 00 to 03 08 to 11 Input time constant for IR 00005 and IR 00006 Setting same as bits 00 to 03 12 to 15 Input time constant for IR 00007 to IR 00011 Setting same as bits 00 t...

Page 31: ...or synchronized pulse control 300 Hz to 20 kHz DM 6643 DM 6644 00 to 15 Not used RS 232C Port Communications Settings The following settings are effective after transfer to the PC If the CPM2A CPU Unit s Communications Switch is ON communications through the CPM2A s RS 232C port are gov erned by the default settings all 0 regardless of the settings in DM 6645 through DM 6649 If pin 2 of the CPM2C ...

Page 32: ...ms Any other setting specifies a delay of 0 ms causes a non fatal error and turns ON AR 1302 226 DM 6648 00 to 07 Node number Host Link 00 to 31 BCD Any other setting specifies a node number of 00 causes a non fatal error and turns ON AR 1302 226 08 to 11 Start code selection for no protocol communications 0 Disables start code 1 Enables start code in DM 6649 Any other setting disables the start c...

Page 33: ...or and turns ON AR 1302 DM 6651 00 to 07 Baud rate 00 1 200 bps 01 2 400 bps 02 4 800 bps 03 9 600 bps 04 19 200 bps 08 to 15 Frame format Start bits Data bits Stop bits Parity 00 1 bit 7 bits 1 bit Even 01 1 bit 7 bits 1 bit Odd 02 1 bit 7 bits 1 bit None 03 1 bit 7 bits 2 bits Even 04 1 bit 7 bits 2 bits Odd 05 1 bit 7 bits 2 bits None 06 1 bit 8 bits 1 bit Even 07 1 bit 8 bits 1 bit Odd 08 1 bi...

Page 34: ...0 Shift after 7 records have been stored 1 Store only first 7 records no shifting 2 to F Do not store records 21 04 to 07 Not used 08 to 11 Cycle time monitor enable 0 Generate a non fatal error for a cycle time that is too long 1 Do not generate a non fatal error 12 to 15 Low battery error enable 0 Generate a non fatal error for low battery voltage 1 Do not generate a non fatal error Low battery ...

Page 35: ...emory write protected except DM 6602 itself 17 04 to 07 Programming Console display language 0 English 1 Japanese 08 to 11 Expansion Instructions 0 Default settings 1 User settings 12 to 15 Not used DM 6603 00 to 03 Maximum number of CompoBus S devices 0 Max no 32 1 Max no 16 04 to 07 CompoBus S communications mode setting V2 only 0 High speed communications 1 Long distance communications 08 to 15...

Page 36: ...5 1 N NT Link Any other setting specifies Host Link mode causes a non fatal error and turns ON AR 1302 The 1 N NT Link is supported by SRM1 C02 V2 only DM 6646 00 to 07 Baud rate 00 1 2K 01 2 4K 02 4 8K 03 9 6K 04 19 2K 08 to 15 Frame format Start Length Stop Parity 00 1 bit 7 bits 1 bit Even 01 1 bit 7 bits 1 bit Odd 02 1 bit 7 bits 1 bit None 03 1 bit 7 bits 2 bits Even 04 1 bit 7 bits 2 bits Od...

Page 37: ...ame format Start Length Stop Parity 00 1 bit 7 bits 1 bit Even 01 1 bit 7 bits 1 bit Odd 02 1 bit 7 bits 1 bit None 03 1 bit 7 bits 2 bits Even 04 1 bit 7 bits 2 bits Odd 05 1 bit 7 bits 2 bits None 06 1 bit 8 bits 1 bit Even 07 1 bit 8 bits 1 bit Odd 08 1 bit 8 bits 1 bit None 09 1 bit 8 bits 2 bits Even 10 1 bit 8 bits 2 bits Odd 11 1 bit 8 bits 2 bits None Other 1 bit 7 bits 2 bits Even AR 1302...

Page 38: ...oltage 1 Do not generate a non fatal error Note If an out of range value is set the following communications conditions will re sult In that case reset the value so that it is within the permissible range Communications mode Host Link Communications format Standard settings 1 start bit 7 bit data even parity 2 stop bits 9 600 bps Transmission delay No Node number 00 1 2 Basic PC Operation and I O ...

Page 39: ...do not use the I O Hold Bit Status and Forced Sta tus Hold Bit Status Bits DM 6601 when the power to the PC is going to be turned off longer than the memory backup time of the internal capacitor If the memory backup time is exceeded memory status will be unstable even if the I O Hold Bit Status and Forced Status Hold Bit Status Bits are used Unpredictable results may occur if operation is attempte...

Page 40: ...ng requests exist 1 2 5 Peripheral Port Servicing Time The following settings are used to determine the percentage of the cycle time devoted to servicing the peripheral port 15 0 Bit Servicing time setting enable 00 Disabled 5 used 01 Enabled setting in bits 00 to 07 used Servicing time valid with bits 08 to 15 are 01 00 to 99 BCD two digits Default 5 of cycle time DM6617 Example If DM 6617 is set...

Page 41: ...en the cycle time ex ceeds 100 ms unless detection of long cycle times is disable using the setting in DM 6655 1 2 7 Minimum Cycle Time Make the settings shown below to standardize the cycle time and to eliminate variations in I O response time by setting a minimum cycle time 15 0 Bit DM6619 Cycle time 4 digits BCD 0000 Cycle time variable 0001 to 9999 Minimum cycle time Unit 1 ms Default Cycle ti...

Page 42: ...ow Set only the rightmost digit for each setting for IR 000 00 8 ms 01 1 ms 02 2 ms 03 4 ms 04 8 ms 05 16 ms 06 32 ms 07 64 ms 08 128 ms The CPM1 CPM1A s I O response time is the input time constant 1 ms to 128 ms default is 8 ms the cycle time Refer to 8 1 CPM1 CPM1A Cycle Time and I O Response Time for more details CPM2A CPM2C PCs Set the input time constants for CPM2A CPM2C inputs from a Progra...

Page 43: ...ors and cycle time overrun errors are non fatal errors For details on the error log refer to Section 9 Troubleshooting Note The low battery error is applicable to CPM2A CPM2C only This digit isn t used in CPM1 CPM1A SRM1 V2 PCs and CPM2C PCs that aren t equipped with a battery 1 3 CPM2C Changes in SW2 The connection of a Programming Console to the peripheral connector is auto matically detected fo...

Page 44: ...ipheral port device Peripheral device SW2 setting p OFF ON Nothing connected PROGRAM mode RUN mode Programming Console According to Programming Console key switch PROGRAM mode See note Other PROGRAM mode See note PROGRAM mode Note Communications will not be possible between the CPM2C and the peripheral device for these combinations 01 Hex Mode used immediately before power interruption 02 Hex Mode...

Page 45: ...1 3 Section CPM2C Changes in SW2 23 Connections IBM PC AT or compatible XW2Z 200S V XW2Z 500S V CPM2C CN111 CS1W CN118 ...

Page 46: ...n 117 2 6 CPM1A Pulse Output Functions 131 2 6 1 Programming Example in Continuous Mode 132 2 6 2 Programming Example in Independent Mode 132 2 6 3 Using Pulse Output Instructions 132 2 6 4 Changing the Frequency 133 2 6 5 Stopping Pulse Output 133 2 7 Synchronized Pulse Control CPM2A CPM2C Only 134 2 8 Data Computation Standards 146 2 8 1 Pulse Outputs 146 2 8 2 Synchronized Pulse Control 146 2 9...

Page 47: ...Hz and the normal program is stopped and an inter rupt program is executed Interrupt subroutine numbers 000 to 003 are allo cated to input points 00003 to 00006 Count check Interrupts Using the High speed Counter Pulse inputs to the CPU Unit s input points 00000 to 00002 are counted at high speed 20 kHz 5 kHz and an interrupt program is executed when the present value matches the target value or f...

Page 48: ...interrupt will be resumed after the higher priority interrupt processing has been completed If interrupts of the same priority are generated simultaneously they will be pro cessed in the following order Interrupt input 0 Interrupt input 1 Interrupt input 2 Interrupt input 3 in cluding count up mode Interval timer interrupt High speed counter interrupt 2 1 1 Processing the Same Memory Locations wit...

Page 49: ...temporarily in memory and not stored in DM 0000 Although 0010 is moved to DM 0000 in the interrupt program the addition result that was saved is written to DM 0000 as soon as processing returns to the main program effec tively undoing the results of the interrupt program Countermeasure for Above Problem Interrupting Writing Multiple Words of Data ...

Page 50: ...to DM 0010 Therefore in the comparison at point 1 the contents of DM 0000 and DM 0001 are not equal and processing stops with A in the OFF state As a result although the contents of DM 0000 and DM 0010 agree at the value 1234 an in correct comparison result is reflected in comparison result output A Countermeasure for Above Problem ...

Page 51: ...response time 00003 0 000 50 µs 0 3 ms from h i 00004 1 001 µ when input turns ON until program 00005 See note 3 2 002 ON until program execution 00006 See note 3 3 003 Note 1 Input numbers 00003 to 00006 can be used for any of the following func tions interrupt inputs interrupt inputs counter mode or quick response in puts When not being used for any of these they can be used as ordinary inputs 2...

Page 52: ... 1 The same input number from 00003 to 00006 cannot be used for more than one of the following functions interrupt inputs interrupt inputs counter mode or quick response inputs 2 When inputs 00003 to 00006 are set for use as interrupt inputs counter mode the input time constants for the relevant inputs are disabled The in put time constants remain in effect however for the values for refreshing th...

Page 53: ...t inputs interrupt input mode the subroutine numbers executed for the input numbers are fixed Input number Interrupt number Subroutine number 00003 0 000 00004 1 001 00005 See note 2 002 00006 See note 3 003 The same input number from 00003 to 00006 cannot be used for more than one of the following functions interrupt inputs interrupt inputs counter mode or quick response inputs With a CPM2A wire ...

Page 54: ... 00005 counter mode 2 Quick response input 12 to 15 Interrupt setting for input 00006 Note Input points 00005 and 00006 do not exist in CPM2C CPU Units with only 10 I O points and in CPM2C S CPU Units The settings will go into effect when the mode is changed from PROGRAM to MONITOR RUN or when the power supply is turned ON to the CPM2A CPM2C The following table shows the instruction operations rel...

Page 55: ... interrupt inputs use INT 89 to permit them Clearing Interrupt Inputs This function is used to clear input numbers 00003 to 00006 interrupt inputs 0 to 3 Since interrupt inputs are recorded masked interrupts will be serviced after the mask is removed unless they are cleared first Use INT 89 to clear the cause of the interrupt inputs so that they will not be executed when interrupt inputs are permi...

Page 56: ...s Masked inputs are recorded but ignored Masking All Interrupts Interrupt control designation 100 Mask all interrupts Fixed at 000 Fixed at 000 INT 89 100 000 000 Unmasking All Interrupts Interrupt control designation 200 Unmask all interrupts Fixed at 000 Fixed at 000 INT 89 200 000 000 The masking or unmasking all interrupts cannot be executed within an interrupt subroutine If causes for interru...

Page 57: ... 1 to DM 0000 The following diagram shows input wiring in the CPM2A Input device The following diagram shows input wiring in the CPM2C Input device Input device Input terminals Input connector See note 2 Example for Fujitsu compatible connector PC Setup DM 6628 Input 00003 is used as an interrupt input Inputs 00004 to 00006 are used as ordinary inputs 0 0 0 1 15 0 Explanation Wiring ...

Page 58: ... to 319 968 ms There are two interrupt modes the one shot mode in which a single interrupt is executed when the time is up and the scheduled interrupt mode in which interrupts are executed at regular intervals Interval timer interrupt Normal program Interrupt program Subroutine One shot mode Scheduled interrupt mode Operation Interrupt is executed once when time has elapsed Interrupts are executed...

Page 59: ...uts Can be used simultaneously Input time constant Can be used simultaneously Clock Can be used simultaneously Procedure for Using Interval Timer Interrupts Select the mode Either one shot mode or schedule interrupt mode Ladder diagram programming STIM 69 Interval timer Interrupt is executed Ladder diagram programming Specified subroutine is executed STIM 69 INTERVAL TIMER instruction Start timer ...

Page 60: ... Starts interval timer in scheduled interrupt mode Read timer PV Reads the timer PV Stop timer Stops timer operations INT 89 Mask all interrupts Prohibits all interrupts including interrupt inputs interval timer interrupts high speed counters etc Unmask all interrupts Permits all interrupts including interrupt inputs interval timer interrupts high speed counters etc Starting Timers This function s...

Page 61: ... in units of ms Reading Timer PVs This function reads interval timer PVs Control designation 006 Read timer PV Number of times decrementing timer is decremented 4 digits Hex Decrementing time interval 4 digits BCD unit 0 1 ms Time elapsed since last decrement 4 digits BCD unit 0 1 ms STIM 69 006 C2 C3 C2 C2 1 C3 Stopping Timers This function stops the interval timer Control designation 010 Stop ti...

Page 62: ...s executed one time When the interrupt subroutine is executed 1 is added to DM 0000 Elapsed time 100 x 100 x 0 1 1 000 ms Programming ON for 1 cycle at beginning of operation Clears Increment Area DM 0000 Always ON Execution condition Decrement counter setting Count 100 0000 to 9999 BCD Count interval setting Count interval setting 10 ms 0005 to 0320 BCD Starts interval timer in one shot mode Exec...

Page 63: ...nterrupts must be masked when the words are being ma nipulated in the main program When an interrupt occurs any instruction being executed in the main program will be interrupted and processing data will be temporarily stored while the inter rupt program is being executed When execution of the interrupt program has been completed the original execution status of the main program will be re stored ...

Page 64: ...t 1235 MOV executed 0010 moved to DM 0000 Interrupt program ended Processing continued Add result 1235 written ADD instruction DM0000 1234 0010 1235 Processing is interrupted before the result of the add operation can be written to DM 0000 and the result is buffered The interrupt program writes 0010 to DM 0000 but this is immediately overwritten by the result of the add 1235 as soon as execution o...

Page 65: ...ocessing for CMP DM 0000 read DM 0010 read DM 0000 and DM 0010 compared Comparison result output Interrupt program ended 1234 ABCD OFF 1 0502 1234 1234 1234 1234 2 OFF ABCD 1234 1234 003E 0502 1234 ABCD OFF DM0010 A DM0000 DM0001 DM0002 BSET instruction Processing is interrupted before 1234 can be written to DM 0010 Bit A in the interrupt program is thus turned OFF and will remain OFF when executi...

Page 66: ...menting or just an incrementing count depending on the mode setting Input No See note Response frequency Input mode count value Control method 00000 00001 5 kHz Differential phase input mode 8388608 to 8388607 Target value comparison interrupts 0000 00002 20 kHz Pulse direction input mode 8388608 to 8388607 Up down pulse input mode 8388608 to 8388607 Increment mode 0 to 16777215 co pa so e up s Ra...

Page 67: ...matches a target value in either the incrementing or decrementing direction Range Comparison Interrupts A range comparison table contains up to eight ranges which are each defined by a lower limit and an upper limit as well as their corresponding subroutine num bers The corresponding subroutine is called and executed when the current count the counter PV falls within a given range Counter PV Upper...

Page 68: ...kHz 20 kHz Count value 8388608 to 8388607 0 to 16777215 Counter PV storage destination See note 2 Words SR 248 rightmost digit and SR 249 leftmost digit Interrupts Target value comparison Up to 16 target values and interrupt subroutine numbers can be registered in either the incrementing or decrementing direction Range comparison Up to eight ranges with upper and lower limits and subroutine number...

Page 69: ... Operation Example Select the input mode and reset method Select the interrupts to be used Wire the inputs PC Setup DM 6642 Create a ladder diagram program Input mode Differential phase input pulse direction input up down input or increment Reset method Phase Z software reset or software reset No interrupts Read high speed counter PV or read range comparison results Target value comparison interru...

Page 70: ...t stop comparison SBN 92 RET 93 Every scan Counter PV SR 249 SR 248 PRV 62 Each time HIGH SPEED COUNTER PV READ instruction Read PV Read comparison status Read range comparison results Range comparison results AR 1100 to AR 1107 PC Setup DM 6642 bits 00 to 03 Selecting the Input Mode and Reset Method Input Mode Select the input mode for the high speed counter according to the signal type Different...

Page 71: ... or decremented accord ingly Maximum frequency 20 kHz Count Nms Frequency 1 000 N CW inputs CCW inputs Incremented Decremented ON OFF ON OFF Increment Mode In the increment mode pulse signals are input and the count is incremented with each pulse IR 00001 can be used as an ordinary input Maximum frequency 20 kHz Count Nms Frequency 1 000 N Pulse inputs ON OFF When the differential phase input mode...

Page 72: ...Reset Reset Not reset Not reset Software Reset The PV is reset when the High speed Counter Reset Flag 25200 turns ON 1 scan Reset Not reset Not reset Not reset The High speed Counter Reset Flag 25200 is refreshed with every scan so it must remain ON for at least one cycle time to be certain it is read Even when the PV is reset the comparison table registration status the compar ison execution stat...

Page 73: ...rection Time Interrupt Interrupt Interrupt Subroutine 8 executed Subroutine 10 executed Subroutine 9 executed The relationship between the target value comparison count check and the com parison table is different for the CPM1 CPM1A Refer to the individual manuals for details It is not possible to specify more than one comparison direction condition for the same target value in the comparison tabl...

Page 74: ... generated while an instruction controlling the high speed count er is being executed in the normal program area the CTBL 63 INI 61 and PRV 62 instructions will not be executed within the interrupt program This situ ation can be avoided by means of the following programming Method 1 Prohibit interrupts in the normal program area while executing the instruction Method 2 In the normal program area r...

Page 75: ...ection input 00002 Reset input Pulse Direction Input Mode Increment Mode 00000 Pulse input 00002 Reset input CPM2C Inputs Note The following examples are for Fujitsu compatible connectors Input bit ad dresses and connector pin numbers depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails Differential Phase Input Mode 00000 Phase A input 000...

Page 76: ...e note Pulse Direction Input Mode 00000 Pulse input 00001 Direction input 00002 Reset input 00000 Pulse input 00001 Direction input 00002 Reset input Input terminals Input connector See above note Increment Mode 00000 Pulse input 00002 Reset input 00000 Pulse input 00002 Reset input Input terminals Input connector See above note When phase Z and reset inputs are not used 00002 can be used as an or...

Page 77: ...ut 20 kHz 2 Up down input 20 kHz 4 Increment 20 kHz 0 1 2 or 4 04 to 07 High speed counter reset method setting 0 Phase Z signal software reset 1 Software reset 0 or 1 08 to 15 High speed counter usage setting 00 Do not use 01 Use as high speed counter 02 Use as pulse synchronization control 10 Hz to 500 Hz 03 Use as pulse synchronization control 20 Hz to 1 kHz 04 Use as pulse synchronization cont...

Page 78: ...pts Permits all interrupts including interrupt inputs interval timer interrupts high speed counters etc The following table shows the data areas related to high speed counter control Word Bits Name Contents 248 249 00 to 15 High speed counter PV Reads high speed counter PV 249 00 to 15 g p g p PV 252 00 High speed counter reset When this bit turns ON a software reset is triggered for the high spee...

Page 79: ...on increment decrement Increment direction 0000 to 0049 Decrement direction F000 to F049 The range that can be specified depends on the mode when target comparison interrupts are specified It is not possible to specify more than one comparison direction condition for the same target value in the comparison table Once a comparison table has been registered it will be saved in the CPM2A CPM2C as lon...

Page 80: ...ange comparison conditions consisting of upper and lower limits and subroutine numbers must be set If the set values do not reach 8 set FFFF If two or more comparison conditions are satisfied simultaneously in the same cycle the interrupt for the condition closest to the beginning of the comparison table will be executed Once a comparison table has been registered it will be saved in the CPM2A CPM...

Page 81: ...ction reads the high speed counter PV Using an Instruction Port specifier 000 High speed counter Control designation 000 Read PV Beginning word for storing PV Rightmost 4 digits Leftmost 4 digits PV Rightmost and leftmost The read PV will be stored here Differential phase input mode Pulse direction input mode Up down pulse input mode F8388608 to 08388607 Increment mode 00000000 to 16777215 The lef...

Page 82: ...s the result of a range comparison showing whether or not the PV is within a range Using an Instruction Port specifier 000 High speed counter Control designation 002 Read range comparison result Beginning word for storing range comparison result Match with 1st condition 0 No match 1 Match Match with 2nd condition 0 No match 1 Match Match with 3rd condition 0 No match 1 Match Match with 4th conditi...

Page 83: ...ith the same timing Mask Unmask All Interrupts For details regarding masking and unmasking all interrupts refer to 2 1 2 Inter rupt Inputs Application Examples Target Value Comparison Explanation In this example specified interrupt subroutines are executed by matching the high speed counter s PV with five values set as a target value comparison table With each interrupt the data in DM 0000 to DM 0...

Page 84: ...depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails Brown Orange White Black Rotary encoder Blue Input terminals Input connector Brown Orange White Black Rotary encoder Blue See above note PC Setup 0 Differential phase input 0 Reset by phase Z signal software reset 01 Use as high speed counter DM 6642 0 1 0 0 15 0 ...

Page 85: ...N Always ON Comparison 2 Comparison 4 Number of comparisons 5 Target value 00010000 Comparison 1 Comparison 2 Comparison 3 Comparison 4 Comparison 5 Increment subroutine 049 Target value 00003000 Increment subroutine 040 Target value 00000000 Decrement subroutine 010 Target value 00003000 Decrement subroutine 041 Target value 00010000 Decrement subroutine 048 Always ON Comparison 5 Always ON Compa...

Page 86: ...s example specified interrupt subroutines are executed by matching the high speed counter s PV with five range set as a range comparison table With each interrupt the data in DM 0000 to DM 0004 is incremented by one Wiring CPM2A E6B2 CWZ6C Rotary Encoder Brown Blue Black White Orange ...

Page 87: ...depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails Brown Orange White Black Rotary encoder Blue Input terminals Input connector Brown Orange White Black Rotary encoder Blue See above note PC Setup 0 Differential phase input 0 Reset by phase Z signal software reset 01 Use as high speed counter DM 6642 0 1 0 0 15 0 ...

Page 88: ...lways ON Comparison 3 Always ON Comparison 4 Always ON Comparison 5 Lower limit 9 000 Comparison 1 Upper limit 10 000 Subroutine 043 Comparison 6 Not used Comparison 7 Not used Comparison 8 Not used Subroutine 040 Lower limit 7 000 Upper limit 8 000 Subroutine 041 Lower limit 3 000 Upper limit 3 000 Subroutine 010 Lower limit 8 000 Upper limit 7 000 Subroutine 042 Lower limit 10 000 Upper limit 9 ...

Page 89: ...mber Note 3 Response frequency 00003 0 to 65535 0000 FFFF 0 000 2 kHz 00004 0000 to FFFF 1 001 00005 2 002 00006 3 003 Note 1 Input number 00005 and 00006 cannot be used in CPM2C CPU Units with 10 I O points and CPM2C S CPU Units 2 Input numbers 00003 to 00006 can be used for any of the following func tions interrupt inputs interrupt inputs counter mode or quick response in puts When not being use...

Page 90: ... See note 1 Input time constant See note 2 Clock Can be used simultaneously Note 1 The same input number from 00003 to 00006 cannot be used for more than one of the following functions interrupt inputs interrupt inputs counter mode or quick response inputs 2 When inputs 00003 to 00006 are set for use as interrupt inputs counter mode the input time constants for the relevant inputs are disabled The...

Page 91: ...ately Counter SV Counter 0 Counter 1 Counter 2 Counter 3 SR 244 SR 245 SR 246 SR 247 PRV 62 HIGH SPEED COUNTER PV READ instruction Read counter PV With interrupt inputs in counter mode the subroutine to be executed is deter mined by the interrupt corresponding to the input number Input number Interrupt number Subroutine number 00003 0 000 00004 1 001 00005 2 002 00006 3 003 Note Input numbers 0000...

Page 92: ...As the set value SV is refreshed the count is is decremented toward 0 and the interrupt subroutine is executed when the present value PV reaches 0 PV SV Decrementing Decrementing Interrupt Subroutine executed Interrupt Subroutine executed Time The subroutine is executed when the count is up and the PV is reset to the SV With the CPM2A wire the input terminals as shown in the following illustration...

Page 93: ...not be used with CPU Units that have only 10 I O points See above note The following table shows the settings in the PC Setup area related to interrupt input usage Word Bits Function Setting DM 6628 00 to 03 Interrupt setting for input 00003 0 Normal input 1 Interrupt input 1 04 to 07 Interrupt setting for input 00004 1 Interrupt input interrupt input mode or counter mode 08 to 11 Interrupt settin...

Page 94: ...tores the 241 00 to 15 SV area for input interrupt counter mode 1 counter s set value SV 242 00 to 15 SV area for input interrupt counter mode 2 value SV 243 00 to 15 SV area for input interrupt counter mode 3 244 00 to 15 PV area for input interrupt counter mode 0 Stores the 245 00 to 15 PV area for input interrupt counter mode 1 counter s present value 246 00 to 15 PV area for input interrupt co...

Page 95: ...NT 89 is executed to mask interrupts during counter operation interrupt control designation 000 counter operation will be stopped and the counter PV will be reset To use the counter again start the counter operation again as de scribed above Change PV This function refreshes the counter s present value PV Port specifier 100 102 102 103 Interrupt inputs counter mode 0 to 3 Control designation 002 C...

Page 96: ... any given time Words SR 244 to SR 247 cannot be used as work word even when the interrupt inputs counter mode are not used When the PV is read by executing PRV 62 words 244 to 247 are refreshed with the same timing Mask Unmask All Interrupts For details regarding masking and unmasking all interrupts refer to 2 1 2 Inter rupt Inputs Application Example In this example the PV is decremented every t...

Page 97: ...Input device Input terminals Input connector See above note PC Setup Specifies bit 00003 as an interrupt input counter mode Inputs 00004 to 00006 are used as ordinary inputs DM 6628 0 0 0 1 15 0 Programming ON for 1 cycle at beginning of operation Clears Increment Area DM 0000 Decrement counter setting Counter SV 64 Hex 100 times Stores SV in word 240 Starts counter with bit 00003 as interrupt inp...

Page 98: ...revious interrupt will be resumed When an interrupt with a lower or equal priority is received during interrupt pro cessing then the newly received interrupt will be processed as soon as the rou tine currently being processed has been completely executed When two interrupts with equal priority are received at the same time they are executed in the following order Input interrupt 0 Input interrupt ...

Page 99: ... 1 2 3 1 This is the program section from the main program PRV 62 002 000 DM 0000 CTBL 63 000 000 DM 0000 RSET LR 0000 LR 0000 2 This is the program section from the interrupt subroutine SBN 92 000 CTBL 63 000 000 DM 0000 25313 25503 LR 0000 Note 1 Define interrupt routines at the end of the main program with SBN 92 and RET 93 instructions just like regular subroutines 2 When defining an interrupt...

Page 100: ... pt CPU Units CPM1 20CDR and CPM1 30CDR V1 00003 00004 00005 00006 00003 00004 24VDC NC CPM1A PCs 10 pt CPU Units CPM1A 10CDR 20 30 and 40 pt CPU Units CPM1A 20CDR CPM1A 30CDR and CPM1A 40CDR CPU Unit Input Interrupt b Response time p p number Interrupt mode Counter mode CPM1 10CDR CPM1A 10CD 00003 00 0 3 ms max 1 kHz CPM1A 10CD 00004 01 Time until the CPM1 20CDR CPM1A 20CD 00003 00 Time until the...

Page 101: ...3 003 Input Refreshing If input refreshing is not used input signal status within the interrupt routine will not be reliable Depending on the input time constant the input signals might not go ON even if input refreshing is used This includes the status of the interrupt input bit that activated the interrupt For example IR 00000 would not be ON in interrupt routine for input interrupt 0 unless it ...

Page 102: ...memory 0 Input interrupt retained 1 Input interrupt cleared Reading Mask Status With the INT 89 instruction read the input interrupt mask status INT 89 002 000 D The status of the rightmost digit of the data stored in word D bits 0 to 3 show the mask status 0 Mask cleared Input interrupt enabled 1 Mask set Input interrupt disabled Program Example When input 00003 interrupt no 0 goes ON operation m...

Page 103: ...nt er will be reset and counting interrupts will continue until the counter is stopped Note 1 If the INT 89 instruction is used during counting the present value PV will return to the set value SV You must therefore use the differentiated form of the instruction or an interrupt may never occur 2 The set value will be set when the INT 89 instruction is executed If inter rupts are already in operati...

Page 104: ...ts and high speed counter interrupts can be masked and unmasked as a group by means of the INT 89 instruction The mask is in addition to any masks on the individual types of interrupts Furthermore clearing the masks for all interrupts does not clear the masks on the individual types of interrupts but restores them to the masked conditions that existed before INT 89 was executed to mask them as a g...

Page 105: ...s 0005 to 0320 0 5 ms to 32 ms Each time that the interval specified in word C2 1 elapses the decrement ing counter will decrement the present value by one When the PV reaches 0 the designated subroutine will be called just once and the timer will stop The time from when the STIM 69 instruction is executed until time elapses is calculated as follows Content of C2 Content of C2 1 0 1 ms 0 5 to 319 ...

Page 106: ... this instruc tion is calculated as follows Content of C2 Content of C2 1 Content of C3 0 1 ms If the specified interval timer is stopped then 0000 will be stored Stopping the Timer Use the STIM 69 instruction to stop the interval timer The interval timer will be stopped STIM 69 C1 000 000 C1 Stop interval timer 010 In this example an interrupt is generated 2 4 ms 0 6 ms 4 after input 00005 goes O...

Page 107: ...terval to 1 0 ms BCD 0005 to 0320 Starts the interval timer in scheduled interrupt mode Specifies the first word containing the set value Specifies the subroutine number 23 2 3 5 High speed Counter Interrupts CPM1 CPM1A PCs have a high speed counter function that can be used in in crementing mode or up down mode The high speed counter can be combined with input interrupts to perform target value c...

Page 108: ... even when used for the phase Z signal and software reset the input status is reflected inn 00002 of the I O memory High speed Counter Settings The following settings must be made in DM 6642 when using the CPM1 CPM1A s high speed counter function DM 6642 Bit Function Settings Bits Incrementing Up Down Not used 00 to 03 Sets the counter mode 0 Up down 4 Incrementing 4 0 0 or 4 04 to 07 Sets the res...

Page 109: ... 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0 1 2 1 2 3 4 Phase A Phase B Up Down Mode Count Incremented Decremented Count Pulse input Incrementing Mode Incremented only ON OFF ON OFF ON OFF Note One of the reset methods described below should always be used to reset the counter when restarting it The counter will be automatically reset when program execution is started or stopped The following signal transition...

Page 110: ... it to be read reliably it must be ON for at least one cycle The Z in phase Z is an abbreviation for Zero It is a signal that shows that the encoder has completed one cycle High speed Counter Interrupt Count For high speed counter 0 interrupts a comparison table is used instead of a count up The count check can be carried out by either of the two methods de scribed below In the comparison table co...

Page 111: ...peration may not work correctly if the comparison opera tion is started immediately after changing the current value from the program The comparison operation will automatically return to the first target value once an interrupt has been generated for the last target value Repetitious operation is thus possible merely by changing the current value Programming Use the following steps to program the...

Page 112: ...01 000 To start comparisons again set the second operand to 000 execute com parison and execute the INI 61 instruction Once a table has been saved it will be retained in the CPM1 CPM1A during operation i e during program execution as long as no other table is saved Reading the PV There are two ways to read the PV The first is to read it from SR 248 and SR 249 and the second to use the PRV 62 instr...

Page 113: ...speed counter with single phase inputs in the Incrementing Mode making comparisons by means of the target matching method The comparison conditions target values and count directions are stored in the comparison table with the subroutine numbers Up to 16 target values can be stored The corresponding subroutine is executed when the counter s PV matches the target value The following data is stored ...

Page 114: ...d set the remaining sub routine numbers to FFFF A value of FFFF indicates that no subroutine is to be executed The following data is stored for the comparison table DM 0000 1500 DM 0001 0000 Lower limit 1 1 500 counts DM 0002 3000 DM 0003 0000 Upper limit 1 3 000 counts DM 0004 0040 Range 1 interrupt subroutine no 40 DM 0005 7500 DM 0006 0000 Lower limit 2 7 500 counts DM 0007 0000 DM 0008 0001 Up...

Page 115: ...1 V2 has only one type of interrupt processing as outlined below Interval Timer Interrupts Interrupt processing is executed by an interval timer with a precision of 0 1 ms 2 4 2 Interval Timer Interrupts The SRM1 V2 is equipped with one interval timer When the interval timer times out the main program is interrupted and the interrupt program is executed immediately regardless of the point in the c...

Page 116: ...s C2 Decrementing counter set value 4 digits BCD 0000 to 9999 C2 1 Decrementing time interval 4 digits BCD unit 0 1 ms 0005 to 0320 0 5 ms to 32 ms The meanings of the settings are the same as for the one shot mode but in the scheduled interrupt mode the timer PV will be reset to the set value and decrementing will begin again after the subroutine has been called In the scheduled interrupt mode in...

Page 117: ...ecifies the first word containing the set value Specifies the subroutine number only lower by tes are effective 25315 First Cycle Flag ON for 1 cycle In this example an interrupt is generated every 4 0 ms 1 0 ms 4 after input 00005 goes ON the interrupts execute interrupt subroutine number 23 MOV 21 0004 DM 0010 MOV 21 0010 DM 0011 SBN 92 023 RET 93 STIM 69 003 DM 0010 0023 00005 25315 First Cycle...

Page 118: ...motor Pulse outputs Motor controller Item Single phase pulse outputs i Variable duty ratio pulse Single phase pulse outputs with trapezoidal acceleration deceleration pu se ou pu s without accel decel a o pu se outputs Pulse direction outputs Up down pulse outputs Execution instructions PULS 65 and SPED 64 PWM PULS 65 and ACC Output number 01000 Pulse output 0 See note 1 Pulse output 0 See note 1 ...

Page 119: ...ut Fixed duty ratio Can use two points simultaneously independently Can use one point at a time independently Cannot be used Cannot be used Variable duty ratio Can use one point at a time independently Can use two points simultaneously independently Cannot be used Cannot be used Pulse direction output Cannot be used Cannot be used Cannot be used Cannot be used Up down pulse output Cannot be used C...

Page 120: ... 1 Hz Output destination Output number 01000 Word 010 bit 00 Output number 01001 Word 010 bit 01 Pulses can be output simultaneously and indepen dently from two points Output mode Continuous Instruction PWM With PWM pulses are output with a variable duty ratio Instruction execution PWM Pulses are output at the set frequency until stopped Duty ratio D ton T ton Single phase Pulse Outputs With Trape...

Page 121: ... pulse outputs are started From when the pulse outputs are started until they are stopped they are controlled at a constant ratio frequency change Independent Mode Instruction execution PULS 65 ACC Independent mode Pulse output frequency Target frequency Starting frequency 0 Hz Acceleration Start ACC Deceleration Time In independent mode deceleration is carried out at the acceleration deceleration...

Page 122: ...2 For reading the pulse output PV and status Single phase Pulse Outputs PULS 65 SET PULSES instruction SPED 64 SPEED OUTPUT instruction Pulse output 0 Pulse output 1 Specify relative or absolute pulses Pulse output SV 8 digits BCD INI 61 MODE CONTROL instruction Stop pulse outputs Change pulse output PV PC Setup DM 6629 bits 04 to 07 Output mode Continuous or Independent Target frequency 10 Hz to ...

Page 123: ...the CPM2C outputs as shown in the following illustration Pulses can be output independently from pulse outputs 0 and 1 Note The following examples are for Fujitsu compatible connectors Output bit ad dresses and connector pin numbers depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails 01000 Pulse output 0 single phase output 01001 Pulse ou...

Page 124: ...utput in independent mode SPED 64 Set frequency and start pulse outputs Sets the frequency for outputs in the independent mode or continuous mode and starts the pulse outputs Change frequency Changes the frequency for outputs in the independent mode or continuous mode Stop pulse outputs Stops the pulse outputs by changing the speed to a frequency of 0 Hz INI 61 Stop pulse outputs Stops the pulse o...

Page 125: ... set for pulse output 1 ON Set by PULS 65 OFF Not set 14 Pulse output completed for pulse output 1 ON Completed by SPED 64 OFF Not completed 15 Pulse output in progress for pulse output 0 ON In progress by SPED 64 OFF Stopped Set Number of Pulses Specify the number of pulses to be output in independent mode Port specifier 000 Pulse output 0 010 Pulse output 1 Type of Pulse Output 000 Relative puls...

Page 126: ... Leftmost 4 digits Change PV data Rightmost leftmost digits Register the PV data to be changed 96 777 215 to 16 777 215 Negative numbers are expressed by turning ON the leftmost bit INI 61 P 004 C2 C2 C2 1 The pulse output PV can only be changed or reset while pulse outputs are stopped Check to be sure that the Pulse Output In Progress Flags AR 1115 and AR 1215 have been turned OFF Stop Pulse Outp...

Page 127: ... not being used When the PV is read by executing PRV 62 words 228 to 231 are refreshed with the same timing Read Pulse Output Status This function reads the pulse output status Using an Instruction Port specifier 000 Pulse output 0 010 Pulse output 1 Control designation 001 Read pulse output status Word for storing pulse output status Pulse output in progress 0 Stopped 1 Output in progress Pulse o...

Page 128: ...atus and Operation Independent Mode Without Acceleration and Deceleration Frequency PULS 65 execution SPED 64 execution Output in progress Output completed Number of pulses set Time Continuous Mode Frequency SPED 64 execution Output in progress Output completed Number of pulses set Time INI 61 execution Stopping Output in Independent Mode Without Acceleration and Deceleration Frequency PULS 65 exe...

Page 129: ...Wire the CPM2A to the motor driver as shown in the following illustration Motor Driver Wire the CPM2C to the motor driver as shown in the following illustration In this case a CPU Unit with sinking transistor outputs is used Note The following examples are for Fujitsu compatible connectors Output bit ad dresses and connector pin numbers depend on the models Refer to the CPM2C Operation Manual W356...

Page 130: ...rts pulse output Pulse output 0 Independent mode Frequency 60 Hz PLUS 65 SPED 64 13 JOG Operation Explanation In this example when the execution condition 00005 turns ON JOG pulses are output at a frequency of 100 Hz from either output 01000 pulse output 0 or out put 01001 pulse output 1 When the execution condition 00005 turns OFF the output is stopped Switching between output 01000 pulse output ...

Page 131: ...ector See above note Note Refer to page operation manual for details on wiring outputs PC Setup Sets the coordinate system for pulse outputs 0 and 1 as relative Set for other than synchronized pulse control Set to 01 when using the high speed counter DM 6629 0 15 0 DM 6642 0 0 0 Programming 00005 Execution condition Detects turning ON of execution condition Detects turning OFF of execution conditi...

Page 132: ...n Every scan Every scan Immediately Pulse output status AR 11 AR 12 PRV 62 HIGH SPEED COUNTER PV READ instruction Read pulse output status PULSE WITH VARIABLE DUTY RATIO instruction Note The duty ratio is the ratio of ON time to pulse frequency Either 01000 or 01001 can be used Select either pulse output 0 or 1 Output number Pulse output number 01000 0 01001 1 Wire the CPM2A outputs as shown in th...

Page 133: ...TOR RUN or when the power supply is turned ON to the PC The following table shows the instruction operations related to pulse outputs with variable duty ratio Instruction Control Operation PWM Pulse output with variable duty ratio Sets the frequency and duty ratio and starts the pulse outputs Change duty ratio Changes the duty ratio during pulse while pulse outputs with variable duty ratio are alr...

Page 134: ...s Port specifier 000 Pulse output 0 010 Pulse output 1 Target frequency data word Target frequency Register the target frequency to be set 0001 to 9999 4 digits BCD 0 1 Hz to 999 9 Hz Duty ratio data word Duty ratio Register the duty ratio to be set 0000 to 0100 4 digits BCD 0 to 100 PWM P F D F D The pulse frequency cannot be changed while pulses are being output Stop Pulse Outputs This function ...

Page 135: ...h PRV 62 Relationship Between Status and Operation Continuous Mode Pulse Output With Variable Duty Ratio Frequency PWM execution INI 61 execution Output in progress Output completion Set number of pulses Time Application Example Explanation In this example when the execution condition 00005 turns ON variable duty pulses are output from output 01000 pulse output 0 at a frequency of 100 Hz The duty ...

Page 136: ...ing PC Setup High speed counter not used Set for other than synchronized pulse control DM 6642 0 0 15 0 Programming CPM2A Example 00005 Execution condition Detects turning OFF of execution condition Stops pulse output 0 Changes analog control 0 value to a value from 0 to 100 Value in SR 250 Analog control 0 in CPM2A PCs see note Divide value by 2 Duty ratio setting Pulse outputs with variable duty...

Page 137: ...tion Reads the value from the thumb rotary switch Value from the thumb rotary switch Duty ratio setting Variable duty pulse output Pulse output 0 Output frequency 100 Hz Duty ratio setting Stops pulse output 0 DIFD 14 20000 ANDW 34 000 000F DM0100 BCD 24 DM0100 DM0101 MUL 32 DM0101 0010 DM0102 PWM 000 1000 DM0102 INI 61 000 003 000 20000 END 01 ...

Page 138: ... the direction control method Pulse direction output or up down pulse output Pulse Outputs With Trapezoidal Acceleration and Deceleration PULS 65 SET PULSES instruction ACC ACCELERATION CONTROL instruction Pulse CW Direction CCW Specify relative or ab solute pulses set value 8 digits BCD INI 61 MODE CONTROL instruction Stop pulse outputs Change pulse output PV PC Setup DM 6629 bits 00 to 03 Mode d...

Page 139: ...tput Pulse Direction Outputs Up down Pulse Outputs Wire the CPM2C outputs as shown in the following illustration Note The following examples are for Fujitsu compatible connectors Output bit ad dresses and connector pin numbers depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails 01000 Pulse output 01001 Direction output 01000 CW output 010...

Page 140: ...celeration rate for outputs in independent mode or continuous mode and starts the pulse outputs Change frequency Changes the frequency during pulse output in continuous mode by accelerating or decelerating according to the specified acceleration deceleration rate Stop pulse outputs Decelerates pulse outputs to a stop according to the specified acceleration deceleration rate INI 61 Stop decelerate ...

Page 141: ...F Not completed 15 Pulse output in progress for pulse output 0 ON In progress by SPED 64 ACC or PWM OFF Stopped Set Number of Pulses Specify the number of pulses to be output in independent mode Fixed at 000 Pulse output 0 Type of Pulse Output 000 Relative pulses 001 Absolute pulses See note Beginning word of setting for number of pulses Rightmost 4 digits Leftmost 4 digits Number of pulses Rightm...

Page 142: ...tput mode designation Beginning word of settings table Output mode Specify the output mode 000 Up down pulse outputs independent mode 002 Pulse direction outputs independent mode Acceleration deceleration rate 0001 to 1000 BCD 10 Hz to 10 kHz Target frequency 0001 to 1000 BCD 10 Hz to 10 kHz Starting frequency 0000 to 1000 BCD 0 to 10 kHz Register the data for each frequency The acceleration decel...

Page 143: ...mode 013 Pulse direction output CCW continuous mode ACC 000 M T M T T 1 T 2 Time Acceleration deceleration rate 0001 to 1000 BCD 10 Hz to 10 kHz Target frequency 0001 to 1000 BCD 10 Hz to 10 kHz Starting frequency 0000 to 1000 BCD 0 to 10 kHz Register the data for each frequency The acceleration deceleration rate is the increase or decrease in the fre quency every 10 ms Change Pulse Output PV This...

Page 144: ... to PROGRAM mode Read Pulse Output PV This function reads the pulse output PV Using an Instruction Fixed at 000 Pulse output 0 Control designation 003 Read pulse output PV Beginning word for storing pulse output PV Pulse output PV rightmost leftmost digits The PV data that is read is stored here 96 777 215 to 16 777 215 Negative numbers are expressed by turning ON the leftmost bit Rightmost 4 digi...

Page 145: ... Not set 1 Set Pulse output completion 0 Not completed 1 Completed Pulse output status 0 Constant rate 1 Accelerating or decelerating PRV 62 000 001 D Using Data Areas As shown in the following illustration the pulse output status for pulse output 0 is stored in AR 1111 to AR 1115 AR 11 Pulse output 0 Pulse output completion 0 Not completed 1 Completed Pulse output in progress 0 Stopped 1 Output i...

Page 146: ...tput status Set number of pulses Time Frequency Continuous Mode with Acceleration and Deceleration 1 ACC execution 2 Output 0 in progress Output 1 in progress Output completion Output status Set number of pulses Time ACC execution 1 INI 61 execution Frequency Continuous Mode with Acceleration and Deceleration 2 ACC execution Stop Output 0 in progress Output 1 in progress Output completion Output s...

Page 147: ...ation and Deceleration 2 ACC execution Output 0 in progress Output 1 in progress Output completion Output status Set number of pulses Time Frequency PULS 65 execution ACC execution Application Example Positioning Explanation In this example when the execution condition 00005 turns ON 1000 pulses are output from output 01000 pulse output 0 in a trapezoidal acceleration de celeration pattern as show...

Page 148: ...following examples are for Fujitsu compatible connectors Output bit ad dresses and connector pin numbers depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails Motor Driver 24 VDC Output connector See above note Note Refer to the operation manual for details on wiring PC Setup Sets the coordinate system for pulse output 0 as relative High sp...

Page 149: ...his example when the execution condition 00005 turns ON JOG pulses are output at a frequency of 100 Hz from either output 01000 CW direction or out put 01001 CCW direction When the execution condition 00005 turns OFF the output is stopped As shown in the following diagram the JOG pulses are accelerated and decelerated at the start and stop of the operation Switching be tween output 01000 CW direct...

Page 150: ...onnectors Output bit ad dresses and connector pin numbers depend on the models Refer to the CPM2C Operation Manual W356 or the CPM2C S Operation Manual W377 for de tails Motor Driver 24 VDC Output connector See above note Note Refer to the operation manual for details on wiring PC Setup Sets the coordinate system for pulse output 0 as relative High speed counter not used Set for other than synchro...

Page 151: ...up down pulses CW direction Beginning word of settings table Output in CCW direction Pulse output 0 ACC Continuous mode up down pulses CCW direction Beginning word of settings table Acceleration deceleration rate 10 Hz 10 ms Target frequency 500 Hz Starting frequency 200 Hz Deceleration stop Pulse output 0 Beginning word of settings table Acceleration deceleration rate 10 Hz 10 ms Target frequency...

Page 152: ...1 to 16 777 215 Refer to the CPM1A Operation Manual W317 for details on hardware connec tions to output points and ports Continuous mode Independent mode Pulses are output at the specified frequency until stopped Pulse output is stopped automatically when the specified number of pulses has been output Specified number of pulses Stepping motor Control input Motor controller CW CCW control output Pu...

Page 153: ...004 turns ON and is stopped after the specified number of pulses have been output The pulse amount is set in DM 0100 and DM 0101 PULS 65 000 000 DM 0100 SPED 64 000 000 0100 Sets the number of pulses Begins pulse output Pulse number setting 00004 pulse output condition 00004 pulse output condition Independent mode Pulse frequency 1 kHz 2 6 3 Using Pulse Output Instructions Before beginning pulse o...

Page 154: ...ED 64 At that time set the operands other than the frequency to the same settings as at the beginning of pulse output SPED 64 M P F P 3 digits BCD Same as at beginning of pulse output M 3 digits BCD Same as at beginning of pulse output F 4 digits BCD For the changed pulse output frequency specify a constant or word contents The specified value and set frequency are as follows Specified value 0002 ...

Page 155: ...put Item Input mode Differential phase input mode Pulse direction input mode Up down pulse input mode Increment mode Input b 00000 Phase A input Count input CW input Count input p number 00001 Phase B input Direction input CCW input See note 1 Input method Differential phase input 4X Single phase input Single phase input Single phase input Input frequency range 10 to 500 Hz accuracy 1 Hz 20 Hz to ...

Page 156: ...time constant See note Clock Can be used simultaneously Note When inputs 00000 and 00001 are set for use as synchronized pulse control in puts the input time constant settings for the affected inputs are disabled The input time constants remain in effect however for the values for refreshing the relevant input data area The relationship between the pulse input frequency and the pulse output fre qu...

Page 157: ...us Input numbers 00000 00001 and 0002 Settings for synchronized pulse control Input mode input frequency PC Setup DM 6642 bits 08 to 15 Encoder inputs Input mode Count Differential phase input Pulse direction input Up down input Increment input Ladder diagram program INI 61 MODE CONTROL instruction Stop synchronized pulse control Every scan Counter frequency PV SR 249 SR 248 PRV 62 Immediately HIG...

Page 158: ...differential phase signals phase A and phase B with a multi plication factor of 4 Phase A Phase B Nms Frequency 1 000 N ON OFF ON OFF Pulse Direction Input Mode In the pulse direction input mode pulse signals and direction signals are input and the count is incremented or decremented according to the direction signal status Nms Frequency 1 000 N Pulse inputs Direction inputs ON OFF ON OFF Up Down ...

Page 159: ... as ordinary inputs Nms Frequency 1 000 N Pulse inputs ON OFF Wiring the Inputs Input Wiring Wire the CPM2A inputs as shown in the following diagram Differential Phase Input Mode Up Down Pulse Input Mode Pulse Direction Input Mode Increment Mode 00000 Phase A input 00001 Phase B input 00002 Phase Z input 00000 CW input 00001 CCW input 00000 Pulse input 00001 Direction input 00000 Pulse input ...

Page 160: ...nual W377 for de tails Differential Phase Input Mode Up Down Pulse Input Mode Pulse Direction Input Mode Increment Mode 00000 Phase A input 00001 Phase B input 00002 Phase Z input 00000 CW input 00001 CCW input 00000 Pulse input 00001 Direction input 00000 Pulse input Input connector Input connector Input connector Input connector See above note See above note See above note See above note Output ...

Page 161: ...high speed counter 02 Use as synchronized pulse control 10 Hz to 500 Hz 03 Use as synchronized pulse control 20 Hz to 1 kHz 04 Use as synchronized pulse control 300 Hz to 20 kHz 02 03 04 The settings will go into effect when the mode is changed from PROGRAM to MONITOR RUN or when the power supply is turned ON to the PC The following table shows the instruction operations related to synchronized pu...

Page 162: ...hen using SYNC to specify a frequency scaling factor be careful to keep the pulse output frequency below 10 kHz Change Frequency Scaling Factor This function changes the frequency scaling factor during synchronized control during pulse output by specifying the bits for pulse outputs 01000 01001 and the frequency scaling factor 1 to 1 000 and executing SYNC Stop Synchronized Control This function s...

Page 163: ...r storing synchronized control status PRV 62 000 001 D Port specifier 000 Status of pulse output 0 0 Stopped 1 Pulse output in progress Port specifier 010 Status of pulse output 1 0 Stopped 1 Pulse output in progress Using Data Areas As shown in the following illustration the status of pulse output 0 is stored in AR 1115 and the status of pulse output 1 is stored in AR 1215 AR 11 Status of pulse o...

Page 164: ...ulse control is started and pulses are output from output 01000 pulse output 0 according to the pulses input by the high speed counter At this time the fre quency scaling factor can be changed by means of analog control 0 When the execution condition 00005 turns OFF synchronized pulse control is stopped Wiring Wire the CPM2A as shown in the following illustration Rotary encoder Motor driver Brown ...

Page 165: ...ring to inputs refer to the CPM2A Operation Manual W352 CPM2C W356 Opera tion Manual CPM2C S Operation Manual W377 PC Setup 0 Differential phase input 02 Use as pulse synchronization output DM 6642 0 2 0 0 15 0 Programming Example for CPM2A Detects the turning OFF of the execution condition Sets DM 0000 to 1 when analog control 0 is set to 0 The analog controls are built into the CPM2A PCs but not...

Page 166: ...PM2C Execution condition Detects OFF to ON transition in execution condition Executes synchronized pulse control High speed counter Pulse output 0 First word containing frequency factor Stops synchronized pulse control DIFD 14 20000 SYNC 000 000 DM0000 00005 INI 000 005 000 20000 END 01 ...

Page 167: ... start of actual pulse output Pulse output Delay Maximum delay ms One period of the pulse input x 2 16 25 Pulse input There will be a delay before a change in the frequency during pulse output is actually applied to the output when performing synchronized pulse control as shown below Delay Maximum delay ms One period of the current pulse output 2 10 Pulse output Pulse input The following diagram s...

Page 168: ...l thus be 990 to 1010 Hz The multiplication factor of 300 however would make this 2970 to 3030 Hz There would also be an error of 1 in the frequency of the output pulse so the output would be in the range 2940 to 3060 Hz 2 9 Analog I O Functions CPM1 CPM1A CPM2A CPM2C Only One or more Analog I O Units can be connected to the PC to provide analog I O One Analog I O Unit allows 2 analog inputs and 1...

Page 169: ...rn the power off and on again to make the new setting effective Slave Interrupts Input bits in IR 000 to IR 007 and output bits in IR 010 to IR 017 are used as inter rupts for CompoBus S I O Terminals The CompoBus S I O Terminal interrupts IN 0 to 15 and OUT 0 to 15 are allocated as indicated in the following table IN0 to IN15 are the node addresses for the Input Terminals and OUT0 to OUT15 are th...

Page 170: ...put terminals and OUT0 to OUT15 are the output termi nals 2 When the maximum number of CompoBus S units is set to 16 IN8 to IN15 and OUT8 to OUT15 cannot be used 3 The Slave Add Flag turns ON when a slave joins the communications When the power to the CPU Unit is turned OFF and ON again all bits will turn OFF 4 The Slave Communications Error Flag turns ON when a slave participating in the network ...

Page 171: ...ive Flag AR0510 Slave 2 communications normal 20100 00100 02900 2 13 Analog Controls CPM1 CPM1A CPM2A Only The PCs are equipped with analog controls that automatically transfer the set tings on the CPU Unit s adjustment switches to words in the CPU Unit s I O me mory This function is very useful when there are set values that need to be pre cisely adjusted during operation These set values can be ...

Page 172: ...ng for control 1 is in SR 251 CPM1 The analog setting for control 0 is in SR 250 The analog setting for control 1 is in SR 251 CPM1A CPM2A Note The above diagram shows the CPM2A but the settings are the same for the CPM1A Caution The analog setting may change with changing temperatures Do not use the analog adjustment controls for applications that require a precise fixed setting ...

Page 173: ...ewdriver to adjust the analog controls The set values can be checked by connecting a Programming Device such as a Programming Console and reading the values stored in SR 250 and SR 251 Analog control 0 Analog control 1 The following table shows the words and bits where the analog settings are stored Word Bit Name Value SR 250 00 to 15 Analog control 0 SV storage area 0000 to 0200 BCD SR 251 00 to ...

Page 174: ...tion I O refreshing Overseeing processes Program execution I O refreshing Input signal 00003 IR 00003 One cycle CPU Unit Input bits Min input pulse width 10 point CPU Units IR 00003 to IR 00004 0 2 ms 20 30 40 point CPU Units IR 00003 to IR 00006 The input bits in the above table can be set as quick response inputs in DM 6628 as shown in the following table Word Settings DM 6628 0 Normal input DM ...

Page 175: ...The following table shows the relationships between quick response inputs and the CPM2A CPM2C s other functions Function Interval timer interrupts Synchronized pulse control Can be used simultaneously Interrupt inputs See note 1 Interval timer interrupts Can be used simultaneously High speed counters Can be used simultaneously Interrupt inputs counter mode See note 2 Pulse outputs Can be used simu...

Page 176: ...inputs Quick response inputs Quick response input 0 Quick response input 1 Quick response input 2 Quick response input 3 Quick response PC Setup DM 6628 Wire the CPM2A s inputs as shown in the following diagram Input 00003 Quick response input 0 Input 00004 Quick response input 1 Input 00005 Quick response input 2 Input 00006 Quick response input 3 Wiring the Inputs ...

Page 177: ...se input 1 See above note CPU Units with 20 32 I O Points 00006 Quick response input 3 00005 Quick response input 2 00003 Quick response input 0 00004 Quick response input 1 Input connector See above note To use quick response inputs with the CPM2A or CPM2C make the following settings in the System Setup Area DM 6628 from a Programming Device Word Bits Function Setting DM 6628 00 to 03 Interrupt s...

Page 178: ...3 The contents of SR 236 through SR 239 results of the subroutine execu tion will be transferred to the four consecutive words beginning with the first output word 4 MCRO 99 will then be finished When MCRO 99 is executed the same instruction pattern can be used as needed simply by changing the first input word or the first output word The following restrictions apply when the macro function is use...

Page 179: ...ed Macro used Subroutine used to define macro 2 16 Calculating with Signed Binary Data The CPM1 CPM1A CPM2A SRM1 V2 allow calculations on signed binary data The following instructions manipulate signed binary data Signed data is handled using 2 s complements The following signed binary instructions are available in CPM2A CPM2C and SRM1 V2 PCs BINARY ADD ADB 50 BINARY SUBTRACT SBB 51 2 S COMPLEMENT...

Page 180: ...onsole or SSS can be done using decimal inputs and mnemonics for the instructions The procedure to using the Programming Console to input using decimal values is shown in the CPM1 Operation Manual CPM1A Operation Manual CPM2A Operation Manual CPM2C Operation Manual andSRM1 Master Control Unit Operation Manual Refer to the SSS Op eration Manual C series PCs for details on using the SSS Inputting In...

Page 181: ...mming The assignments of expansion instructions in the instructions table will change the meaning of instructions and operands so be sure to set the instructions table before programming and transfer the proper instructions table to the CPM2A CPM2C or SRM1 V2 before program execution Example CPM2A CPM2C PCs The specific instructions used in the following example are for the CPM2A CPM2C The concept...

Page 182: ...peration Manual for the Programming Console procedure Refer to the SSS Operation Manual C series PCs for the SSS procedure Refer to the SYSMAC CPT Support Software Quick Start Guide W332 and User Manual W333 for the SYSMAC CPT Support Software procedure The expansion instructions that can be used are listed below along with the de fault function codes that are assigned when the PC is shipped Mnemo...

Page 183: ...peration Manual for the Programming Console procedure Refer to the SSS Operation Manual C series PCs for the SSS procedure Refer to the SYSMAC CPT Support Software Quick Start Guide W332 and User Manual W333 for the SYSMAC CPT Support Software procedure The expansion instructions that can be used are listed below along with the de fault function codes that are assigned when the SRM1 V2 is shipped ...

Page 184: ... AR 21 to be overwritten 2 Using a Programming Device set AR 18 through AR 20 minute second date hour and year month and AR 2100 through AR 2107 day of week 3 Turn ON AR 2115 Clock Set Bit when the time set in step 2 is reached The clock will start operating from the time that is set and the Clock Stop Bit and Clock Set BIt will be turned OFF automatically Setting Only the Seconds It is also possi...

Page 185: ...bed in the same section even though they are supported by different PCs 3 1 Analog I O Units 166 3 1 1 CPM1A MAD01 Analog I O Unit 166 3 1 2 CPM1A MAD11 and CPM2C MAD11 Analog I O Units 177 3 2 Temperature Sensor Units 193 3 2 1 CPM1A CPM2A Temperature Sensor Units 193 3 2 2 CPM2C Temperature Sensor Units 194 3 2 3 Using Temperature Sensor Units 195 3 2 4 Connecting Temperature Sensor Units 195 3 ...

Page 186: ...s The analog output range can be set to 0 to 10 VDC 4 to 20 mA or 10 to 10 VDC The output has a resolution of 1 256 when the range is set to 0 to 10 VDC or 4 to 20 mA or a resolution of 1 512 when set to 10 to 10 VDC A maximum of 3 Expansion Units or Expansion I O Units can be connected CPM1 V1 CPM1A CPM2A CPU Unit CPM1A 20EDR1 Expansion I O Unit CPM1A 8ED Expansion I O Unit CPM1A MAD01 Analog I O...

Page 187: ...time 10 ms max per Unit See note 2 Isolation method Photocoupler isolation between I O terminals and PC signals No isolation between analog I O signals Note 1 With analog outputs it is possible to use both voltage outputs and current outputs at the same time In this case however the total output current must not exceed 21 mA 2 The conversion time is the total time for 2 analog inputs and 1 analog ...

Page 188: ...ignal Ranges 0 to 10 V inputs 1 to 5 V inputs 4 to 20 mA inputs Conversion value Conversion value Conversion value Input signal Input signal Input signal 3 V 1 V Analog Output Signal Ranges 10 to 10 V outputs Set value Set value 4 to 20 mA outputs Set value 0 to 10 V output ...

Page 189: ... input Read converted data Analog output Write set value Analog Inputs CPU Unit Analog I O Unit Ladder program Word n 1 MOVE instruction Writes the range code Reads the conversion value Where m is the last input word and n is the last output word allocated to the CPU Unit or previous Expansion Unit or Expansion I O Unit Analog devices Temperature sensor Pressure sensor Speed sensor Flow sensor Vol...

Page 190: ...Unit 21 The I O signal range is set by wiring the I O terminal and by writing the range code to the Analog I O Unit s output word I O Terminal Arrangement Note When using current inputs short terminal V IN1 with I IN1 and terminal V IN2 with I IN2 V OUT Voltage output I OUT Current output COM Output common V IN1 Voltage input 1 I IN1 Current input 1 COM1 Input common 1 V IN2 Voltage input 2 I IN2 ...

Page 191: ...analog I O values until the range code has been written Once the range code has been set it is not possible to change the setting while power is being supplied to the CPU Unit To change the I O range turn the CPU Unit OFF then ON again Note If a range code other than those specified in the above table is written to n 1 the range code will not be received by the Analog I O Unit and analog I O conve...

Page 192: ... address 30 point CPU Unit Analog I O Unit IR 000 IR 001 IR 010 IR 011 IR 002 IR 003 IR 012 Wiring Analog I O Devices Analog Input Wiring 2 core shielded twisted pair cable Analog output device voltage output Analog output device current output Analog I O Unit 250 Ω 250 Ω 10 kΩ 10 kΩ Analog Output Wiring Voltage Outputs 2 core shielded twisted pair cable Analog I O Unit Analog input device voltage...

Page 193: ...de has been specified Refer to page 170 Write the range code to the Analog I O Unit s output word in the first cycle of op eration the Analog I O Unit s output word is n 1 when n is the last word allo cated to the CPU Unit or previous Expansion Unit or Expansion I O Unit in the configuration Reading Converted Analog Input Values A ladder program can be used to read the memory area where the conver...

Page 194: ...t the beginning of the program to delay reading converted data from analog inputs until conversion is actually possible Note Analog input data will be 0000 until initial processing has been completed Ana log output data will be 0 V or 0 mA until the range code has been written After the range code has been written the analog output data will be 0 V or 4 mA if the range is 0 to 10 V 10 to 10 V or 4...

Page 195: ...ways ON Flag Open circuit alarm MOV 21 FF04 011 TIM 000 0003 MOV 21 001 DM0000 Execution condition TIM000 Execution condition TIM000 01000 MOV 21 002 DM0001 Execution condition TIM000 MOV 21 DM0010 011 Execution condition TIM000 00215 Example Analog Input Program Example Analog I O Unit Connection In this example an Analog I O Unit is connected to a CPU Unit with 30 I O points I O words are alloca...

Page 196: ...ge 4 to 20 mA Output signal range 0 to 10 V Range Code Setting FF04 IR 012 Range code FF04 Program 25135 First Cycle ON Flag 25313 Always ON Flag MOV 21 FF04 012 TIM 000 0003 MOV 21 002 DM0000 Execution condition TIM000 MOV 21 003 DM0001 Execution condition TIM000 MOV 21 DM0010 012 Execution condition TIM000 Writes the range code FF04 to the Unit Reads analog input 1 s converted value Reads analog...

Page 197: ... O Unit 1 analog output 2 analog inputs A maximum of 5 Expansion Units or Expansion I O Units including up to 4 CPM2C MAD11 Analog I O Units can be connected to a CPM2C A maximum of 3 Units can be connected to the CPM2C S One Analog I O Unit allows 2 ana log inputs and 1 analog output With the maximum of 4 Analog I O Units con nected 8 analog inputs and 4 analog outputs are possible CPM2C CPU Unit...

Page 198: ...to 20 mA or 4 to 20 mA Allowable external output load resistance 1 kΩ min 600 Ω max External output impedance 0 5 Ω max Resolution 1 6000 full scale Overall accuracy 25 C 0 4 full scale y 0 to 55 C 0 8 full scale Set data D A conversion 16 bit binary 4 digit hexadecimal Full scale for 10 to 10 V F448 to 0BB8 Hex Full scale for other ranges 0000 to 1770 Hex Conversion time 2 ms point 6 ms all point...

Page 199: ...ing for analog input 0 OFF Average processing not performed ON Average processing performed Average processing for analog input 1 OFF Average processing not performed ON Average processing performed Input type for analog input 0 OFF Voltage input ON Current input Input type for analog input 1 OFF Voltage input ON Current input ON 1 2 3 4 Caution Do not touch the DIP switch during operation Static ...

Page 200: ... exceeds the specified range the AD converted data will be fixed at either the lower limit or upper limit 10 to 10 V The 10 to 10 V range corresponds to the hexadecimal values F448 to 0BB8 3000 to 3000 The entire data range is F31C to 0CE4 3300 to 3300 A neg ative voltage is expressed as a two s complement Converted Data Hexadecimal Decimal 0CE4 3300 0BB8 3000 11 V 10 V 0 V 10 V 11 V F448 3000 F31...

Page 201: ...to 6000 The entire data range is FED4 to 189C 300 to 6300 Inputs between 0 8 and 1 V are expressed as two s complements If the input falls below 0 8 V open circuit detection will activate and converted data will be 8000 Converted Data Hexadecimal Decimal 189C 6300 1770 6000 0000 0 FED4 300 0 8 V 1 V 5 V 5 2 V 0 to 20 mA The 0 to 20 mA range corresponds to the hexadecimal values 0000 to 1770 0 to 6...

Page 202: ... values depend on the output signal ranges as shown in the following diagrams 10 to 10 V The hexadecimal values F448 to 0BB8 3000 to 3000 correspond to an analog voltage range of 10 to 10 V The entire output range is 11 to 11 V Specify a negative voltage as a two s complement Conversion Data Hexadecimal Decimal 11 V 10 V F31C 3300 F448 3000 0000 0 0 V 10 V 11 V 8000 7FFF 0BB8 3000 0CE4 3300 0 to 1...

Page 203: ...rent range of 4 to 20 mA The entire output range is 3 2 to 20 8 mA Conversion Data Hexadecimal Decimal 20 8 mA 20 mA 4 mA 3 2 mA 0 mA FED4 300 1770 6000 189C 6300 8000 0000 0 7FFF The averaging function can be enabled for inputs using the DIP switch The averaging function stores the average a moving average of the last eight input values as the converted value Use this function to smooth inputs th...

Page 204: ... 10 VDC 0 to 20 mA or 4 to 20 mA Set inputs as voltage or analog and set the averaging function Connect the Analog I O Unit Connect analog I O devices Write the range code Analog inputs Read converted data Analog output Write set values Analog Inputs CPU Unit Analog I O Unit Ladder program Word n 1 MOVE instruction Writes the range code Reads the converted values Where m is the last input word and...

Page 205: ...g I O Units can be connected to one CPM2A or CPM1A PC When the Analog I O Unit is used in combination with other Expansion Units or Expansion I O Units there are no restrictions on the connection order CPM1A CPM2A CPU Unit CPM1A MAD11 Analog I O Unit I O Allocation I O is allocated for the Analog I O Unit in the same way as other Expansion Units or Expansion I O Units starting from the next word f...

Page 206: ...power consumption of the CPU Unit Expansion Units and Expansion I O Units does not exceed the total power capacity of the service power supply from the Power Supply Unit 24 V 600 mA 14 4 W CPU Unit with 4 W power consumption Connect no more than two CPM2C MAD11 Units CPU Unit with 3 W power consumption Connect no more than three CPM2C MAD11 Units CPU Unit CPM2C MAD11 Analog I O Units Expansion I O...

Page 207: ...ange Analog output signal range 000 10 to 10 V 10 to 10 V 001 0 to 10 V 0 to 10 V 010 1 to 5 V or 4 to 20 mA 1 to 5 V 011 0 to 5 V or 0 to 20 mA 0 to 20 mA 100 4 to 20 mA Note Be sure to write the correct terminals Write the range codes to the Analog I O Unit s output word n 1 in the first cycle of program execution n 1 Analog output Analog input 1 Analog input 0 1 0 0 0 0 0 0 15 8 7 6 5 4 3 2 1 0...

Page 208: ...250 Ω COM 0 V IN V IN 1 COM 1 Internal circuits COM V OUT I OUT AG NC NC I IN 0 I IN 1 CPM1A MAD11 Terminal Arrangements I OUT V OUT COM NC NC I IN0 V IN0 COM1 NC NC I IN1 V IN0 COM0 AG Label Signal V OUT Voltage output I OUT Current output COM Output common V IN0 Voltage input 0 I IN0 Current input 0 COM0 Input common 0 V IN1 Voltage input 1 I IN1 Current input 1 COM1 Input common 1 Note For curr...

Page 209: ...on and the Power Supply Unit CPM2C MAD11 Internal Circuits Analog Inputs Analog Outputs Analog ground Input 0 Input 1 Analog ground Output Internal circuits 510 kΩ 510 kΩ 510 kΩ 510 kΩ 250 Ω 250 Ω 0 0 1 1 Internal circuits V I AG NC NC CPM2C MAD11 Terminal Arrangements Analog Input Terminals Analog input 0 Analog input 0 Analog input 1 Analog input 1 Analog ground Analog Output Terminals Analog vo...

Page 210: ...uit detection function will not operate Also if there is an open circuit at C the open circuit detection function will not operate because the negative sides are the same Analog input device 1 Analog input device 2 24 VDC A B C For example if analog input device 2 is outputting 5 V and the same power sup ply is being used as shown above about 1 3 or 1 6 V will be applied at the input for input dev...

Page 211: ...rted The following instructions can be placed at the begin ning of the program to delay reading converted data from analog inputs until con version is actually possible Note Analog input data will be 0000 until initial processing has been completed Ana log output data will be 0 V or 0 mA until the range code has been written After the range code has been written the analog output data will be 0 V ...

Page 212: ...the Unit Reads analog input 0 s converted value Reads analog input 1 s converted value The content of DM 0010 is written to the output word as the analog output set value 25313 Always ON Flag Open circuit alarm MOV 21 8051 011 TIM 005 0002 MOV 21 001 DM0000 Execution condition TIM005 CMP 20 002 8000 Execution condition TIM005 01000 25506 MOV 21 002 DM0001 Execution condition TIM005 MOV 21 DM0010 0...

Page 213: ...ts Thermocouples or platinum resistance thermometers CPM1A 20EDR1 Expansion I O Unit CPM1A 8ED Expansion I O Unit CPM1A or CPM2A CPU Unit Specifications Item CPM1A TS001 CPM1A TS002 CPM1A TS101 CPM1A TS102 Temperature sensors Thermocouples Switchable between K and J but same type must be used for all inputs Platinum resistance thermometer Switchable between Pt100 and JPt100 but same type must be u...

Page 214: ...m resistance thermometers Specifications Item CPM2C TS001 CPM2C TS101 Temperature sensors Thermocouples Switchable between K and J but same type must be used for all inputs Platinum resistance thermometer Switchable between Pt100 and JPt100 but same type must be used for all inputs Number of inputs 2 Allocated input words 2 Max number of Units See note 1 4 4 Accuracy The larger of 0 5 of converted...

Page 215: ...nsor Units just like other Expansion I O Units and Expansion Units In the order in which the Units are connected A Tem perature Sensor Unit will thus be allocated the next input words after the Unit to which it is connected CPU Unit or other Unit Note Only one 4 input Temperature Sensor Unit CPM1A TS002 or CPM1A TS102 4 words allocated can be mounted to the CPU Unit There are however no restrictio...

Page 216: ...c ed e e a e no restrictions on the order in which Units are connected Expansion I O Units With 8 or 20 I O points are connected Analog I O Units CPM1A MAD01 CompoBus S I O Link Unit CPM1A SRT21 Word Allocations The CPM1A TS002 and CPM1A TS102 are allocated four words each one for each input point No output words are allocated Input word addresses Output word addresses 60 point CPU Unit 20 point E...

Page 217: ...put words after the Unit to which it is connected CPU Unit or other Unit No output words are allocated 20 point CPU Unit Inputs IR 000 Outputs IR 010 CPM2C TS001 Temperature Sensor Unit CPM2C TS001 Temperature Sensor Unit CPM2C TS101 Temperature Sensor Unit CPM2C TS101 Temperature Sensor Unit CPM2C 24EDTC Expansion I O Unit Inputs IR 009 Outputs IR 011 Inputs IR 001 IR 002 Outputs None Inputs IR 0...

Page 218: ...ed to set the temperature input range Temperature input terminals Cold junction compensator TS001 only Expansion I O connector input Expansion I O connector output The DIP switch is used to set the temperature unit C or F and the number of decimal places used ON 1 2 CPM1A TS CPM2C TS SW1 ON ON 1 2 F C 0 01 1 or 0 1 SW1 Setting 1 Temperature unit OFF C p ON F 2 Number of decimal places used OFF Nor...

Page 219: ...rted correctly if the tem perature range does not match the sensor Caution Do not set the temperature range to any values other than those for which tem perature ranges are given in the following table An incorrect setting may cause operating errors Setting CPM1A TS001 002 CPM2C TS001 CPM1A TS101 102 CPM2C TS101 Input type Range C Range F Input type Range C Range F 0 K 200 to 1 300 300 to 2 300 Pt...

Page 220: ...nput 3 Temperature input 2 Temperature input 3 Input 0 Temperature input 0 Temperature input 1 Cold junction compensator Input 1 Input 0 Input 1 NC NC NC NC Note When using a Temperature Sensor Unit with a thermocouple input observe the following precautions Do not remove the cold junction compensator attached at the time of deliv ery If the cold junction compensator is removed the Unit will not b...

Page 221: ... NC NC NC NC NC NC NC Pt Pt CPM1A TS102 Either Pt100 or JPt100 platinum resistance thermometers can be connected but all four of the thermometers must be of the same type and the same input range must be used for each Input 2 A Input 3 A Input 2 B Input 3 B Temperature input 2 Temperature input 3 Input 3 B Input 2 B Input 0 A Input 1 A Input 0 B Input 1 B Temperature input 0 Temperature input 1 In...

Page 222: ...re input 0 Temperature input 1 0A 0B 0B 1A 1B NC Pt Pt 3 2 7 Ladder Programming The temperature data will be stored in the input words allocated to the Tempera ture Sensor Unit in 4 digit hexadecimal CPM1A TS001 TS101 and CPM2C TS001 TS101 m is the last word allocated to the CPU Unit Expansion I O Unit or Expansion Unit connected immediately before the Temperature Sensor Unit Word Contents m 1 Con...

Page 223: ...e first data is converted The following instructions can be placed at the beginning of the pro gram and then IR 02000 can be used to delay reading converted data until con version is actually begun Always ON Flag User flag indicating that temperature data conversion has begun 02000 CMP 20 001 7FFE 25313 User defined flag indicating that initializa tion has been completed 25506 Note Input data will...

Page 224: ...rature Sensor Unit Inputs IR 000 Outputs IR 010 Inputs IR 001 IR 002 Outputs None Temperature unit setting OFF C Two decimal place Mode OFF normal Input range setting 1 K2 0 0 to 500 0 C Temperature input 0 storage word IR 001 Temperature input 1 storage word IR 002 ...

Page 225: ...ecimal point ON for an input 0 temperature error 02000 CMP 20 001 7FFE 25313 02001 CMP 20 002 7FFE Always ON Flag 01000 CMP 20 001 7FFF 02000 Execution condition CMP 20 001 1388 01001 BCD 24 001 DM0000 25313 Always ON Flag 01002 CMP 20 002 7FFF 02001 Execution condition 25506 CMP 20 002 1388 01003 25505 BCD 24 002 DM0001 25507 Converts the contents of IR 002 temperature data for input 1 to BCD and...

Page 226: ... IR 001 temperature data for input 0 to BCD and stores the result in DM 0000 Execution condition Detects an open circuit alarm or Unit error by check ing converted temperature data for the error code 7FFF 25313 Always ON Flag ON when an open circuit alarm or Unit error has been detected for input 0 Stores 0000 in DM 0001 When the input temperature data is negative con verts the contents of IR 001 ...

Page 227: ...01 DM0010 DM0000 25506 MOV 21 0001 DM0001 25504 CY 25504 CY Parameter settings for data conversion DM0010 DM0011 DM0012 0000 0001 0001 25313 Always ON Flag When the converted value is non negative stores 0000 in DM 0001 When the converted value is negative stores 0001 in DM 0001 Offset X Hex Y BCD Operation 163 162 161 160 IR 001 103 102 101 100 Binary to BCD conversion DM 0000 1 0 1 Negative 0 No...

Page 228: ...st digit after the decimal point 0 1 Treat any resolution above that specified for the normal data format as reference data The structure of the data stored in memory is shown below The value will be 100 times the actual temperature Leftmost 3 Digits and Flags Leftmost Rightmost Flag 0 Leftmost 1 Rightmost Temperature Unit Flag 0 C 1 F Open circuit Flag 0 Normal 1 Error Not used Always 0 Temperatu...

Page 229: ... 8 9 8 1 15 14 13 12 0 0 0 0 x165 x164 x163 0 1 B Flags Bits 08 to 11 04 to 07 00 to 03 Data Normal C Rightmost 15 14 13 12 1 0 0 0 x162 x161 x160 9 8 1 Example 2 Temperature 100 12 C 100 10012 Temperature Data FFD8E4 hexadecimal for 10012 Leftmost 3 Digits and Flags Rightmost 3 Digits and Flags Flags Temperature data Flags Temperature data 0 F F D 8 8 E 4 Flags Bits 08 to 11 04 to 07 00 to 03 Dat...

Page 230: ...Temperature Data 7FFFFFFF Leftmost 3 Digits and Flags Rightmost 3 Digits and Flags Flags Temperature data Flags Temperature data 6 7 F F E F F F Flags Bits 08 to 11 04 to 07 00 to 03 Data Error F Leftmost 15 14 13 12 0 1 1 0 x165 x164 x163 7 F F Flags Bits 08 to 11 04 to 07 00 to 03 Data Error F Rightmost 15 14 13 12 1 1 1 0 x162 x161 x160 F F F Note 1 Leftmost digits are stored in the lower memor...

Page 231: ...ter decimal point stored Temperature Sensor Unit Inputs IR 002 IR 003 Outputs None In this example 100 times the temperature data for temperature input 0 is stored in binary form in DM 0100 to DM 0102 Temperature input 0 IR 002 Leftmost data Rightmost data IR 200 Bit DM 0100 DM 0102 DM 0101 Always 0 Always 0 Always 0 Temperature Unit Flag 0 C 1 F Open circuit Flag 0 Normal 1 Error 15 14 13 12 11 1...

Page 232: ... completion of input 0 initialization ON when input 0 has been initialized Open circuit alarm output Ready for data conversion 2 Leftmost digits moved to IR 200 3 4 5 Leftmost and rightmost digits rearranged and moved to IR 202 and IR 201 Data rearrangement completed MOV 21 0000 DM0102 MOV 21 0100 DM0103 CMP 20 002 7FFE 02000 MOV 21 002 200 01000 SET 02001 MOVD 83 002 0020 201 MOVD 83 200 0300 201...

Page 233: ...s corresponding to the numbers in the above ladder pro gramming example are illustrated in the following diagram IR 002 Leftmost 3 digits of temperature data IR 002 Rightmost 3 digits of temperature data 6 If the temperature data is non negative the binary data in IR 202 and IR 201 is converted to BCD and placed in DM 0101 and DM 0100 8 If the temperature data is negative the binary data in HR 01 ...

Page 234: ...of cable CPM2C or CPM2C S CPU Unit CPM2C SRT21 CompoBus S I O Link Unit CPM1A CPM2A CPU Unit CPM1A SRT21 CompoBus S I O Link Unit Cable Model Specifications Special Flat Cable SCA1 4F10 4 core flat cable 0 75 mm2 VCTF cable 0 75 mm2 2 cores or 0 75 mm2 4 cores JIS C 3306 From the standpoint of the CPU Unit the 8 input bits and 8 output bits allocated to the CompoBus S I O Link Unit are identical t...

Page 235: ...node number should be a unique number between 0 and 15 Use the DIP switch to set the CompoBus S I O Link Unit s node number communications mode and the status of output data when a communications error occurs Connect the CompoBus S I O Link Unit to a CompoBus S transmission path Connect the CompoBus S I O Link Unit to the CPU Unit The number of Compo Bus S I O Link Units that can be connected depe...

Page 236: ...ed simultaneously In other words 8 bits of data transmitted from the Master CPU Unit at the same time will not al ways reach the Slave CPU Unit simultaneously and 8 bits of data transmitted from the Slave CPU Unit at the same time will not always reach the Master CPU Unit simultaneously When the 8 bits of input data must be read together modify the ladder program in the CPU Unit receiving the data...

Page 237: ...ddress 8421 Address 8421 0 0000 8 1000 1 0001 9 1001 2 0010 10 1010 3 0011 11 1011 4 0100 12 1100 5 0101 13 1101 6 0110 14 1110 7 0111 15 1111 1 ON 0 OFF DR ON Long distance communications mode See note 2 OFF High speed communications mode HOLD ON Retain inputs after a communications error OFF Clear inputs after a communications error Note 1 Always turn OFF the power supply before changing the DIP...

Page 238: ...CompoBus S communications path as shown in the following dia grams These terminals are not used They can however be used as communications power supply relay terminals Connect the CompoBus S Communications Cable BS BS NC BS NC BS CPM1A SRT21 CPM2C SRT21 From the CompoBus S communications path To the CompoBus S communications path BD H BD H BD L BD L NC BD L BD H Wiring the CompoBus S Communication...

Page 239: ...ons for 32 input and 32 output points as a De viceNet slave From the standpoint of the CPU Unit the 32 input bits and 32 output bits allo cated to the DeviceNet I O Link Unit are identical to input and output bits allo cated to Expansion I O Units even though the DeviceNet I O Link Unit does not control external inputs and outputs The input and output bits allocated to the DeviceNet I O Link Unit ...

Page 240: ...s preventing normal communications Node number duplications Bus OFF detected Flashing Nonfatal communications error Communications timeout or communications error for one or more slaves OFF Waiting for node number check by master Switch setting error Power not supplied If an error occurs in the DeviceNet I O Link Unit the Error Flags in AR 0200 to AR 0202 will be turned ON The addresses of the Err...

Page 241: ...nk Unit IR 000 IR 001 IR 010 IR 011 IR 002 IR 003 IR 012 IR 013 All of the words allocated to the DeviceNet I O Link Unit are used to read and write data between the CPU Unit of the DeviceNet I O Link Unit and the CPU Unit of the DeviceNet master as shown in the following illustration DeviceNet master I O memory 32 bits 32 bits IR 000 IR 001 m IR 002 m 1 IR 003 m 2 IR 010 IR 011 n IR 012 n 1 IR 01...

Page 242: ...s Refer to the DeviceNet Slaves Operation Manual W347 for details The DIP switch on the front of the DeviceNet I O Link Unit is used to set the baud rate and whether to hold or clear the remote outputs when a communications error occurs in the slave Hold clear input for communications error when used as a slave Not used Baud rate The settings of the DIP switch pins are shown in the following table...

Page 243: ...unications path as shown in the following diagram CPM1A DRT21 DeviceNet I O Link Unit Connector provided with Unit XW4B 05C1 H1 D Black V Blue CAN low Shield White CAN high Red V Multidrop Connector XW4B 05C4 TF D DeviceNet Connectors Use the following connectors Model Form and specifications XW4B 05C1 H1 D OMRON connector with screws included with DeviceNet I O Link Unit XW4B 05C4 TF D OMRON conn...

Page 244: ...224 I O Response Time Refer to the DeviceNet Slaves Operation Manual W347 for details on the re sponse time The data read write time for one cycle for the CPM1A DRT21 is approximately 0 5 ms Add a maximum of 1 ms to the I O response time ...

Page 245: ...munications 278 4 4 5 One to one PC Link Communications 279 4 5 Host Link Commands 281 4 5 1 IR SR AREA READ RR 281 4 5 2 LR AREA READ RL 282 4 5 3 HR AREA READ RH 282 4 5 4 PV READ RC 282 4 5 5 TC STATUS READ RG 283 4 5 6 DM AREA READ RD 283 4 5 7 AR AREA READ RJ 284 4 5 8 IR SR AREA WRITE WR 285 4 5 9 LR AREA WRITE WL 285 4 5 10 HR AREA WRITE WH 286 4 5 11 PV WRITE WC 286 4 5 12 TC STATUS WRITE ...

Page 246: ...he OMRON Programmable Terminal NT Link Interface through an RS 232C Adapter Refer to 4 2 2 CPM1 CPM1A 1 1 NT Link Communications in this manual and 1 2 4 One to one NT Link Communications in the CPM1 Operation Manual or NT Link Communications in the CPM1A Operation Manual for more details The following types of communications can be executed through the ports of the CPM2A CPM2C Host Link communica...

Page 247: ...tion Setting DM 6650 00 to 07 Port settings1 00 Standard 1 start bit 7 bit data 2 stop bits even parity 9 600 bps 01 Settings in DM 6651 00 08 to 11 Link area for 1 1 PC Link via peripheral port 0 LR 00 to LR 15 0 Any val ue is OK 12 to 15 Communications mode1 0 Host Link 2 1 1 PC Link Slave 3 1 1 PC Link Master 4 1 1 NT Link 0 DM 6651 00 to 07 Baud rate1 00 1 2K 01 2 4K 02 4 8K 03 9 6K 04 19 2K 0...

Page 248: ...d on the received re sponse data in this program Be sure that the host computer s RS 232C port is configured correctly before executing the program 1010 CPM1 SAMPLE PROGRAM 1020 SET THE COMMAND DATA 1030 S 00RR00000001 1040 FCS 0 1050 FOR I 1 TO LEN S 1060 FCS FCS XOR ASC MID S I 1 1070 NEXT I 1080 FCS FCS IF LEN FCS 1 THEN FCS 0 FCS 1090 CLOSE 1 1100 CLS 1110 PRINT SENDING COMMAND 1120 OPEN COM E...

Page 249: ...fatal error will occur AR 1302 will be turned ON and the default setting 0 or 00 will be used 2 For information on the NT Link settings for another OMRON PC refer to that PC s Operation Manual 3 If an out of range value is set the following communications conditions will result In that case reset the value so that it is within the permissible range Communications mode Host Link Communications form...

Page 250: ...2 stop bits even parity 9 600 bps 01 Settings in DM 6651 00 Any val ue is OK 00 Any val ue is OK 08 to 11 Link area for 1 1 PC Link via peripheral port 0 LR 00 to LR 15 0 0 Any val ue is OK 12 to 15 Communications mode1 0 Host Link 2 1 1 PC Link Slave 3 1 1 PC Link Master 4 1 1 NT Link 3 2 Note 1 If an improper setting is used a non fatal error will occur AR 1302 will be turned ON and the default ...

Page 251: ...2C Communications Functions This section describes how to use CPM2A CPM2C including the CPM2C S communications functions Read this section if you are using Host Link no pro tocol 1 1 NT Link or 1 1 PC Link communications 4 3 1 Host Link Communications Host Link communications are a conversational type communications protocol in which the PC sends responses to commands issued from a host computer a...

Page 252: ...ations CPM2A RS 232C port connection See note OMRON Programmable Terminal Note When connecting to the peripheral port an RS 232C Adapter or computer connection cable CQM1 CIF01 or CQM1 CIF02 is necessary CPM2A RS 232C port connection See note Commands Responses Commands Responses ...

Page 253: ... 200S V 2 m XW2Z 500S V 5 m CS1W CN118 0 1 m IBM PC AT or compatible CPM2C CIF01 V1 CPM2C CIF11 CPM2C CPU Unit CPM2C CPU Unit CPM2C CIF21 CPM2C CPU Unit Note The CSW1 CN226 626 can be connected directly to the CPU Unit With the CPM2C CIF01 V1 the cable switch SW1 can be turned ON to enable connect ing to a personal computer with a CS1W CN226 CN626 Connecting Cable ...

Page 254: ...s Functions 234 CPM2A 1 N Communications B500 AL004 Link Adapter CPM2A RS 232C port connection CPM2A peripheral port connection CPM1 CIF01 RS 422 Adapter NT AL001 RS 232C RS 422 Conversion Adapter Commands Responses IBM PC AT or compatible ...

Page 255: ...M2C CPU Unit CPM2 CIF11 CPM2C CPU Unit CPM2 CIF11 CPM2C CPU Unit CPM2C CPU Unit When using the port as an RS 232C port NT AL001 See note 1 NT AL001 See note 1 NT AL001 See note 1 RS 232C port XW2Z 070T 1 0 7 m XW2Z 200T 1 2 m CPM2C CIF01 V1 XW2Z 070T 1 0 7 m XW2Z 200T 1 2 m RS 232C port CPM2C CN111 Connecting Cable 0 15 m Up to 32 PCs XW2Z 070T 1 0 7 m XW2Z 200T 1 2 m RS 232C port CSW1 CN118 Con n...

Page 256: ...th between the host computer and the CPM2A CPM2C each time a frame is transmitted The transmission right is passed from the transmitting Unit to the receiving Unit when either a terminator the code that marks the end of a command or response or a delimiter the code that sets frames apart is received Terminator FCS Text Text End code Header code Unit no Unit no Header code FCS Terminator Frame resp...

Page 257: ...from the CPM2A CPM2C is returned in the format shown below Prepare a program so that the response data can be interpreted and processed x 101 x 100 x 161 x 160 FCS Node No Header code End code Text Terminator Node No Header Code Contents identical to those of the command are returned End Code The completion status of the command e g whether or not an error has oc curred is returned Text Text is re...

Page 258: ...der code Unit no Frame 2 command Frame response Delimiter Text FCS Terminator Frame 3 command Host computer CPM2A CPM2C As each frame is received by the host computer a delimiter is transmitted to the CPM2A CPM2C After the delimiter has been transmitted the CPM2A CPM2C will transmit the next frame This procedure is repeated until the entire response has been transmitted Delimiter Text Unit no Head...

Page 259: ...the delimiter or termi nator in order to check whether any data error has been generated The FCS is 8 bit data converted into two ASCII characters The 8 bit data is the result of an EXCLUSIVE OR performed on the data from the beginning of the frame until the end of the text in that frame i e just before the FCS Calculating the FCS each time a frame is received and checking the result against the F...

Page 260: ...o program the system to cover this possibility 400 FCSCHECK 410 L LEN RESPONSE Data transmitted and received 420 Q 0 FCSCK 430 A RIGHT RESPONSE 1 440 PRINT RESPONSE A L 450 IF A THEN LENGS LEN RESPONSE 3 ELSE LENGS LEN RESPONSE 2 460 FCSP MID RESPONSE LENGS 1 2 FCS data received 470 FOR I 1 TO LENGS Number of characters in FCS 480 Q ASC MID RESPONSE I 1 XOR Q 490 NEXT I 500 FCSD HEX Q 510 IF LEN F...

Page 261: ...Valid Valid AR AREA WRITE 288 R Valid Valid Valid SV READ 1 289 R Valid Valid Valid SV READ 2 290 W Not Valid Valid Valid SV CHANGE 1 291 W Not Valid Valid Valid SV CHANGE 2 292 MS Valid Valid Valid STATUS READ 293 SC Valid Valid Valid STATUS WRITE 294 MF Valid Valid Valid ERROR READ 295 KS Not Valid Valid Valid FORCED SET 296 KR Not Valid Valid Valid FORCED RESET 297 FK Not Valid Valid Valid MULT...

Page 262: ...ied address Reading the SV etc Check the address and instruction 18 Frame length error The maximum frame length was exceeded Divide the command into multiple frames 19 Not executable Items to read not registered for composite command QQ Execute QQ to register items to read before attempting batch read 23 User memory write protected The memory is write protected in the PC Setup Change the setting i...

Page 263: ...by the settings in the PC Setup When the communications switch is set to ON communications through the pe ripheral port and RS 232C port are governed by the standard Host Link settings 1 start bit 7 data bits 2 stop bits even parity and 9 600 bps baud rate Note When a Programming Console is connected to the peripheral port communica tions with the Programming Console are unaffected by either the c...

Page 264: ... OFF The communications settings for the peripheral port and RS 232C port will be determined by the settings in the PC Setup DM 6645 to DM 6649 DM 6650 to DM 6654 If a Programming Console is connected to the peripheral port however operation for that port will be in the Programming Console mode ON The communications settings for the peripheral port and RS 232C port will be the standard settings If...

Page 265: ...ll other cases Used as a 4 conductor method Both switches set to OFF According to RS 232C CTS control 5 OFF 6 ON The RS 232C port with the NT AL001 RS 232C RS 422 Conversion Adapter and the RS 232C port of the CPM2A CPM2C or CPM1 CIF01 RS 232C Adapter are connected as shown in the following diagram when there is no CTS control on the RS 232C port A power supply of 5 VDC is supplied to the RS 232C ...

Page 266: ...ill be used and AR 1302 will turn ON 0 DM 6646 00 to 07 Baud rate 00 1 200 bps 01 2 400 bps 02 4 800 bps 03 9 600 bps 04 19 200 bps Match host parameters 08 to 15 Frame format Start LengthStop Parity 00 1 7 1 Even 01 1 7 1 Odd 02 1 7 1 None 03 1 7 2 Even 04 1 7 2 Odd 05 1 7 2 None 06 1 8 1 Even 07 1 8 1 Odd 08 1 8 1 None 09 1 8 2 Even 10 1 8 2 Odd 11 1 8 2 None Other settings will cause a non fata...

Page 267: ...l be used and AR 1302 will turn ON 0 DM 6651 00 to 07 Baud rate 00 1 200 bps 01 2 400 bps 02 4 800 bps 03 9 600 bps 04 19 200 bps Match host parameters 08 to 15 Frame format Start LengthStop Parity 00 1 7 1 Even 01 1 7 1 Odd 02 1 7 1 None 03 1 7 2 Even 04 1 7 2 Odd 05 1 7 2 None 06 1 8 1 Even 07 1 8 1 Odd 08 1 8 1 None 09 1 8 2 Even 10 1 8 2 Odd 11 1 8 2 None Other settings will cause a non fatal ...

Page 268: ... enable Peripheral port 0 Disable number of bytes received 1 Use end code in DM 6654 2 CR LF Other settings will cause a non fatal error the disable setting 0 will be used and AR 1302 will turn ON Any DM 6654 00 to 07 Start code Peripheral port effective when bits 08 to 11 of DM 6653 are set to 1 01 to FF Hex Any 08 to 15 No of bytes of data received Peripheral port effective when bits 12 to 15 of...

Page 269: ...REPEAT 1090 Transmission data input 1100 INPUT send data send 1110 FCS Calculation 1120 FCS 0 1130 FOR IFCS 1 TO LEN send 1140 FCS FCS XOR ASC MID SEND IFCS 1 1150 NEXT 1160 FCS RIGHT 0 HEX FCS 2 1170 Communications execute 1180 ZZZ SEND SCS CHR 13 1190 PRINT 1 ZZZ 1200 Response check 1210 RECCNT 0 TMP 1220 DRECLOOP 1230 IF LOC 1 0 THEN DREC1 1240 RECCNT RECCNT 1 1250 IF RECCNT 5000 THEN DRECERR E...

Page 270: ...Code 0 Normal completion 1 Parity error 2 Frame error 3 Overrun error 12 Peripheral Port Communications Error Flag ON Peripheral port communications error occurred 13 Peripheral Port Transmit Ready Flag ON The PC is ready to transmit data Unsolicited Communications A data transmission to the host computer is initiated by the PC S Leading address of data to be transmitted C Control data N Number of...

Page 271: ...munications Overview When no protocol communications are used data can be exchanged with serial devices such as bar code readers and serial printers using TXD 48 and RXD 47 No protocol communications can be used with either an RS 232C port or peripheral port CPM2A Connections RS 232C devices Bar code reader Serial printer Other CPM2A CPU Unit RS 232C port CPM2A CPU Unit CPM2A CPU Unit Peripheral p...

Page 272: ...Specified No of bytes Only a Start Code ST Data Specified No of bytes Only an End Code ED Data 256 bytes max Both a Start and End Code ST Data 256 bytes max ED End Code of CR LF LF Data 256 bytes max CR Start Code 00 FF End Code CR LF LF Data 256 bytes max CR ST Note 1 The start and end codes are set in DM 6648 to DM 6649 RS 232C or DM 6653 to DM 6654 peripheral port in the PC Setup 2 When there a...

Page 273: ...enabled After start code is received Reception Complete When either the end code the specified no of bytes or 256 bytes are received Application Procedure Setting the Communications switch Set the CPM2A CPU Unit s communications switch or the CPM2C CPU Unit s DIP switch Connecting the cables Make the RS 232C connection with the serial device Ladder program The CPM2A s communications are controlled...

Page 274: ...t indicators 3 Output terminals 4 Status indicators 2 Input connector 3 Output connector 7 Communications port 8 Communications switch 9 Customize switch 5 Input indicators 6 Output indicators 4 Status indicators 2 Input connector 3 Output connector DIP switch for Units with 10 20 I O points 8 9 8 9 DIP switch for Units with 32 I O points Pin settings RS 232C port communications Pin 1 p OFF Govern...

Page 275: ...hat are required depend on whether a peripheral port or an RS 232C port is used Settings for RS 232C Port Word Bit Function Setting DM 6645 00 to 03 Port settings 0 Standard 1 start bit 7 bit data 2 stop bits even parity 9 600 bps Host Link unit number 0 1 Settings in DM 6646 Other settings will cause a non fatal error the default setting will be used and AR 1302 will turn ON As required 04 to07 C...

Page 276: ... RS 232C 0 Disable number of bytes received 1 Use end code in DM 6649 2 CR LF Other settings will cause a non fatal error the default setting 0 will be used and AR 1302 will turn ON 0 to 2 DM 6649 00 to 07 Start code 00 to FF No protocol effective when bits 8 to 11 of DM 6648 are set to 1 00 to FF 08 to 15 No of bytes of data received No protocol effective when bits 12 to 15 of DM 6648 are set to ...

Page 277: ... a non fatal error the default setting 0 will be used and AR 1302 will turn ON 0 to 2 DM 6654 00 to 07 Start code 00 to FF Peripheral port effective when bits 8 to 11 of DM 6653 are set to 1 00 to FF 08 to 15 No of bytes of data received Peripheral port effective when bits 12 to 15 of DM 6653 are set to 0 00 256 bytes 01 to FF 1 to 255 bytes 00 to FF End code 00 to FF Peripheral port effective whe...

Page 278: ...eral Port Communications Error Flag ON A peripheral port communications error occurred OFF Normal 13 Peripheral Port Transmit Ready Flag ON The PC is ready to transmit data 14 Peripheral Port Reception Completed Flag ON The PC has completed reading data 15 Peripheral Port Reception Overflow Flag ON A reception overflow has occurred AR 09 00 to 15 RS 232C Port Reception Counter 4 digits BCD AR 10 0...

Page 279: ...ions If AR 0805 the RS 232C Transmit Ready Flag is ON when 00100 turns ON then data from DM 0100 to DM 0104 is transmitted from leftmost bytes to right most bytes When AR 0806 the Reception Completed Flag turns ON 256 by tes of received data are read and written to DM 0200 from leftmost bytes to right most bytes First word holding send data Transmit 10 bytes Use the RS 232C port transmit data from...

Page 280: ...tions The NT Link allows a CPM2A CPM2C PC to be connected directly to an OMRON Programmable Terminal There is no need for a communications pro gram on the PC The NT Link can be used with an RS 232C port CPM2A Connection OMRON Programmable Terminal RS 232C cable CPM2A CPU Unit RS 232C port ...

Page 281: ...CIF21 RS 232C port Note The Programmable Terminal cannot be connected using a peripheral port con nection when communicating via a 1 1 NT Link Application Procedure Setting communications Connecting the cables Use the settings in the PC Setup DM6645 to DM 6649 for RS 232C communications Turn OFF the Communications switch on the CPM2A s CPU Unit or pin 1 of the DIP Switch on the CPM2C s CPU Unit Co...

Page 282: ...ck CPU Unit with Transistor Outputs via Fujitsu compatible Connector CPU Unit with Transistor Outputs via MIL Connector 2 Input terminals 7 Communications port 8 Communications switch 9 Customize switch 5 Input indicators 6 Output indicators 3 Output terminals 4 Status indicators 2 Input connector 3 Output connector 7 Communications port 8 Communications switch 9 Customize switch 5 Input indicator...

Page 283: ...g will be used and AR 1302 will turn ON 4 For information on the 1 1 NT Link settings of an OMRON Programmable Termi nal refer to that PT s Operation Manual This section describes RS 232C connections The RS 232C port on the Programmable Terminal and the RS 232C port on the CPM2A CPM2C or CPM1 CIF01 RS 232C Adapter are connected as shown in the following diagram when there is no CTS control on the ...

Page 284: ...ommunications Functions 264 One to one PC Link CPM2A CPU Unit CPM2A CPU Unit RS 232C port RS 232C port OMRON PC CQM1 CPM1 CPM1A CPM2C SRM1 V2 C200HS or C200HX HG HE OMRON PC CQM1 CPM1 CPM1A CPM2C SRM1 V2 C200HS or C200HX HG HE ...

Page 285: ...PM2C CPU Unit OMRON PC CQM1 CPM1 CPM1A CPM2A SRM1 V2 C200HS or C200HX HG HE OMRON PC CQM1 CPM1 CPM1A CPM2A SRM1 V2 C200HS or C200HX HG HE CPM2C CIF01 V1 CPM2C CIF11 CPM2C CIF01 V1 CPM2C CIF11 Master Slave Link bits Link bits LR00 LR07 LR08 LR15 Write Read Write area Read area Read area Write area Write Read LR00 LR07 LR08 LR15 Note Even though the peripheral port on the CPM2C CIF01 V1 can output R...

Page 286: ...o DM 6649 for RS 232C communications Turn OFF the Communications switch on the CPM2A s CPU Unit or pin 1 of the DIP Switch on the CPM2C s CPU Unit Connect a 1 1 PC Link with another PC The CPM2A s communications are controlled by the communications switch on the front of the CPU Unit and the CPM2C s communications are controlled by the DIP switch on the front of the CPU Unit CPM2A Communications S...

Page 287: ... MIL Connector 2 Input terminals 7 Communications port 8 Communications switch 9 Customize switch 5 Input indicators 6 Output indicators 3 Output terminals 4 Status indicators 2 Input connector 3 Output connector 7 Communications port 8 Communications switch 9 Customize switch 5 Input indicators 6 Output indicators 4 Status indicators 2 Input connector 3 Output connector DIP switch for Units with ...

Page 288: ... Operation Manual This section describes the RS 232C connection The RS 232C cable used for 1 1 PC Links is a cross connection cable When there is no CTS control on the RS 232C port the connection is made as shown in the following diagram With the CPM2C the CPM2C CN111 and CS1W CN118 connecting cables are used RS 232C port Signal Pin No RS 232C port Signal Pin No Hood Recommended cables XW2Z 200T 2...

Page 289: ...19 2K To match host pa rameters 08 to 15 Frame format Start Length Stop Parity 00 1 bit 7 bits 1 bit Even 01 1 bit 7 bits 1 bit Odd 02 1 bit 7 bits 1 bit None 03 1 bit 7 bits 2 bit Even 04 1 bit 7 bits 2 bit Odd 05 1 bit 7 bits 2 bit None 06 1 bit 8 bits 1 bit Even 07 1 bit 8 bits 1 bit Odd 08 1 bit 8 bits 1 bit None 09 1 bit 8 bits 2 bit Even 10 1 bit 8 bits 2 bit Odd 11 1 bit 8 bits 2 bit None O...

Page 290: ...o match host pa rameters 04 to 07 CTS control settings 0 Disable 1 Set 0 08 to 11 When using a 1 1 PC Link Sets the link words for 1 1 PC Link 0 LR 00 to LR 15 Not 0 Disable When using a 1 N NT Link Sets the maximum PT node number 1 to 7 12 to 15 Communications mode 0 Host Link 1 No protocol 2 1 1 PC Link Slave 3 1 1 PC Link Master 4 1 1 NT Link 5 1 N NT Link Any other setting specifies Host Link ...

Page 291: ...0 bps Transmission delay No Node number 00 Example Program This example shows a BASIC program that reads the status of the SRM1 V2 s inputs in IR 000 For more details refer to 4 5 Host Link Commands An FCS frame check sequence check isn t performed on the received re sponse data in this program Be sure that the host computer s RS 232C port is configured correctly before executing the program 1000 ...

Page 292: ...ansmitted C Control data N Number of bytes to be transmitted 4 digits BCD 0000 to 0256 From the time this instruction is executed until the data transmission is complete AR 0805 or AR0813 for the peripheral port will remain OFF It will turn ON again upon completion of the data transmission Start and end codes are not included when the number of bytes to be transmitted is specified The largest tran...

Page 293: ... AR10 Number of bytes received To reset the RS 232C port i e to restore the initial status turn ON SR 25209 To reset the peripheral port turn ON SR 25208 These bits will turn OFF auto matically after the reset The start code and end code are not included in AR 09 or AR 10 number of bytes received The data will be as follows 31323132313231323132CR LF When the peripheral port is used to conduct no p...

Page 294: ...ing 0000 will be used and AR 1302 will turn ON 00 to 31 08 to 11 Start code enable RS 232C effective when bits 12 to 15 of DM 6650 are set to 1 0 Disable 1 Set As re quired 12 to 15 End code enable RS 232C effective when bits 12 to 15 of DM 6650 are set to 1 0 Disable number of bytes received 1 Set specified end code 2 CR LF As re quired DM 6654 00 to 07 Start code effective when bits 08 to 11 of ...

Page 295: ... bit None 03 1 bit 7 bits 2 bit Even 04 1 bit 7 bits 2 bit Odd 05 1 bit 7 bits 2 bit None 06 1 bit 8 bits 1 bit Even 07 1 bit 8 bits 1 bit Odd 08 1 bit 8 bits 1 bit None 09 1 bit 8 bits 2 bit Even 10 1 bit 8 bits 2 bit Odd 11 1 bit 8 bits 2 bit None As re quired DM 6647 00 to 15 Transmission delay Host Link 0000 to 9999 BCD Set in units of 10 ms e g setting of 0001 equals 10 ms As re quired DM 664...

Page 296: ...transmission data and the transmission is stopped part way through use CR or LF as the end code 4 The start and end codes are not stored When sending data from the SRM1 V2 check that the Transmission Enable Flag is ON for executing the TXD 48 instruction The Transmission Enable Flag will turn OFF while the data is being transmitted and will turn ON again when transmission is complete After the SRM...

Page 297: ...munications start 00100 AR0806 AR0805 DIFU 13 00101 TXD DM0100 00100 0000 0010 RXD DM0200 0000 256 First word to store receive data 256 bytes transmitted Using the RS 232C port data is stored from higher to lower values 4 4 3 One to one NT Link Communications Using the 1 1 NT Link the SRM1 V2 PC can be connected to the Program mable Terminal NT Link Interface The RS 232C port can be used for the 1...

Page 298: ... will be used 2 For information on the NT Link settings for another OMRON PC refer to that PC s Operation Manual 3 If an out of range value is set the following communications conditions will result In that case reset the value so that it is within the permissible range Communications mode Host Link Communications format Standard settings 1 start bit 7 bit data 2 stop bits even parity 9 600 bps Tr...

Page 299: ...T Link The 1 N NT Link is supported by SRM1 C02 V2 only 5 Note 1 If an improper setting is used a non fatal error will occur AR 1302 will be turned ON and the default setting 0 or 00 will be used 2 For information on 1 N NT Link settings for OMRON PTs refer to the PT s Operation Manual 3 If an out of range value is set the following communications conditions will result In that case reset the valu...

Page 300: ...tting Slave DM 6645 00 to 03 Port settings1 00 Standard 1 start bit 7 bit data 2 stop bits even parity 9 600 bps 01 Settings in DM 6651 00 or 01 00 or 01 04 to 07 CTS Control settings 0 Disable 1 Set 0 0 08 to 11 When using a 1 1 PC Link Sets the link words for 1 1 PC Link 0 LR 00 to LR 15 Not 0 Disable When using a 1 N NT Link Sets the maximum PT node number 1 to 7 0 0 12 to 15 Communications mod...

Page 301: ...ader code Beginning word No of words 0000 to 0256 Terminator Note Beginning word 0000 to 0049 and 0200 to 0255 in CPM2A CPM2C PCs 0000 to 0019 and 0200 to 0255 in CPM1 CPM1A SRM1 V2 PCs A response of 0000 will be returned for non existent IR and SR words Response Format An end code of 00 indicates normal completion R R FCS x 101 x 100 x 161 x 160 x 163 x 162 x 161 x 160 End code Read data 1 word R...

Page 302: ...order starting with the specified beginning word 4 5 3 HR AREA READ RH Reads the contents of the specified number of HR words starting from the speci fied word Command Format R H FCS x 101 x 100 x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100 Node no Header code Beginning word1 No of words2 Terminator Note 1 Beginning word 0000 to 0019 2 No of words 0001 to 0020 Response Format An end code of 00 i...

Page 303: ...nter 4 5 5 TC STATUS READ RG Reads the status of the Completion Flags of the specified number of timers counters starting from the specified timer counter Command Format R G FCS x 101 x 100 x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100 Header code Node no Beginning timer counter1 No of timers counters2 Terminator Note 1 Beginning T C 0000 to 0255 in CPM2A CPM2C PCs 0000 to 0127 in CPM1 CPM1A SRM...

Page 304: ...d 2 The response will be divided when reading more than 30 words of data Parameters Read Data Response The contents of the number of words specified by the command are returned in hexadecimal as a response The words are returned in order starting with the specified beginning word Note Be careful about the configuration of the DM area as it varies depending on the CPU Unit model 4 5 7 AR AREA READ ...

Page 305: ...pecified in CPM2A CPM2C PCs and words 0020 to 0199 cannot be specified in CPM1 CPM1A SRM1 V2 PCs If an at tempt is made to write to any of these words the writing operation will not be executed and normal completion occurs Parameters Write Data Command Specify in order the contents of the number of words to be written to the IR or SR area in hexadecimal starting with the specified beginning word N...

Page 306: ...rd by word Command Format W H FCS x 101 x 100 x 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160 Node no Header code Beginning word Write data for no of words to write Write data 1 word Terminator Note Beginning word 0000 to 0019 Response Format An end code of 00 indicates normal completion W H x 101 x 100 x 161 x 160 FCS Node no End code Header code Terminator Parameters Write Data Command Specify i...

Page 307: ... specified for writing which exceeds the allowable range an error will be generated and the writing operation will not be executed If for exam ple 126 is specified as the beginning word for writing in a CPM1 PC and three words of data are specified then 128 will become the last word for writ ing data and the command will not be executed because TC 128 is beyond area boundary 4 5 12 TC STATUS WRITE...

Page 308: ...44 to DM 6655 in CPM2A CPM2C SRM1 V2 PCs 2 Divide the command when writing more than 29 words of data Response Format An end code of 00 indicates normal completion W D x 101 x 100 x 161 x 160 FCS Node no Header code Terminator End code Note Words DM 1024 to DM 6143 in CPM1 CPM1A PCs and words DM 2048 to DM 6143 in CPM2A CPM2C SRM1 V2 PCs cannot be specified If an attempt is made to write to any of...

Page 309: ... executed If for example 12 is specified as the beginning word for writing in a CPM1 PC and five words of data are specified then 16 will become the last word for writing data and the com mand will not be executed because AR 16 is beyond the writable range 4 5 15 SV READ 1 R Searches for the first instance of a timer or counter instruction TIM TIMH 15 TIML TMHH CNT or CNTR 12 with the specified TC...

Page 310: ...SV has been set 4 The response end code will indicate an error 16 if the SV wasn t entered as a constant 4 5 16 SV READ 2 R Reads the constant SV or the word address where the SV is stored The SV that is read is a 4 digit decimal number BCD written as the second operand for the TIM TIMH 15 TIML TMHH CNT or CNTR 12 instruction at the spe cified program address in the user s program This can only be...

Page 311: ... A R Space Space AR 0000 to 0023 0000 to 0015 D M Space Space DM 0000 to 6655 0000 to 6655 D M Space DM indirect 0000 to 6655 0000 to 6655 C O N Space Constant 0000 to 9999 0000 to 9999 Note The instruction name specified under Name must be in four characters Fill any gaps with spaces to make a total of four characters 4 5 17 SV CHANGE 1 W Searches for the first instance of the specified TIM TIMH ...

Page 312: ... than 10K Command Format OP4 OP3 OP2 OP1 W x 100 x 100 x 101 x 103 x 102 x 101 x 100 x 103 x 102 x 101 OP4 OP3 OP2 OP1 x 100 x 103 x 102 x 101 Node no Program address Name TC number Header code Operand SV Terminator FCS Note TC number 0000 to 0255 in CPM2A CPM2C PCs and 0000 to 0127 in CPM1 CPM1A SRM1 V2 PCs Response Format An end code of 00 indicates normal completion W x 160 x 100 x 101 x 161 No...

Page 313: ...015 H R Space Space HR 0000 to 0019 0000 to 0019 A R Space Space AR 0000 to 0023 0000 to 0015 D M Space Space DM 0000 to 2047 6144 to 6655 0000 to 1023 6144 to 6655 D M Space DM indirect 0000 to 2047 6144 to 6655 0000 to 1023 6144 to 6655 C O N Space Constant 0000 to 9999 0000 to 9999 Note For SRM1 V2 PCs the DM range is from 0000 to 2047 4 5 19 STATUS READ MS Reads the PC operating conditions Com...

Page 314: ...OGRAM mode RUN mode MONITOR mode 7 6 5 4 3 2 1 0 1 0 0 0 x 161 x 160 6 5 0 0 0 0 4 0 1 Bit Bit None Program area write protection 0 Write protected 1 Not write protected Program area 4 Kbytes 0 1 0 8 Kbytes The Message parameter is a 16 character message that exists when MSG 47 has been executed When there is no message this parameter is omitted 4 5 20 STATUS WRITE SC Changes the PC operating mode...

Page 315: ...ors in the PC Also checks whether previous errors have been cleared Command Format M F x 100 x 101 x 101 x 100 Node no Header code Terminator FCS Error clear Response Format An end code of 00 indicates normal completion M F x 100 x 101 x 161 x 160 x 163 x 162 x 161 x 160 x 163 x 162 x 161 x 160 Node no Header code End code Error information 1st word Terminator FCS Error information 2nd word Parame...

Page 316: ...L Bit Bit 1st word 2nd word SRM1 V2 PCs 15 14 13 12 11 10 9 8 0 0 0 0 0 0 0 x 163 x 162 7 6 5 4 x 161 3 2 1 0 x 160 FAL FALS No 00 to 99 ON Cycle time overrun Error code F8 15 14 13 12 11 10 9 8 0 0 0 0 0 0 0 0 0 0 0 0 x 163 x 162 7 6 5 4 x 161 3 2 1 0 x 160 ON System error FAL ON Memory error Error code F1 ON No end instruction error FALS ON System error FAL Bit Bit 1st word 2nd word 4 5 22 FORCE...

Page 317: ...00 to 0019 0000 to 0019 A R Space Space AR 0000 to 0023 0000 to 0015 T I M Space Completion Flag timer 0000 to 0255 0000 to 0127 Always 00 T I M H Completion Flag high speed timer y 00 T I M L Completion Flag long timer T M H H Completion Flag very high speed timer C N T Space Completion Flag counter C N T R Completion Flag reversible counter Note The area specified under Name must be in four char...

Page 318: ...00 to 0255 0000 to 0127 Always 00 T I M H Completion Flag high speed timer y T I M L Completion Flag long timer T M H H Completion Flag very high speed timer C N T Space Completion Flag counter C N T R Completion Flag reversible counter Note The area specified under Name must be in four characters Add spaces after the data area name if it is shorter than four characters 4 5 24 MULTIPLE FORCED SET ...

Page 319: ... timer or counter completion flag is specified only bit 15 is effective and all other bits will be ignored Only force setting and force resetting are possible for timers counters If a word address is specified the content of the word specifies the desired pro cess for each bit in the specified word as shown in the following table Hexadecimal setting Process 0000 No action bit status not changed 00...

Page 320: ... x 101 x 161 x 160 x 161 x 160 Node no Header code Terminator FCS End code Model code Parameters Model Code Model code indicates the PC model in two digits hexadecimal Model code Model 01 C250 02 C500 03 C120 0E C2000 10 C1000H 11 C2000H CQM1 CPM2A CPM2C CPM1 CPM1A SRM1 V2 12 C20H C28H C40H C200H C200HS 20 CV500 21 CV1000 22 CV2000 40 CVM1 CPU01 E 41 CVM1 CPU11 E 42 CVM1 CPU21 E 4 5 27 TEST TS Ret...

Page 321: ...nator FCS Response Format An end code of 00 indicates normal completion R P x 100 x 101 x 161 x 160 x 161 x 160 Node no Header code End code 1 byte Program for entire UM area Terminator FCS Parameters Program Response The program is read from the entire program area Note To stop this operation in progress execute the ABORT XZ command 4 5 29 PROGRAM WRITE WP Writes to the PC user s program area the...

Page 322: ...101 x 100 OP1 OP2 OP3 OP4 OP1 OP2 Node no Header code Terminator FCS Sub header code Read area Read word address Data format Data break Single read information Total read information 128 max Single read information Total read information 128 max Read area Read word address Data format Data break R Response Format An end code of 00 indicates normal completion Q Q x 100 x 101 x 161 x 160 M R Node no...

Page 323: ...s other than CH g p PV CH Long timer Completion Flag T I M L 0000 to 0255 Not used 2 characters other than CH g PV CH Very high speed timer Completion Flag T M H H 0000 to 0255 Not used 2 characters other than CH y g p PV CH Counter Completion Flag C N T S 0000 to 0255 0000 to 0127 2 characters other than CH PV CH Reversible counter Completion Flag C N T R 0000 to 0255 0000 to 0127 2 characters ot...

Page 324: ...n Flag Data Break Response The break code is returned between sections that are read 4 5 31 ABORT XZ Aborts the Host Link operation that is currently being processed and then en ables reception of the next command The ABORT command does not receive a response Command Format X Z x 100 x 101 Node no Header code Terminator FCS 4 5 32 INITIALIZE Initializes the transmission control procedure of all th...

Page 325: ...s 122 max Data specified in TXD 48 Terminator FCS Parameters Characters Response This is the data specified in TXD 48 that has been converted to ASCII 4 5 34 Undefined Command IC This response is returned if the header code of a command cannot be decoded Check the header code Response Format I C x 100 x 101 Node no Header code Terminator FCS ...

Page 326: ... CPM1A SRM1 V2 Flash Memory 313 5 2 I O Allocation for CPM1 CPM1A CPM2A PCs 313 5 2 1 CPU Units 313 5 2 2 Expansion I O Units 317 5 2 3 Expansion Units 318 5 2 4 Examples of Expansion Unit and Expansion I O Unit Allocation 319 5 3 I O Allocation for CPM2C PCs 323 5 3 1 CPU Units 323 5 3 2 Expansion I O Units 325 5 3 3 Expansion Units 328 5 3 4 Examples of Expansion Unit and Expansion I O Unit Allo...

Page 327: ... used for both timers and counters DM area Read write2 DM 0000 to DM 0999 DM 1022 to DM 1023 1 002 words DM area data can be accessed in word units only Word values are retained when the power is turned off or operation started or stopped Read write areas can be read and written freely within the program Error log DM 1000 to DM 1021 22 words Used to store the time of occurrence and error code of e...

Page 328: ...CNT CNTR 12 TMHH and TIML instructions The same numbers are used for both timers and counters DM area Read write2 DM 0000 to DM 1999 DM 2022 to DM 2047 2 026 words DM area data can be accessed in word units only Word values are retained when the power is turned off or operation started or stopped Read write areas can be read and written freely within the program Error log DM 2000 to DM 2021 22 wor...

Page 329: ...ons such as flags and control bits AR 04 to 07 are used as slaves Refer to AR Area LR area1 LR 00 to LR 15 16 words LR 0000 to LR 1515 256 bits Used for a 1 1 PC Link with another PC Timer Counter area2 TC 000 to TC 127 timer counter numbers 3 Timers and counters use the TIM TIMH 15 CNT and CNTR 12 instructions The same numbers are used for both timers and counters DM area Read write2 DM 0000 to D...

Page 330: ...002 Used as a normal input Special functions for input bits IR 00003 through IR 00006 are set in DM 6628 Bit dd Bits in DM 6628 PC Setup setting in DM 6628 address DM 6628 0 1 2 IR 00003 00 to 03 Used as normal i Used as i i Used as i k IR 00004 04 to 07 inputs interrupt inputs including quick response inputs IR 00005 08 to 11 including counter mode inputs IR 00006 12 to 15 counter mode Note Input...

Page 331: ... the same TC number twice even for different instructions Use TC numbers 000 through 003 for TIMH 15 and TC numbers 004 to 007 for TMHH When these timer numbers are used timing is performed as an in terrupt process and the cycle timer does not affect timer operation TC numbers are used to create timers and counters as well as to access Completion Flags and present values PVs If a TC number is desi...

Page 332: ...SRM1 after the above memory areas have been changed will be a maximum of 850 ms later than the normal first operation with out changes SRM1 Cycle Times A cycle time overflow warning will not be issued when any of the following opera tions are performed in either MONITOR or OPERATION modes Be careful of the effect of using online editing on SRM1 I O response time Changes to the program using online...

Page 333: ... Max No of I O see note 1 10 CPM1A 10CDR CPM1A 10CDT D Input 6 inputs 00000 to 00005 None 10 CPM1A 10CDT D CPM1A 10CDT1 D Output 4 outputs 01000 to 01003 20 CPM1A 20CDR CPM1A 20CDT D Input 12 inputs 0000 to 00011 None 20 CPM1A 20CDT D CPM1A 20CDT1 D Output 8 outputs 01000 to 01007 30 CPM1A 30CDR CPM1A 30CDT D CPM1A 30CDT1 D Inputs 18 inputs 00000 to 00011 00100 to 00105 3 see note 90 Output 12 out...

Page 334: ...1 00200 to 00211 3 120 Output 24 outputs 01000 to 01007 01100 to 01107 01200 to 01207 Note 1 The values for the maximum number of I O in the above table include the I O on Expansion I O Units 2 When using a CPM2A CPU Unit up to 3 Expansion Units or Expansion I O Units can be connected to the PC CPU Unit Allocation In the following diagrams shaded areas indicate bits actually used for inputs or out...

Page 335: ... IR 00000 to IR 00011 IR 00100 to IR 00105 12 outputs IR 01000 to IR 01007 IR 01100 to IR 01103 CPM1 30CDR CPM1 30CDR V1 CPM1A 30CD CPM2A 30CD Inputs IR 000 IR 001 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Outputs IR 010 IR 011 Do not use Bits CPU Units with 40 I O Points 24 inputs IR 00000 to IR 00011 IR 00100 to IR 00111 16 outputs IR 01000 to IR 01007 IR 01100 to IR 01107 CPM1A 40CD CPM2A...

Page 336: ...m 1 bits 00 to 11 CPM1 10CDR CPM1 20CDR Output 8 outputs Word n 1 bits 00 to 07 CPM1 20CDR CPM1 30CDR V1 Note m m denotes the last input word allocated to the CPU Unit or to the previous Expansion Unit or Expansion I O Unit if one is already connected n n denotes the last output word allocated to the CPU Unit or to the previous Expansion Unit or Expansion I O Unit if one is already connected Expan...

Page 337: ...02 01 00 Do not use Bits 5 2 3 Expansion Units Unit Model number I O Allocated words bits Max No of Units Compatible CPU Units Analog I O Unit CPM1A MAD01 CPM1A MAD11 Input 2 words m 1 m 2 3 see note 2 CPM1 CPM1A CPM1A MAD11 Output 1 word n 1 CPM1A CPM2A Temperature S U i CPM1A TS001 CPM1A TS101 Input 2 words m 1 m 2 3 CPM1A CPM2A p Sensor Units CPM1A TS101 Output CPM2A CPM1A TS002 CPM1A TS102 Inp...

Page 338: ...2 Input 2 word m 3 Input 3 word m 4 No outputs CPM1A TS002 TS102 CompoBus S I O Link Unit and DeviceNet I O Link Unit 8 bits Input word m 1 8 bits Output word n 1 CPM1A SRT21 32 bits Input word m 1 m 2 32 bits Output word n 1 n 2 CPM1A DRT21 Note Input bits 00 to 07 in word m 1 are for outputs from the Master Output bits 00 to 07 in word n 1 are for inputs to the Master 5 2 4 Examples of Expansion...

Page 339: ...IR 01115 can be used as work bits IR 002 to IR 009 of the input words and IR 012 to IR 019 of the output words can all be used as work words Example CPU Unit with 30 I O Points 3 Expansion I O Units with 20 I O Points 18 inputs IR 00000 to IR 00011 IR 00100 to IR 00105 12 outputs IR 01000 to IR 01007 IR 01100 to IR 01103 Inputs IR 000 IR 001 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Outputs ...

Page 340: ...R 011 Do not use 12 inputs IR 00300 to IR 00311 CPU Unit 60 I O points Expansion I O Unit 20 I O points Do not use No inputs 12 inputs IR 00400 to IR 00411 Expansion I O Unit 16 outputs Expansion I O Unit 20 I O points IR 012 IR 013 IR 014 Do not use Do not use Do not use IR 002 IR 003 IR 004 24 outputs IR 01000 to IR 01007 IR 01100 to IR 01107 IR 01200 to IR 01207 8 outputs IR 01300 to IR 01307 1...

Page 341: ... I O points IR 012 IR 013 IR 014 Do not use Used for input 0 of the Analog I O Unit Used for input 1 of the Analog I O Unit IR 002 IR 003 IR 004 24 outputs IR 01000 to IR 01007 IR 01100 to IR 01107 IR 01200 to IR 01207 1 analog output Output 1 IR 013 No outputs 8 outputs IR 01400 to IR 01407 Used for input 0 of the Temperature Sensor Unit Used for input 1 of the Temperature Sensor Unit IR 005 IR 0...

Page 342: ...rature Sensor Unit Used for input 1 of the Temperature Sensor Unit IR 005 IR 006 IR 007 Do not use Bits Only one 4 input Temperature Sensor Unit CPM1A TS002 102 can be con nected to the PC The CPM1A TS002 102 can however be connected together with an Expansion I O Unit or a different Expansion Unit 5 3 I O Allocation for CPM2C PCs 5 3 1 CPU Units No of I O on CPU Unit Model number I O Allocated bi...

Page 343: ... bits can be used as work bits Bits in the input words that are not used as input bits cannot be used as work bits CPU Units with 10 I O Points CPM2C 10C D Inputs Outputs IR 000 IR 010 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Do not use 6 inputs IR 00000 to IR 00005 4 outputs IR 01000 to IR 01003 Bits CPU Units with 20 I O Points CPM2C 20C D Inputs Outputs IR 000 IR 010 15 14 13 12 11 10 09...

Page 344: ...3 Output 8 outputs Word n 1 bits 00 to 07 24 CPM2C 24EDT CPM C EDT Input 16 inputs Word m 1 bits 00 to 15 5 3 CPM2C 24EDT1 Output 8 outputs Word n 1 bits 00 to 07 32 CPM2C 32EDT CPM C EDT Input 16 inputs Word m 1 bits 00 to 15 5 3 CPM2C 32EDT1 Output 16 outputs Word n 1 bits 00 to 15 Note m m denotes the last input word allocated to the CPU Unit or to the previous Expansion Unit or Expansion I O U...

Page 345: ...Expansion I O Unit with 16 Inputs CPM2C 16EDC CPM2C 16EDM Inputs m 1 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 16 inputs Word m 1 bit 00 to Word m 1 bit 15 No outputs Bits Expansion I O Units with 8 Outputs CPM2C 8ER CPM2C 8ETC CPM2C 8ET1C CPM2C 8ETM CPM2C 8ET1M Outputs n 1 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 No inputs 8 outputs Word n 1 bit 00 to Word n 1 bit 07 Bits Expansion I...

Page 346: ...ion I O Unit with 20 I O Points CPM2C 20EDR Inputs m 1 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 12 inputs Word m 1 bit 00 to Word m 1 bit 11 8 outputs Word n 1 bit 00 to Word n 1 bit 07 Outputs n 1 Do not use Bits Expansion I O Units with 24 I O Points CPM2C 24EDTC CPM2C 24EDT1C CPM2C 24EDTM CPM2C 24EDT1M Inputs m 1 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 16 inputs Word m 1 bit 00 t...

Page 347: ...utput 1 output n 1 Note 1 m m denotes the last input word allocated to the CPU Unit or to the pre vious Expansion Unit or Expansion I O Unit if one is already connected n n denotes the last output word allocated to the CPU Unit or to the pre vious Expansion Unit or Expansion I O Unit if one is already connected 2 Because the CPM2C MAD11 Analog I O Unit and the CPM2C TS001 101 Temperature Sensor Un...

Page 348: ...and Expansion I O Units in the order in which they are connected The input area consists of the 10 words from IR 000 to 009 and the output area consists of the 10 words from IR 010 to 019 Although I O bits are allocated automatically it is necessary to ensure that both the number of input words and the number of output words do not exceed 10 For example the Analog I O Unit and Temperature Sensor U...

Page 349: ...Unit 32 I O points 16 inputs IR 00400 to IR 00415 16 outputs IR 01400 to IR 01415 Expansion I O Unit 32 I O points 16 inputs IR 00600 to IR 00615 16 outputs IR 01600 to IR 01615 IR 015 Bits IR 006 IR 016 Example Configuration Including Expansion I O Units and a CompoBus S I O Link Unit Inputs IR 000 IR 001 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 Outputs IR 010 IR 011 Do not use IR 012 IR 0...

Page 350: ...4 No outputs Temperature Sensor Unit 2 CPM2C TS101 2 temperature inputs Input 0 IR 007 Input 1 IR 008 No outputs Analog I O Unit 2 CPM2C MAD11 2 analog inputs Input 0 IR 005 Input 1 IR 006 1 analog output Output word 012 Expansion I O Unit 24 I O points 16 inputs IR 00900 to IR 00915 8 outputs IR 01300 to IR 01307 IR 006 IR 007 IR 008 IR 009 Used for input 0 of Analog I O Unit 1 Used for input 1 o...

Page 351: ... 2 Instruction Terminology 334 6 3 Basic Ladder Diagrams 335 6 3 1 Basic Terms 335 6 3 2 Mnemonic Code 336 6 3 3 Ladder Instructions 337 6 3 4 OUTPUT and OUTPUT NOT 340 6 3 5 The END Instruction 341 6 3 6 Logic Block Instructions 341 6 3 7 Coding Multiple Right hand Instructions 349 6 3 8 Branching Instruction Lines 349 6 3 9 Jumps 353 6 4 Controlling Bit Status 354 6 4 1 SET and RESET 354 6 4 2 D...

Page 352: ...al the CPM1A Operation Manual the CPM2A Operation Manual the CPM2C Operation Manual and the SRM1 Master Control Units Manual and via the SSS in the SSS Operation Manual C series PCs The rest of Section 6 covers more advanced programming programming pre cautions and program execution All special application instructions are cov ered in Section 7 Instruction Set Debugging is described in the CPM1 Op...

Page 353: ...OAD NOT AND NOT or OR NOT instruction The number above each condi tion indicates the operand bit for the instruction It is the status of the bit associated with each condition that determines the execution condition for fol lowing instructions The way the operation of each of the instructions corre sponds to a condition is described below Before we consider these however there are some basic terms...

Page 354: ...on block consists of all the instructions that are interconnected across the ladder diagram One instruction block thus consists of all the instruc tions between where you can draw a horizontal line across the ladder diagram without intersecting any vertical lines and the next place where you can draw the same type of horizontal line 6 3 2 Mnemonic Code The ladder diagram cannot be directly input i...

Page 355: ...0004 OR 00101 00005 AND LD 00006 MOV 21 000 DM 0000 00007 CMP 20 DM 0000 HR 00 00008 AND 25505 00009 OUT 20000 00010 MOV 21 DM 0000 DM 0500 00011 LD 00502 00012 AND 00005 00013 OUT 20001 The address and instruction columns of the mnemonic code table are filled in for the instruction word only For all other lines the left two columns are left blank If the instruction requires no definer or bit oper...

Page 356: ... instruction and the rest of the condi tions to AND or AND NOT instructions The following example shows three conditions which correspond in order from the left to a LOAD an AND NOT and an AND instruction Again each of these instructions requires one line of mne monic code 00000 00100 LR 0000 Instruction Address Instruction Operands 00000 LD 00000 00001 AND NOT 00100 00002 AND LR 0000 00003 Instru...

Page 357: ... status of the OR instruction s operand bit If either one of these were ON an ON execution condition would be produced for the next instruction When AND and OR instructions are combined in more complicated diagrams they can sometimes be considered individually with each instruction performing a logic operation on the execution condition and the status of the operand bit The following is one exampl...

Page 358: ...ondition is OFF With the OUTPUT NOT instruction the operand bit will be turned ON as long as the execution condition is OFF and turned OFF as long as the execution condition is ON These appear as shown below In mne monic code each of these instructions requires one line 00000 01001 01000 00001 Address Instruction Operands 00000 LD 00000 00001 OUT 01000 Address Instruction Operands 00000 LD 00001 0...

Page 359: ...truction Operands 00500 LD 00000 00501 AND NOT 00001 00502 Instruction 00503 END 01 If there is no END instruction anywhere in the program the program will not be executed at all Now you have all of the instructions required to write simple input output pro grams Before we finish with ladder diagram basic and go onto inputting the pro gram into the PC let s look at logic block instruction AND LOAD...

Page 360: ... condition on an instruction line Analyzing the above ladder diagram in terms of mnemonic instructions the condition for IR 00000 is a LOAD instruction and the condition below it is an OR instruction between the status of IR 00000 and that of IR 00001 The condition at IR 00002 is another LOAD instruction and the condition below is an OR NOT instruction i e an OR between the status of IR 00002 and ...

Page 361: ...block instructions together can be used only if eight or fewer blocks are being combined i e if seven or fewer logic block instructions are required The following diagram requires AND LOAD to be converted to mnemonic code because three pairs of parallel conditions lie in series The two means of coding the programs are also shown 00000 00002 00004 00001 00003 00005 20000 Address Instruction Operand...

Page 362: ...r of blocks that can be combined with the first method Both of the coding methods described above can also be used when using AND LOAD and OR LOAD as long as the number of blocks being combined does not exceed eight The following diagram contains only two logic blocks as shown It is not neces sary to further separate block b components because it can coded directly using only AND and OR 00000 0000...

Page 363: ...8 OUT 20002 When determining what logic block instructions will be required to code a dia gram it is sometimes necessary to break the diagram into large blocks and then continue breaking the large blocks down until logic blocks that can be coded without logic block instructions have been formed These blocks are then coded combining the small blocks first and then combining the larger blocks Either...

Page 364: ...00000 00001 AND NOT 00001 00002 LD NOT 00002 00003 AND 00003 00004 OR LD 00005 LD 00004 00006 AND 00005 00007 LD 00006 00008 AND 00007 00009 OR LD 00010 AND LD 00011 OUT 20003 The following type of diagram can be coded easily if each block is coded in order first top to bottom and then left to right In the following diagram blocks a and b would be combined using AND LOAD as shown above and then bl...

Page 365: ...Instruction Operands 00000 LD 00002 00001 AND NOT 00003 00002 OR 00001 00003 AND 00000 00004 LD NOT 00004 00005 AND 00005 00006 OR LD 00007 LD NOT 00006 00008 AND 00007 00009 OR LD 00010 OUT LR 0000 The following diagram requires five blocks which here are coded in order before using OR LOAD and AND LOAD to combine them starting from the last two blocks and working backward The OR LOAD at program ...

Page 366: ... first logic block instruction is used to combine the execution conditions re sulting from blocks a and b and the second one is to combine the execution condition of block c with the execution condition resulting from the normally closed condition assigned IR 00003 The rest of the diagram can be coded with OR AND and AND NOT instructions The logical flow for this and the resulting code are shown b...

Page 367: ...le The following diagrams illustrate this In both diagrams instruction 1 is executed before returning to the branching point and moving on to the branch line leading to instruction 2 Instruction 1 00002 00000 Instruction 2 Branching point Instruction 1 00002 00000 Instruction 2 Branching point Diagram B Incorrect Operation Diagram A Correct Operation 00001 Address Instruction Operands 00000 LD 000...

Page 368: ... to establish the initial execution condition This execution condition is then output using an OUTPUT instruction to TR 0 to store the execution condition at the branching point The execution condition is then ANDed with the status of IR 00001 and instruction 1 is executed accordingly The execution condition that was stored at the branching point is then re loaded a LOAD instruction with TR 0 as t...

Page 369: ...ograms is always a concern the order of execution of instructions is sometimes important For example a MOVE instruction may be required before the execution of a BINARY ADD instruction to place the proper data in the required operand word Be sure that you have considered execution order before reorganizing a program to simplify it Instruction 1 00000 Instruction 2 00001 TR 0 Instruction 2 00000 In...

Page 370: ...re quires an operand Instruction 1 00002 00000 Instruction 2 00001 ILC 03 IL 02 Address Instruction Operands 00000 LD 00000 00001 IL 02 00002 LD 00001 00003 Instruction 1 00004 LD 00002 00005 Instruction 2 00006 ILC 03 If IR 00000 is ON in the revised version of diagram B above the status of IR 00001 and that of IR 00002 would determine the execution conditions for instructions 1 and 2 respectivel...

Page 371: ...MP instruction is ON the program is executed normally as if the jump did not exist If the execution condition for the JUMP instruction is OFF program execution moves immediately to a JUMP END instruction without changing the status of anything between the JUMP and JUMP END instruction All JUMP and JUMP END instructions are assigned jump numbers ranging be tween 00 and 99 There are two types of jum...

Page 372: ...ween the JUMP and JUMP END instructions Instruction 1 00000 Instruction 2 00001 JME 05 00 JMP 04 00 00004 Instruction 3 Instruction 4 00006 00005 00003 00002 JMP 04 00 Address Instruction Operands 00000 LD 00000 00001 JMP 04 00 00002 LD 00001 00003 Instruction 1 00004 LD 00002 00005 JMP 04 00 00006 LD 00003 00007 AND NOT 00004 00008 Instruction 2 00009 LD 00005 00010 Instruction 3 00011 LD 00006 0...

Page 373: ...it goes from OFF to ON the DIFFERENTIATE DOWN instruction turns ON the operand bit for one cycle after the execution condition for it goes from ON to OFF Both of these instructions require only one line of mnemonic code 00000 00001 DIFU 13 20001 DIFD 14 20002 Address Instruction Operands 00000 LD 00000 00001 DIFU 13 20001 Address Instruction Operands 00000 LD 00001 00001 DIFD 14 20002 Here IR 2000...

Page 374: ...iagram for the KEEP instruction can be rewritten as shown below The only difference in these diagrams would be their operation in an interlocked program section when the execution condition for the INTERLOCK instruction was ON Here just as in the same diagram using the KEEP instruction two reset bits are used i e HR 0000 can be turned OFF by turning ON either IR 00004 or IR 00005 00002 00003 HR 00...

Page 375: ...re not always specifically referred to as work bits many of the bits used in the examples in Section 7 Instruction Set use work bits Understand ing the use of these bits is essential to effective programming Work bits can be used to simplify programming when a certain combination of conditions is repeatedly used in combination with other conditions In the follow ing example IR 00000 IR 00001 IR 00...

Page 376: ...dress Instruction Operands 00000 LD 00000 00001 DIFU 13 22500 00002 LD 22500 00003 LD 00001 00004 AND NOT 00002 00005 AND NOT 00003 00006 OR LD 00007 LD 00004 00008 AND NOT 00005 00009 OR LD 00010 OUT 20000 6 6 Programming Precautions The number of conditions that can be used in series or parallel is unlimited as long as the memory capacity of the PC is not exceeded Therefore use as many condition...

Page 377: ...n Operands 00000 LD 25313 00001 Instruction There are a few exceptions to this rule including the INTERLOCK CLEAR JUMP END and step instructions Each of these instructions is used as the se cond of a pair of instructions and is controlled by the execution condition of the first of the pair Conditions should not be placed on the instruction lines leading to these instructions Refer to Section 7 Ins...

Page 378: ...order so that for example the desired data is moved to a word before that word is used as the operand for an instruction Remember that an instruction line is completed to the terminal instruction at the right before executing an instruction lines branching from the first instruction line to other terminal instructions at the right Program execution is only one of the tasks carried out by the CPU U...

Page 379: ...bits directly 7 1 Notation 364 7 2 Instruction Format 364 7 3 Data Areas Definer Values and Flags 364 7 4 Differentiated Instructions 366 7 5 Coding Right hand Instructions 367 7 6 Instruction Tables 370 7 6 1 CPM1 CPM1A Function Codes 370 7 6 2 CPM2A CPM2C Function Codes 371 7 6 3 SRM1 V2 Function Codes 372 7 6 4 Alphabetic List by Mnemonic 373 7 7 Ladder Diagram Instructions 376 7 7 1 LOAD LOAD ...

Page 380: ... PID CONTROL PID 426 7 19 Comparison Instructions 432 7 19 1 COMPARE CMP 20 432 7 19 2 TABLE COMPARE TCMP 85 433 7 19 3 BLOCK COMPARE BCMP 68 434 7 19 4 DOUBLE COMPARE CMPL 60 436 7 19 5 AREA RANGE COMPARE ZCP 437 7 19 6 DOUBLE AREA RANGE COMPARE ZCPL 438 7 20 Conversion Instructions 439 7 20 1 BCD TO BINARY BIN 23 439 7 20 2 BINARY TO BCD BCD 24 440 7 20 3 DOUBLE BCD TO DOUBLE BINARY BINL 58 440 ...

Page 381: ...83 7 25 2 BCD DECREMENT DEC 39 483 7 26 Subroutine Instructions 484 7 26 1 SUBROUTINE ENTER SBS 91 484 7 26 2 SUBROUTINE DEFINE and RETURN SBN 92 RET 93 486 7 26 3 MACRO MCRO 99 486 7 27 Pulse Output Instructions 487 7 27 1 SET PULSES PULS 65 487 7 27 2 SPEED OUTPUT SPED 64 489 7 27 3 ACCELERATION CONTROL ACC 491 7 27 4 PULSE WITH VARIABLE DUTY RATIO PWM 494 7 27 5 SYNCHRONIZED PULSE CONTROL SYNC ...

Page 382: ...uction Other operands required by the instruction are contained in following words one operand per word Some instructions require up to four words A definer is an operand associated with an instruction and contained in the same word as the instruction itself These operands define the instruction rather than telling what data it is to use Examples of definers are TC numbers which are used in timer ...

Page 383: ... is specified the designated DM word will contain the address of the DM word that contains the data that will be used as the oper and of the instruction If for example DM 0001 was designated as the first op erand and LR 00 as the second operand of MOV 21 the contents of DM 0001 was 1111 and DM 1111 contained 5555 the value 5555 would be moved to LR 00 MOV 21 DM 0001 LR 00 Word Content DM 0000 4C59...

Page 384: ...ed 25 times and only the last value moved to DM 0000 will be preserved there In diagram B the differentiated MOV 21 will move the content of HR 10 to DM 0000 only once after 00000 goes ON Even if 00000 remains ON for 2 0 seconds with the same 80 ms cycle time the move operation will be executed only once during the first cycle in which 00000 has changed from OFF to ON Because the content of HR 10 ...

Page 385: ...o cross through any blank data column spaces for all instruction words that do not require data so that the data column can be quickly scanned to see if any addresses have been left out If an IR or SR address is used in the data column the left side of the column is left blank If any other data area is used the data area abbreviation is placed on the left side and the address is placed on the righ...

Page 386: ...FU 13 21600 00004 LD 00100 00005 AND NOT 00200 00006 LD 01001 00007 AND NOT 01002 00008 AND NOT LR 0000 00009 OR LD 00010 AND 21600 00011 BCNT 67 0001 004 HR 00 00012 LD 00005 00013 TIM 000 0150 00014 LD TIM 000 00015 MOV 21 HR 00 LR 00 00016 LD HR 0015 00017 OUT NOT 01000 00100 00200 DIFU 13 21600 01000 BCNT 67 0001 004 HR 00 MOV 21 HR 00 LR 00 01001 01002 LR 0000 TIM 000 21600 00002 00005 HR 001...

Page 387: ...o form logic blocks that are combined by the right hand instruction An example of this for SFT 10 is shown below I P R SFT 10 HR 00 HR 00 Address Instruction Data 00000 LD 00000 00001 AND 00001 00002 LD 00002 00003 LD 00100 00004 AND NOT 00200 00005 LD 01001 00006 AND NOT 01002 00007 AND NOT LR 0000 00008 OR LD 00009 AND 21600 00010 SFT 10 HR 00 HR 00 00011 LD HR 0015 00012 OUT NOT 01001 00100 002...

Page 388: ...CHRO NOUS SHIFT REGISTER 2 CMP COMPARE MOV MOVE MVN MOVE NOT BIN BCD TO BINARY BCD BINARY TO BCD ASL SHIFT LEFT ASR SHIFT RIGHT ROL ROTATE LEFT ROR ROTATE RIGHT COM COMPLE MENT 3 ADD BCD ADD SUB BCD SUBTRACT MUL BCD MULTIPLY DIV BCD DIVIDE ANDW LOGICAL AND ORW LOGICAL OR XORW EXCLUSIVE OR XNRW EXCLUSIVE NOR INC INCREMENT DEC DECRE MENT 4 STC SET CARRY CLC CLEAR CARRY MSG MESSAGE DISPLAY 5 ADB BINA...

Page 389: ...LE BCD DIVIDE BINL DOUBLE BCD TO DOUBLE BINARY BCDL DOUBLE BINARY TO DOUBLE BCD 6 CMPL DOUBLE COMPARE INI MODE CON TROL PRV HIGH SPEED COUNTER PV READ CTBL COMPARI SON TABLE LOAD SPED SPEED OUT PUT PULS SET PULSES SCL SCALING BCNT BIT COUNT ER BCMP BLOCK COMPARE STIM INTERVAL TIMER 7 XFER BLOCK TRANSFER BSET BLOCK SET XCHG DATA EXCHANGE SLD ONE DIGIT SHIFT LEFT SRD ONE DIGIT SHIFT RIGHT MLPX 4 TO ...

Page 390: ...T DEC DECRE MENT 4 STC SET CARRY CLC CLEAR CARRY MSG MESSAGE DISPLAY RXD RECEIVE TXD TRANSMIT 5 ADB BINARY ADD SBB BINARY SUBTRACT MLB BINARY MULTIPLY DVB BINARY DIVIDE ADDL DOUBLE BCD ADD SUBL DOUBLE BCD SUBTRACT MULL DOUBLE BCD MULTIPLY DIVL DOUBLE BCD DIVIDE 6 CMPL DOUBLE COMPARE SCL SCALING BCNT BIT COUNT ER BCMP BLOCK COMPARE STIM INTERVAL TIMER 7 XFER BLOCK TRANSFER BSET BLOCK SET XCHG DATA ...

Page 391: ...BCD 24 3 BINARY TO BCD All 440 BCDL 59 3 DOUBLE BINARY TO DOUBLE BCD CPM2A CPM2C 441 BCMP 68 4 BLOCK COMPARE All 434 BCNT 67 4 BIT COUNTER All 499 BIN 23 3 BCD TO BINARY All 439 BINL 58 3 DOUBLE BCD TO DOUBLE BINARY CPM2A CPM2C 440 BSET 71 4 BLOCK SET All 414 CLC 41 1 CLEAR CARRY All 457 CMP 20 3 COMPARE All 432 CMPL 60 4 DOUBLE COMPARE All 436 CNT None 2 COUNTER All 394 CNTR 12 3 REVERSIBLE COUNT...

Page 392: ...PM2A CPM2C SRM1 V2 455 NOP 00 1 NO OPERATION All 381 OR None 1 OR All 376 OR LD None 1 OR LOAD All 377 OR NOT None 1 OR NOT All 376 ORW 35 4 LOGICAL OR All 481 OUT None 2 OUTPUT All 377 OUT NOT None 2 OUTPUT NOT All 377 PID 4 PID CONTROL CPM2A CPM2C SRM1 V2 426 PRV 62 4 HIGH SPEED COUNTER PV READ All except SRM1 401 PULS 65 4 SET PULSES CPM1A CPM2A CPM2C Transistor outputs only 487 PWM 4 PULSE WIT...

Page 393: ...UP 3 CHANGE RS 232C SETUP CPM2A CPM2C SRM1 509 SUB 31 4 BCD SUBTRACT All 458 SUBL 55 4 DOUBLE BCD SUBTRACT All 464 SUM 4 SUM CPM2A CPM2C 478 SYNC 4 SYNCHRONIZED PULSE CONTROL CPM2A CPM2C 496 TCMP 85 4 TABLE COMPARE All 433 TIM None 2 TIMER All 389 TIMH 15 3 HIGH SPEED TIMER All 390 TIML 4 LONG TIMER CPM2A CPM2C 392 TMHH 4 VERY HIGH SPEED TIMER CPM2A CPM2C 391 TXD 48 4 TRANSMIT CPM2A CPM2C SRM1 507...

Page 394: ...These six basic instructions correspond to the conditions on a ladder diagram As described in Section 6 Ladder diagram Programming the status of the bits assigned to each instruction determines the execution conditions for all other instructions Each of these instructions and each bit address can be used as many times as required Each can be used in as many of these instructions as required The st...

Page 395: ...t in mnemonic form In order to reduce the number of programming instructions required a basic un derstanding of logic block instructions is required For an introduction to logic blocks refer to 6 3 6 Logic Block Instructions Flags There are no flags affected by these instructions 7 8 Bit Control Instructions There are seven instructions that can be used generally to control individual bit status T...

Page 396: ... RSET B Bit IR SR AR HR LR Ladder Symbols Operand Data Areas SET B B Bit IR SR AR HR LR RSET B SET turns the operand bit ON when the execution condition is ON and does not affect the status of the operand bit when the execution condition is OFF RSET turns the operand bit OFF when the execution condition is ON and does not af fect the status of the operand bit when the execution condition is OFF Th...

Page 397: ...ne instruction that controls its sta tus KEEP 11 is used to maintain the status of the designated bit based on two execution conditions These execution conditions are labeled S and R S is the set input R the reset input KEEP 11 operates like a latching relay that is set by S and reset by R When S turns ON the designated bit will go ON and stay ON until reset regard less of whether S stays ON or go...

Page 398: ...13 will turn ON the designated bit If the previous execu tion condition was ON and the current execution condition is either ON or OFF DIFU 13 will either turn the designated bit OFF or leave it OFF i e if the desig nated bit is already OFF The designated bit will thus never be ON for longer than one cycle assuming it is executed each cycle see Precautions below Whenever executed DIFD 14 compares ...

Page 399: ... END 01 END 01 is required as the last instruction in any program If there are subrou tines END 01 is placed after the last subroutine No instruction written after END 01 will be executed END 01 can be placed anywhere in the program to execute all instructions up to that point as is sometimes done to debug a pro gram but it must be removed to execute the remainder of the program If there is no END...

Page 400: ...er the execution condition for the IL 02 has gone ON the execution condition for the DIFU 13 or DIFD 14 will be compared to the execution condition that existed before the interlock became effective i e before the interlock condition for IL 02 went OFF The ladder diagram and bit status changes for this are shown below The interlock is in effect while 00000 is OFF Notice that 20000 is not turned ON...

Page 401: ...umber JME 05 N Jump numbers 01 through 49 may be used only once in JMP 04 and once in JME 05 i e each can be used to define one jump only Jump number 00 can be used as many times as desired JMP 04 is always used in conjunction with JME 05 to create jumps i e to skip from one point in a ladder diagram to another point JMP 04 defines the point from which the jump will be made JME 05 defines the dest...

Page 402: ...en between JMP 04 and JME 05 Once either DIFU 13 or DIFD 14 has turned ON a bit it will remain ON until the next time DIFU 13 or DIFD 14 is executed again In normal pro gramming this means the next cycle In a jump this means the next time the jump from JMP 04 to JME 05 is not made i e if a bit is turned ON by DIFU 13 or DIFD 14 and then a jump is made in the next cycle so that DIFU 13 or DIFD 14 a...

Page 403: ...ROR indi cator on the front of the CPU Unit will flash but PC operation will continue When FALS 07 is executed with an ON execution condition the ALARM ERROR indi cator will light and PC operation will stop The system also generates error codes to the FAL area FAL error codes will be retained in memory although only one of these is avail able in the FAL area To access the other FAL codes reset the...

Page 404: ... e its execution is controlled through the control bit To start execu tion of the step SNXT 09 is used with the same control bit as used for STEP 08 If SNXT 09 is executed with an ON execution condition the step with the same control bit is executed If the execution condition is OFF the step is not executed The SNXT 09 instruction must be written into the program so that it is executed before the ...

Page 405: ...8 20200 Step controlled by IR 20200 00200 LD 00002 00201 SNXT 09 23000 00202 STEP 08 Steps can be programmed in consecutively Each step must start with STEP 08 and generally ends with SNXT 09 see example 3 below for an exception When steps are programmed in series three types of execution are possible sequential branching or parallel The execution conditions for and the position ing of SNXT 09 det...

Page 406: ...required as operands in instructions other than timer and counter instructions TC numbers run from 000 through 255 in the CPM2A CPM2C PCs and from 000 through 127 in the CPM1 CPM1A SRM1 V2 PCs No prefix is required when using a TC number as a definer in a timer or counter instruction Once defined as a timer a TC number can be prefixed with TIM for use as an operand in certain instructions The TIM ...

Page 407: ...om 000 through 255 in the CPM2A CPM2C PCs and from 000 through 127 in the CPM1 CPM1A SRM1 V2 PCs TC 000 through TC 003 TC 000 through TC 015 in the CPM2A CPM2C should not be used in TIM if they are required for TIMH 15 Refer to 7 15 2 HIGH SPEED TIMER TIMH 15 for details In the CPM2A CPM2C PCs TC 004 through TC 007 should not be used in TIM if they are required for TMHH Refer to 7 15 3 VERY HIGH S...

Page 408: ...number can be used as the definer in only one TIMER or COUNTER instruction TC numbers run from 000 through 255 in the CPM2A CPM2C PCs and from 000 through 127 in the CPM1 CPM1A SRM1 V2 PCs TIMH 15 operates in the same way as TIM except that TIMH measures in units of 0 01 second Refer to 7 15 1 TIMER TIM for operational details Timers in interlocked program sections are reset when the execution con...

Page 409: ...urned OFF 00000 TIM 000 01600 1 5 s TIMH 15 Address Instruction Operands 00000 LD 00000 00001 TIMH 15 000 0150 00002 LD TIM 000 00003 OUT 01600 000 0150 7 15 3 VERY HIGH SPEED TIMER TMHH N TC number see Limitations Ladder Symbol Operand Data Areas 000 Set to 000 SV Set value IR SR AR DM HR LR TMHH N SV 000 This instruction is supported by the CPM2A CPM2C only Each TC number can be used as the defi...

Page 410: ...ed program sections are reset to the SV when the execution condition for IL 02 is OFF If the timer s set value is set to 0000 the Completion Flag will turn ON as soon as the timer s execution condition turns ON If TIM004 to TIM007 are used howev er there may be a delay before the flag turns ON If the timer s set value is set to 0001 the Completion Flag will turn ON some where between 0 and 1 ms af...

Page 411: ...alue other than 0000 with an instruction such as MOV 21 Long timers in jumped program sections will not be reset when the execution condition for JMP 04 is OFF but the timer will stop timing and the PV will be maintained Timing will resume when the execution condition for JMP 04 goes ON again This can greatly reduce the accuracy of long timers in jumped pro gram sections Precautions TIML may not b...

Page 412: ...s from OFF to ON i e the present value PV will be decrem ented by one whenever CNT is executed with an ON execution condition for CP and the execution condition was OFF for the last execution If the execution condition has not changed or has changed from ON to OFF the PV of CNT will not be changed The Completion Flag for a counter is turned ON when the PV reaches zero and will remain ON until the ...

Page 413: ...r short ON times might not be read accurately during longer cycles In partic ular the 0 02 second and 0 1 second clock pulses should not be used to create timers with CNT instructions 7 15 6 REVERSIBLE COUNTER CNTR 12 N TC number Ladder Symbol Definer Values SV Set value word BCD IR SR AR DM HR LR Operand Data Areas II DI CNTR 12 N SV R Each TC number can be used as the definer in only one TIMER o...

Page 414: ...the PV only Execution condition on increment II Execution condition on decrement DI ON OFF ON OFF Completion Flag ON OFF PV SV SV 1 SV 2 0001 0000 0000 SV SV 1 SV 2 Program execution will continue even if a non BCD SV is used but the SV will not be correct Flags ER Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded 7 15 7 REGISTER C...

Page 415: ...from a range comparison but the two functions share some common characteristics 1 2 3 1 Subroutine numbers 000 to 049 can be used and the same subroutine num ber can be used more than once in the table 2 An undefined subroutine number or FFFF can be set for the subroutine number if interrupt processing is not required 3 Comparison can be stopped with INI 61 A registered table is valid until PC ope...

Page 416: ...the PV is within two or more ranges the subroutine for the first of the ranges will be executed The following diagram shows the structure of a range comparison table Always set 8 ranges If fewer than 8 ranges are needed set the remaining subroutine numbers to FFFF TB Lower limit 1 lower 4 digits BCD TB 1 Lower limit 1 upper 4 digits BCD TB 2 Upper limit 1 lower 4 digits BCD TB 3 Upper limit 1 uppe...

Page 417: ... and the instruction will not be executed Range Comparison Errors A range s upper limit value is less than its lower limit value A target value is not between F838 8608 and 0838 8607 differential phase mode pulse direction input mode and up down input mode A target value is not between 0000 0000 and 1677 7215 or a subroutine number is not between 0000 and 0049 increment mode 7 15 8 MODE CONTROL IN...

Page 418: ...e high speed counter s PV to the comparison table registered with CTBL 63 An error will occur if this function is executed without first registering a comparison table with CTBL 63 In general INI 61 should be used when C 000 because the instruction needs to be executed only one time to start table comparison If C is 002 INI 61 changes the PV of the specified high speed counter or inter rupt input ...

Page 419: ... 64 PULS 65 ACC PWM or SYNC is being executed in the main program INI 61 is executed in an interrupt subroutine while a pulse I O or high speed counter instruction is being executed in the main program 7 15 9 HIGH SPEED COUNTER PV READ PRV 62 P Port specifier 000 010 100 101 102 103 Ladder Symbols Operand Data Areas PRV 62 P C D D First destination word IR SR AR DM HR LR C Control data 000 001 002...

Page 420: ...or the input frequency of the synchronized pulse control D and D 1 001 Reads the status of the high speed counter or pulse output D 002 Reads the results of range comparison D 003 Reads the PV of the pulse output D and D 1 Note This setting can be used in CPM2A CPM2C PCs only If C is 000 PRV 62 reads the PV of the specified high speed counter or interrupt input counter mode High speed Counter PV o...

Page 421: ...mpleted 07 Pulse output 1 status 0 Stopped 1 Outputting 08 Pulse output 1 PV underflow overflow 0 Normal 1 Underflow Overflow occurred 09 Pulse output 1 acceleration 0 Constant 1 Accelerating or decelerating If C is 002 PRV 62 reads the results of the comparison of the PV to the 8 ranges defined by CTBL 63 and writes this data to D Bits 00 through 07 of D contain the Comparison Result Flags for ra...

Page 422: ...htmost bit of a shift register defined between St and E i e if I is ON a 1 is shifted into the regis ter if I is OFF a 0 is shifted in When I is shifted into the register all bits previously in the register are shifted to the left and the leftmost bit of the register is lost Execution condition I Lost data E St 1 St 2 St The execution condition on P functions like a differentiated instruction i e ...

Page 423: ...ust be in the same data area and E must be greater than or equal to St DM 6144 to DM 6655 cannot be used for St or E When the execution condition is OFF WSFT 16 is not executed When the execution condition is ON WSFT 16 shifts data between St and E in word units Zeros are written into St and the content of E is lost F 0 C 2 3 4 5 2 1 0 2 9 E St 1 St 3 4 5 2 1 0 2 9 0 0 0 0 E St 1 St Lost 0000 Flag...

Page 424: ... Symbols Operand Data Areas ASR 26 Wd ASR 26 Wd Limitations DM 6144 to DM 6655 cannot be used for Wd When the execution condition is OFF ASR 25 is not executed When the execution condition is ON ASR 25 shifts a 0 into bit 15 of Wd shifts the bits of Wd one bit to the right and shifts the status of bit 00 into CY 1 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 Bit 00 Bit 15 CY 0 A 0 will be shifted into bit 15 eve...

Page 425: ...erwise OFF 7 16 6 ROTATE RIGHT ROR 28 Wd Rotate word IR SR AR DM HR LR Ladder Symbols Operand Data Areas ROR 28 Wd ROR 28 Wd Limitations DM 6144 to DM 6655 cannot be used for Wd When the execution condition is OFF ROR 28 is not executed When the execution condition is ON ROR 28 shifts all Wd bits one bit to the right shifting CY into bit 15 of Wd and shifting bit 00 of Wd into CY 0 1 0 1 0 1 0 0 0...

Page 426: ... digit of St every cycle if the undifferen tiated form of SLD 74 is used Use the differentiated form SLD 74 or com bine SLD 74 with DIFU 13 or DIFD 14 to shift just one time Flags ER The St and E words are in different areas or St is greater than E Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded 7 16 8 ONE DIGIT SHIFT RIGHT SRD 7...

Page 427: ...o either the right or the left To create a single word register designate the same word for St and E The control word provides the shift direction the status to be put into the register the shift pulse and the reset input The control word is allocated as follows Not used Shift direction 1 ON Left LSB to MSB 0 OFF Right MSB to LSB Status to input into register Shift pulse bit Reset 15 14 13 12 The ...

Page 428: ...setting and can be changed for the SRM1 V2 if desired Limitations St and E must be in the same data area and E must be greater than or equal to St DM 6144 to DM 6655 cannot be used for St or E Description When the execution condition is OFF ASFT 17 does nothing and the program moves to the next instruction When the execution condition is ON ASFT 17 is used to create and control a reversible asynch...

Page 429: ...rd is non existent Content of DM word is not BCD or the DM area boundary has been exceeded Example The following example shows instruction ASFT 17 used to shift words in an 11 word shift register created between DM 0100 and DM 0110 with C 6000 Non zero data is shifted towards St DM 0110 ASFT 17 6000 DM 0100 DM 0110 00000 Address Instruction Operands 00000 LD 00000 00001 ASFT 17 6000 DM 0100 DM 011...

Page 430: ...o ON MOV 21 001 HR 05 00000 Address Instruction Operands 00000 LD 00000 00001 MOV 21 001 HR 05 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 HR 05 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 IR 000 0 0 7 17 2 MOVE NOT MVN 22 S Source word IR SR AR DM HR TC LR D Destination word IR SR AR DM HR LR Ladder Symbols Operand Data Areas MVN 22 S D MVN 22 S D Limitations DM 6144 to DM 6655 cannot be used for D When the execution condit...

Page 431: ... 0 1 1 0 0 1 0 1 F8C5 0 1 7 17 3 BLOCK TRANSFER XFER 70 N Number of words BCD IR SR AR DM HR TC LR S Starting source word IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas D Starting destination word IR SR AR DM HR TC LR XFER 70 N S D XFER 70 N S D S and S N must be in the same data area as must D and D N DM 6144 to DM 6655 cannot be used for D When the execution condition is OFF XFER 70 is n...

Page 432: ...rds from St through E 2 S 3 4 5 2 St 3 4 5 2 St 1 3 4 5 2 St 2 3 4 5 2 E 3 4 5 BSET 71 can be used to change timer counter PV This cannot be done with MOV 21 or MVN 22 BSET 71 can also be used to clear sections of a data area i e the DM area to prepare for executing other instructions It can also be used to clear words by transferring all zeros Flags ER St and E are not in the same data area or St...

Page 433: ...d Data Areas C Control word BCD IR SR AR DM HR TC LR DIST 80 S DBs C DIST 80 S DBs C C must be BCD DM 6144 to DM 6655 cannot be used for DBs or C DIST 80 can be used for single word distribution or for a stack operation de pending on the content of the control word C When bits 12 to 15 of C 0 to 8 DIST 80 can be used for a single word distribute operation The entire contents of C specifies an offs...

Page 434: ...he content of DBs is then incremented by 1 Note 1 DIST 80 will be executed every cycle unless the differentiated form DIST 80 is used or DIST 80 is used with DIFU 13 or DIFD 14 2 Be sure to initialize the stack pointer before using DIST 80 as a stack op eration Example The following example shows how to use DIST 80 to create a stack between DM 0001 and DM 0005 DM 0000 acts as the stack pointer DIS...

Page 435: ...LL 81 copies the content of SBs Of to D i e Of is added to SBs to determine the source word Note 1 SBs and SBs Of must be in the same data area 2 IR 000 to IR 019 or IR 000 to IR 049 is treated as a different memory area from IR 200 to IR 255 for the source data area The entire source data area must be within one or the other of these areas An error will occur if words from both areas are included...

Page 436: ...0 Address Instruction Operands 00000 LD 00000 00001 COLL 81 DM 0000 216 001 DM 0000 0005 DM 0001 AAAA DM 0002 BBBB DM 0003 CCCC DM 0004 DDDD DM 0005 EEEE Stack pointer decremented IR 216 9005 DM 0000 0004 DM 0001 BBBB DM 0002 CCCC DM 0003 DDDD DM 0004 EEEE DM 0005 EEEE IR 001 AAAA LIFO Stack Operation When bits 12 to 15 of C 8 COLL 81 can be used for an LIFO stack operation The other 3 digits of C...

Page 437: ...The offset or stack length in the control word is not BCD Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded During stack operation the value of the stack pointer exceeds the length of the stack an attempt was made to write to a word beyond the end of the stack EQ ON when the content of S is zero otherwise OFF 7 17 8 MOVE BIT MOVB 8...

Page 438: ...i Digit designator BCD IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas D Destination word IR SR AR DM HR TC LR MOVD 83 S Di D MOVD 83 S Di D Limitations The rightmost three digits of Di must each be between 0 and 3 DM 6144 to DM 6655 cannot be used for Di or D When the execution condition is OFF MOVD 83 is not executed When the execution condition is ON MOVD 83 copies the content of the spe...

Page 439: ...S must be BCD P1 through P1 3 must be in the same data area DM 6144 to DM 6655 cannot be used for P1 through P1 3 or R Description SCL 66 is used to linearly convert a 4 digit hexadecimal value to a 4 digit BCD value Unlike BCD 24 which converts a 4 digit hexadecimal value to its 4 digit BCD equivalent Shex SBCD SCL 66 can convert the hexadecimal value ac cording to a specified linear relationship...

Page 440: ...nverting all values to BCD and then using the following formula Results BY BY AY BX AX BX S Flags ER The value in P1 1 equals that in P1 3 Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded P1 and P1 3 are not in the same data area or other setting error EQ ON when the result R is 0000 Example When 00000 is turned ON in the followin...

Page 441: ...he line specified in the parame ter words P1 to P1 2 When the execution condition is OFF SCL2 is not executed When the execution condition is ON SCL2 converts the 4 digit signed hexadecimal value in S to the 4 digit BCD value on the line defined by the x intercept P1 0 and the slope P1 2 P1 1 and places the results in R The result is rounded off to the nearest integer If the result is negative the...

Page 442: ...ameters in DM 0000 to DM 0002 The result 0018 is then written to LR 00 and CY is turned ON because the result is negative SCL2 DM 0000 200 05000 LR 00 Address Instruction Operands 00000 LD 05000 00001 SCL2 200 DM 0000 LR 00 DM 0000 FFFD DM 0001 0003 DM 0002 0002 IR 200 FFE2 LR 00 0018 FFFD 3 2 CY 1 FFE2 0018 CY flag is turned ON because the conversion result is negative R 0002 0003 FFE2 FFFD 2 3 1...

Page 443: ...1 3 then the upper limit is written to R If the result is less than the lower limit in P1 4 then the lower limit is written to R Note The upper and lower limits for a 12 bit Analog Input Unit would be 07FF and F800 The following table shows the functions and ranges of the parameter words Parameter Function Range P1 x intercept signed hex 8000 to 7FFF 32 768 to 32 767 P1 1 X BCD 0001 to 9999 P1 2 Y...

Page 444: ...ays ON 00101 SCL3 DM 0000 LR 02 DM 0100 DM 0000 0005 DM 0001 0003 DM 0002 0006 DM 0003 07FF DM 0004 F800 LR 02 0100 DM 0100 00CD 0005 3 6 CY 0 BCD Signed hex LR 02 1035 DM 0100 F800 CY 1 7 18 4 PID CONTROL PID IW Input data word IR SR AR DM HR LR Ladder Symbol Operand Data Areas OW Output data word IR SR AR DM HR LR P1 First parameter word IR SR DM HR LR PID IW P1 OW Limitations This instruction i...

Page 445: ...ive control Set the derivative time divided by the sampling time P1 4 00 to 15 Sampling period τ Sets the interval between samplings of the input data It must be BCD from 0001 to 1023 The period will be from 0 1 to 102 3 s P1 5 00 to 03 Operation specifier Sets reverse or normal operation Set to 0 to specify reverse operation or 1 to specify normal operation 04 to 15 Input filter coefficient α Det...

Page 446: ...nges from OFF to ON Execution Condition ON The PID action is executed at the intervals based on the sampling period ac cording to the PID parameters that have been set Sampling Period and PID Execution Timing The sampling period is the time interval to retrieve the measurement data for carrying out a PID action PID however is executed according to CPU cycle so there may be cases where the sampling...

Page 447: ...tional action an offset residual devi ation generally occurs but the offset can be reduced by making the proportional band smaller If it is made too small however hunting will occur Proportional Action Reverse Action Adjusting the Proportional Band SV Proportional band too narrow hunting occurring Proportional band just right Proportional band too wide large offset Offset Manipulated variable Prop...

Page 448: ...t to the step deviation as shown in the following illustration The longer the derivative time the stronger the correction by the derivative action will be Derivative Action PD Action and Derivative Time Step response PD action P action Td Derivative time D action Ramp response Deviation Manipulated variable Deviation Manipulated variable PID Action PID action combines proportional action P integra...

Page 449: ...meters and control status is shown below When it is not a problem if a certain amount of time is required for stabilization settlement time but it is important not to cause overshooting then enlarge the proportional band SV Control by measured PID When P is enlarged When overshooting is not a problem but it is desirable to quickly stabilize con trol then narrow the proportional band If the proport...

Page 450: ... 19 Comparison Instructions 7 19 1 COMPARE CMP 20 Cp1 First compare word IR SR AR DM HR TC LR Cp2 Second compare word IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas CMP 20 Cp1 Cp2 When comparing a value to the PV of a timer or counter the value must be in BCD When the execution condition is OFF CMP 20 is not executed When the execution condition is ON CMP 20 compares Cp1 and Cp2 and output...

Page 451: ...0000 25505 20000 25507 20002 TR 0 25506 20001 Greater Than Equal Less Than 7 19 2 TABLE COMPARE TCMP 85 CD Compare data IR SR DM HR TC LR TB First comparison table word IR SR DM HR TC LR Ladder Symbols Operand Data Areas R Result word IR SR DM HR TC LR TCMP 85 CD TB R TCMP 85 CD TB R DM 6144 to DM 6655 cannot be used for R When the execution condition is OFF TCMP 85 is not executed When the execut...

Page 452: ... DM 0013 1400 IR 21013 0 DM 0014 0210 IR 21014 1 DM 0015 1600 IR 21015 0 TCMP 85 HR 00 DM 0000 216 00000 Compare the data in IR 001 with the given ranges Address Instruction Operands 00000 LD 00000 00001 TCMP 85 HR 00 DM 0000 216 7 19 3 BLOCK COMPARE BCMP 68 CD Compare data IR SR AR DM HR TC LR CB First comparison block word IR SR DM HR TC LR Ladder Symbols Operand Data Areas R Result word IR SR A...

Page 453: ...omparisons that are made and the corresponding bit in R that is set for each true comparison are shown below The rest of the bits in R will be turned OFF CB CD CB 1 Bit 00 CB 2 CD CB 3 Bit 01 CB 4 CD CB 5 Bit 02 CB 6 CD CB 7 Bit 03 CB 8 CD CB 9 Bit 04 CB 10 CD CB 11 Bit 05 CB 12 CD CB 13 Bit 06 CB 14 CD CB 15 Bit 07 CB 16 CD CB 17 Bit 08 CB 18 CD CB 19 Bit 09 CB 20 CD CB 21 Bit 10 CB 22 CD CB 23 B...

Page 454: ...ction Operands 00000 LD 00000 00001 BCMP 68 HR 00 DM 0010 LR 05 7 19 4 DOUBLE COMPARE CMPL 60 Cp2 First word of second compare word pair IR SR AR DM HR TC LR Cp1 First word of first compare word pair IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas CMPL 60 Cp1 Cp2 Note CMPL 60 is an expansion instruction for the SRM1 V2 The function code 60 is the factory setting and can be changed for the S...

Page 455: ... 20000 25507 20002 TR 0 25506 20001 Greater Than Equal Less Than Address Instruction Operands 00000 LD 00000 00001 OUT TR 0 00002 CMPL 60 HR 09 DM 0000 00003 AND 25505 00004 OUT 20000 00005 LD TR 0 00006 AND 25506 00007 OUT 20001 00008 LD TR 0 00009 AND 25507 00010 OUT 20002 7 19 5 AREA RANGE COMPARE ZCP CD Compare data IR SR AR DM HR TC LR LL Lower limit of range IR SR AR DM HR TC LR Ladder Symbo...

Page 456: ... AB1F Since 0010 6FA4 AB1F the EQ flag and IR 10101 are turned ON 00000 LD 00000 00001 OUT TR 0 00002 ZCP 200 0010 AB1F 00003 AND 25505 00004 OUT 01000 00005 LD TR 0 00006 AND 25506 00007 OUT 01001 00008 LD TR 0 00009 AND 25507 00010 OUT 01002 ZCP 0010 200 00000 25505 01000 25507 01002 TR 0 25506 01001 Greater Than above range Equal within range Less Than below range Address Instruction Operands A...

Page 457: ...nt Content of DM word is not BCD or the DM area boundary has been exceeded LL 1 LL is greater than UL 1 UL EQ ON if LL 1 LL CD CD 1 UL 1 UL LE ON if CD CD 1 LL 1 LL GR ON if CD CD 1 UL 1 UL 7 20 Conversion Instructions 7 20 1 BCD TO BINARY BIN 23 S Source word BCD IR SR AR DM HR TC LR R Result word IR SR AR DM HR LR Ladder Symbols Operand Data Areas BIN 23 S R BIN 23 S R Limitations DM 6144 to DM ...

Page 458: ... the BCD bits to R Only the content of R is changed the content of S is left unchanged S R BCD Binary BCD 24 can be used to convert binary to BCD so that displays on the Program ming Console or any other programming device will appear in decimal rather than hexadecimal It can also be used to convert to BCD to perform BCD arith metic operations rather than binary arithmetic operations e g when BCD ...

Page 459: ... LR R First result word IR SR AR DM HR LR Ladder Symbols Operand Data Areas BCDL 59 S R BCDL 59 S R Limitations This instruction is available in the CPM2A CPM2C only If the content of S exceeds 05F5E0FF the converted result would exceed 99999999 and BCDL 59 will not be executed When the instruction is not executed the content of R and R 1 remain unchanged DM 6144 to DM 6655 cannot be used for R BC...

Page 460: ...with R See examples be low The following is an example of a one digit decode operation from digit number 1 of S i e here Di would be 0001 Source word First result word C 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 Bit C i e bit number 12 turned ON The first digit and the number of digits to be converted are designated in Di If more digits are designated than remain in S counting from the designated first digi...

Page 461: ...PX 76 DM 0020 0021 HR 10 Address Instruction Operands 00000 LD 00000 00001 MLPX 76 DM 0020 0021 HR 10 S DM 0020 R HR 10 R 1 HR 11 R 2 HR 12 DM 0020 00 HR 1000 0 HR 1100 0 HR 1200 1 DM 0020 01 HR 1001 0 HR 1101 0 HR 1201 0 DM 0020 02 HR 1002 0 HR 1102 0 HR 1202 0 DM 0020 03 HR 1003 0 HR 1103 0 HR 1203 0 DM 0020 04 1 HR 1004 0 HR 1104 0 HR 1204 0 DM 0020 05 1 HR 1005 0 HR 1105 0 HR 1205 0 DM 0020 06...

Page 462: ...ed in Di which also specifies the number of digits to be encoded The following is an example of a one digit encode operation to digit number 1 of R i e here Di would be 0001 Result word First source word C 0 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 C transferred to indicate bit number 12 as the highest ON bit Up to four digits from four consecutive source words starting with S may be en coded and the digits ...

Page 463: ...n 00000 is ON the following diagram encodes IR words 200 and 201 to the first two digits of HR 10 and then encodes LR 10 and 11 to the last two digits of HR 10 Although the status of each source word bit is not shown it is assumed that the bit with status 1 ON shown is the highest bit that is ON in the word 00000 DMPX 77 200 HR 10 0010 LR 10 HR 10 0012 IR 200 01000 01011 1 01012 0 01015 0 LR 10 LR...

Page 464: ...he digits in S may be converted in sequence from the designated first digit The first digit the number of digits to be converted and the half of D to receive the first 7 segment display code rightmost or leftmost 8 bits are desig nated in Di If multiple digits are designated they will be placed in order starting from the designated half of D each requiring two digits If more digits are desig nated...

Page 465: ...versions that they produce are shown below 0 1 2 3 S digits Di 0011 D 0 1 2 3 Di 0030 S digits 0 1 2 3 Di 0130 S digits Di 0112 0 1 2 3 S digits 1st half 2nd half D 1st half 2nd half D 1 1st half 2nd half D 1st half 2nd half D 1 1st half 2nd half D 1st half 2nd half D 1 1st half 2nd half D 2 1st half 2nd half ...

Page 466: ...102 x103 0 One digit 0 or 1 0 Bits 00 through 07 1 Bits 08 through 15 Not used a b c d e f g Bit 07 8 1 Second digit LR 07 Bit 00 00000 SDEC 78 DM 0010 LR 07 200 Original data Converted code segments Display Digit Bits g f e d c b a 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0 2 0 0 1 0 0 0 1 1 0 0 1 1 3 0 0 1 1 0 0 1 1 0 0 1 1 4 0 1 0 0 0 0 1 1 0 1 0 0 5 0 1 0 1 0 0 1 1 0 1 0 1 6 0 1 1 0 0...

Page 467: ...nto the destination word s beginning with D Any or all of the digits in S may be converted in order from the designated first digit The first digit the number of digits to be converted and the half of D to re ceive the first ASCII code rightmost or leftmost 8 bits are designated in Di If multiple digits are designated they will be placed in order starting from the des ignated half of D each requir...

Page 468: ... be zero When even parity is designated the leftmost bit will be adjusted so that the total number of ON bits is even e g when adjusted for even parity ASCII 31 00110001 will be B1 10110001 parity bit turned ON to create an even num ber of ON bits ASCII 36 00110110 will be 36 00110110 parity bit turned OFF because the number of ON bits is already even The status of the parity bit does not affect t...

Page 469: ... be converted beginning with the designated first byte of S The converted hexadecimal values are then placed in D in order from the designated digit The first byte rightmost or leftmost 8 bits the number of bytes to be converted and the digit of D to receive the first hexadecimal value are designated in Di If multiple bytes are designated they will be converted in order starting from the designate...

Page 470: ...1 1 0 0 1 0 2 0 0 1 0 33 0 1 1 0 0 1 1 3 0 0 1 1 34 0 1 1 0 1 0 0 4 0 1 0 0 35 0 1 1 0 1 0 1 5 0 1 0 1 36 0 1 1 0 1 1 0 6 0 1 1 0 37 0 1 1 0 1 1 1 7 0 1 1 1 38 0 1 1 1 0 0 0 8 1 0 0 0 39 0 1 1 1 0 0 1 9 1 0 0 1 41 1 0 1 0 0 0 1 A 1 0 1 0 42 1 0 1 0 0 1 0 B 1 0 1 1 43 1 0 1 0 0 1 1 C 1 1 0 0 44 1 0 1 0 1 0 0 D 1 1 0 1 45 1 0 1 0 1 0 1 E 1 1 1 0 46 1 0 1 0 1 1 0 F 1 1 1 1 Note The leftmost bit of ea...

Page 471: ... SEC S Beginning source word BCD IR SR AR DM HR TC LR R Beginning result word BCD IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas 000 No function 000 SEC S R 000 SEC S R 000 Limitations This instruction is available in the CPM2A CPM2C only S and S 1 must be within the same data area R and R 1 must be within the same data area S and S 1 must be BCD and must be in the proper hours min utes se...

Page 472: ...Operand Data Areas 000 No function 000 HMS S R 000 HMS S R 000 Limitations This instruction is available in the CPM2A CPM2C only S and S 1 must be within the same data area R and R 1 must be within the same data area S and S 1 must be BCD and must be between 0 and 35 999 999 seconds DM 6144 to DM 6655 cannot be used for R Description HMS is used to convert time notation in seconds to an equivalent...

Page 473: ...4 to DM 6655 cannot be used for R Converts the four digit hexadecimal content of the source word S to its 2 s complement and outputs the result to the result word R This operation is effec tively the same as subtracting S from 0000 and outputting the result to R it will calculate the absolute value of negative signed binary data If the content of S is 0000 the content of R will also be 0000 after ...

Page 474: ...e shows how to use NEG to find the 2 s complement of the content of DM 0005 and output the result to IR 105 00000 LD 00100 00001 NEG DM 0005 105 000 NEG DM 0005 105 000 00100 Address Instruction Operands 0000 001F FFE1 Output to IR 105 Content of DM 0005 Example ...

Page 475: ...er to Appendix B Error and Arithmetic Flag Operation for a table listing the instructions that affect CY 7 21 3 BCD ADD ADD 30 Au Augend word BCD IR SR AR DM HR TC LR Ad Addend word BCD IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas R Result word IR SR AR DM HR LR ADD 30 Au Ad R ADD 30 Au Ad R Limitations DM 6144 to DM 6655 cannot be used for R When the execution condition is OFF ADD 30 is...

Page 476: ...ht digit BCD addition ADDL 54 is designed specifically for this purpose 7 21 4 BCD SUBTRACT SUB 31 Mi Minuend word BCD IR SR AR DM HR TC LR Su Subtrahend word BCD IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas R Result word IR SR AR DM HR LR SUB 31 Mi Su R SUB 31 Mi Su R Limitations DM 6144 to DM 6655 cannot be used for R When the execution condition is OFF SUB 31 is not executed When the ...

Page 477: ...LC 41 is again required to obtain an accurate result the result is placed back in HR 10 and HR 1100 is turned ON to indicate a negative result If CY is not set by executing SUB 31 the result is positive the second subtrac tion is not performed and HR 1100 is not turned ON HR 1100 is programmed as a self maintaining bit so that a change in the status of CY will not turn it OFF when the program is r...

Page 478: ...the leftmost digit is truncated For negative results the 10s complement is obtained The procedure for establishing the correct answer is given below First Subtraction IR 201 1029 DM 0100 3452 CY 0 HR 10 7577 1029 10000 3452 CY 1 negative result Second Subtraction 0000 HR 10 7577 CY 0 HR 10 2423 0000 10000 7577 CY 1 negative result In the above case the program would turn ON HR 1100 to indicate tha...

Page 479: ...08 R HR 07 0 0 0 8 3 9 0 0 Md IR 013 3 3 5 6 Mr DM 0005 0 0 2 5 X Address Instruction Operands 00000 LD 00000 00001 MUL 32 013 DM 0005 HR 07 Flags ER Md and or Mr is not BCD Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded CY ON when there is a carry in the result EQ ON when the result is 0 7 21 6 BCD DIVIDE DIV 33 Dd Dividend wor...

Page 480: ...IR 00000 is ON with the following program the content of IR 216 is divided by the content of HR 09 and the result is placed in DM 0017 and DM 0018 Exam ple data and calculations are shown below the program DIV 33 216 HR 09 DM 0017 00000 R DM 0017 R 1 DM 0018 1 1 5 0 0 0 0 2 Dd IR 216 3 4 5 2 Quotient Remainder Dd HR 09 0 0 0 3 Address Instruction Operands 00000 LD 00000 00001 DIV 33 216 HR 09 DM 0...

Page 481: ...it numbers the first contained in LR 00 through LR 02 and the second in DM 0010 through DM 0012 The result is placed in HR 10 through HR 13 The rightmost 8 digits of the two numbers are added using ADDL 54 i e the contents of LR 00 and LR 01 are added to DM 0010 and DM 0011 and the results is placed in HR 10 and HR 11 The second addition adds the leftmost 4 digits of each number using ADD 30 and i...

Page 482: ...he 8 digit value in Mi and Mi 1 and places the result in R and R 1 If the result is negative CY is set and the 10 s complement of the actual result is placed in R To convert the 10 s complement to the true result subtract the content of R from zero Since an 8 digit constant cannot be directly entered use the BSET 71 instruction see 7 17 4 BLOCK SET BSET 71 to create an 8 digit constant Mi 1 Mi Su ...

Page 483: ...SUBL 55 HR 00 220 DM 0100 CLC 41 SUBL 55 DM 0000 DM 0100 DM 0100 TR 0 25504 HR 0100 00003 25504 HR 0100 First subtraction Second subtraction Turned ON to indicate negative result BSET 71 0000 DM 0000 DM 0001 00000 LD 00003 00001 OUT TR 0 00002 CLC 41 00003 SUBL 55 HR 00 220 DM 0100 00004 AND 25504 00005 BSET 71 0000 DM 0000 DM 0001 00006 CLC 41 00007 SUBL 55 DM 0000 DM 0100 DM 0100 00008 LD TR 0 0...

Page 484: ...tly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded CY ON when there is a carry in the result EQ ON when the result is 0 7 21 10 DOUBLE BCD DIVIDE DIVL 57 Dd First dividend word BCD IR SR AR DM HR TC LR Dr First divisor word BCD IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas R First result word IR SR AR DM HR LR DIVL 57 Dd Dr R DIVL...

Page 485: ...ondition is OFF ADB 50 is not executed When the execution condition is ON ADB 50 adds the contents of Au Ad and CY and places the result in R CY will be set if the result is greater than FFFF Au Ad CY CY R ADB 50 can also be used to add signed binary data With the CPM1A CPM2A CPM2C and SRM1 V2 the underflow and overflow flags SR 25404 and SR 25405 indicate whether the result has exceeded the lower...

Page 486: ...07 AND 25504 00008 MOV 21 00001 HR 11 In the case below A6E2 80C5 127A7 The result is a 5 digit number so CY SR 25504 1 and the content of R 1 becomes 0001 R 1 HR 11 R HR 10 0 0 0 1 2 7 A 7 Au IR 200 A 6 E 2 Ad DM 0100 8 0 C 5 Note For signed binary calculations the status of the UF and OF flags indicate wheth er the result has exceeded the signed binary data range 32 768 8000 to 32 767 7FFF 7 22 ...

Page 487: ...e result is below 32 768 8000 Example The following example shows a four digit subtraction When IR 00001 is ON the content of LR 00 and CY are subtracted from the content of IR 002 and the result is written to HR 01 CY is turned ON if the result is negative If normal data is being used a negative result signed binary must be converted to normal data using NEG Refer to 7 20 12 2 s COMPLEMENT NEG fo...

Page 488: ...four digits in R 1 Md Mr R 1 R X Flags ER Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded EQ ON when the result is 0 7 22 4 BINARY DIVIDE DVB 53 Dd Dividend word binary IR SR AR DM HR TC LR Dr Divisor word binary IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas R First result word IR SR AR DM HR LR DVB 53 Dd Dr R DVB 53 Dd ...

Page 489: ... ON and the lowest address containing the comparison data is identified in C 1 The ad dress is identified differently for the DM area 1 2 3 1 For an address in the DM area the word address is written to C 1 For ex ample if the lowest address containing the comparison data is DM 0114 then 0114 is written in C 1 2 For an address in another data area the number of addresses from the be ginning of the...

Page 490: ...rd IR SR AR DM HR LR MAX C R1 D Limitations This instruction is available in the CPM2A CPM2C only N must be BCD between 0001 to 9999 R1 and R1 N 1 must be in the same data area DM 6144 to DM 6655 cannot be used for D Description When the execution condition is OFF MAX is not executed When the execution condition is ON MAX searches the range of memory from R1 to R1 N 1 for the address that contains...

Page 491: ...t is ON the data is treated as signed binary 15 14 13 12 11 00 Not used set to zero Number of words in range N 001 to 999 BCD Not used set to zero Output address to D 1 1 ON Yes 0 OFF No C Caution If bit 14 of C is ON values above 8000 are treated as negative numbers so the results will differ depending on the specified data type Be sure that the correct data type is specified Flags ER Indirectly ...

Page 492: ...MUM MIN R1 First word in range IR SR AR DM HR TC LR C Control data IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas MIN C R1 D D Destination word IR SR AR DM HR LR MIN C R1 D Limitations This instruction is available in the CPM2A CPM2C only N must be BCD between 0001 to 9999 R1 and R1 N 1 must be in the same data area DM 6144 to DM 6655 cannot be used for D Description When the execution con...

Page 493: ... of C which must be BCD between 001 and 999 When bit 15 of C is OFF data within the range is treated as unsigned binary and when it is ON the data is treated as signed binary Number of words in range N 001 to 999 BCD Not used set to zero Output address to D 1 1 ON Yes 0 OFF No C 15 14 13 12 11 00 Not used set to zero Caution If bit 14 of C is ON values above 8000 are treated as negative numbers so...

Page 494: ... AR DM HR TC LR N Number of cycles IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas D First destination word IR SR AR DM HR LR AVG S N D Limitations This instruction is available in the CPM2A CPM2C only S must be hexadecimal N must be BCD from 0001 to 0064 D and D N 1 must be in the same data area DM 6144 to DM 6655 cannot be used for S N or D to D N 1 Description AVG is used to calculate th...

Page 495: ...BCD or the DM area boundary has been exceeded One or more operands have been set incorrectly D and D N 1 are not in the same data area Example In the following example the content of IR 200 is set to 0000 and then increm ented by 1 each cycle For the first two cycles AVG moves the content of IR 200 to DM 1002 and DM 1003 On the third and later cycles AVG calcu lates the average value of the conten...

Page 496: ... as binary or BCD and will be output in the same form Binary data can be either signed or unsigned The function of bits in C are shown in the following diagram and explained in more detail below Number of items in range N BCD Number of words or number of bytes 001 to 999 First byte when bit 13 is ON 1 ON Rightmost 0 OFF Leftmost Addition units 1 ON Bytes 0 OFF Words C Data type 1 ON Binary 0 OFF B...

Page 497: ...and 999 The data being summed in not BCD when BCD was designated EQ ON when the result is zero Example In the following example the BCD contents of the 8 words from DM 0000 to DM 0007 are added when IR 00001 is ON and the result is written to DM 0010 and DM 0011 SUM DM 0000 0008 00001 DM 0010 Address Instruction Operands 00000 LD 00001 00001 SUM 0008 DM 0000 DM 0010 DM 0000 0001 DM 0001 0002 DM 00...

Page 498: ...ANDW 34 I1 Input 1 IR SR AR DM HR TC LR I2 Input 2 IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas R Result word IR SR AR DM HR LR ANDW 34 I1 I2 R ANDW 34 I1 I2 R DM 6144 to DM 6655 cannot be used for R When the execution condition is OFF ANDW 34 is not executed When the execution condition is ON ANDW 34 logically AND s the contents of I1 and I2 bit by bit and places the result in R 1 0 0 1...

Page 499: ...1 and I2 bit by bit and places the result in R 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 15 00 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 15 00 15 00 I1 I2 R Flags ER Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded EQ ON when the result is 0 7 24 4 EXCLUSIVE OR XORW 36 I1 Input 1 IR SR AR DM HR TC LR I2 Input 2 IR SR A...

Page 500: ...R XNRW 37 I1 Input 1 IR SR AR DM HR TC LR I2 Input 2 IR SR AR DM HR TC LR Ladder Symbols Operand Data Areas R Result word IR SR AR DM HR LR XNRW 37 I1 I2 R XNRW 37 I1 I2 R DM 6144 to DM 6655 cannot be used for R When the execution condition is OFF XNRW 37 is not executed When the execution condition is ON XNRW 37 exclusively NOR s the contents of I1 and I2 bit by bit and places the result in R 1 0...

Page 501: ...ndary has been exceeded EQ ON when the incremented result is 0 7 25 2 BCD DECREMENT DEC 39 Wd Decrement word BCD IR SR AR DM HR LR Ladder Symbols Operand Data Areas DEC 39 Wd DEC 39 Wd DM 6144 to DM 6655 cannot be used for Wd When the execution condition is OFF DEC 39 is not executed When the execution condition is ON DEC 39 decrements Wd without affecting CY DEC 39 works the same way as INC 38 ex...

Page 502: ...NE ENTER SBS 91 N Subroutine number 000 to 049 Ladder Symbol Definer Data Areas SBS 91 N Limitations The subroutine number must be between 000 and 049 Description A subroutine can be executed by placing SBS 91 in the main program at the point where the subroutine is desired The subroutine number used in SBS 91 indicates the desired subroutine When SBS 91 is executed i e when the execution conditio...

Page 503: ...els of nesting SBN 92 010 SBN 92 011 SBN 92 012 SBS 91 011 RET 93 SBS 91 010 SBS 91 012 RET 93 RET 93 The following diagram illustrates program execution flow for various execution conditions for two SBS 91 SBS 91 000 SBS 91 001 SBN 92 000 RET 93 SBN 92 001 RET 93 END 01 Main program Subroutines A B C D E A A A A B B B B C C C C D D E E OFF execution conditions for subroutines 000 and 001 ON execu...

Page 504: ...ecution will return to the beginning when SBN 92 is encountered If either DIFU 13 or DIFU 14 is placed within a subroutine the operand bit will not be turned OFF until the next time the subroutine is executed i e the oper and bit may stay ON longer than one cycle Flags There are no flags directly affected by these instructions 7 26 3 MACRO MCRO 99 I1 First input word IR SR AR DM HR TC LR Ladder Sy...

Page 505: ...oes not exist for the specified subroutine number An operand has exceeded a data area boundary Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded A subroutine has called itself An active subroutine has been called 7 27 Pulse Output Instructions 7 27 1 SET PULSES PULS 65 P Port specifier 000 or 010 Ladder Symbols Operand Data Areas P...

Page 506: ...e absolute coordinate system is being used This setting is supported by CPM2A CPM2C PCs only Number of Output Pulses N 1 and N N 1 and N contain the 8 digit BCD number of output pulses setting for indepen dent mode pulse outputs The number of output pulses can be 16 777 215 to 16 777 215 Bit 15 of N 1 acts as a sign bit the number is negative if bit 15 is ON positive if it is OFF Positive 0 to 16 ...

Page 507: ... 000 or 001 SPED 64 P M F Limitations This instruction is supported by the CPM1A and CPM2A CPM2C PCs with transistor outputs only In the CPM1A F must be BCD 0000 or 0002 to 0200 In the CPM2A CPM2C F must be BCD 0000 or 0001 to 1000 DM 6144 to DM 6655 cannot be used for F Description SPED 64 is used to set the output pulse frequency and start the pulse output from the specified output bit When the ...

Page 508: ...s switched to PROGRAM mode Pulses can be output simultaneously and independently from two output bits When outputting pulses in independent mode specify the number of pulses be forehand by executing PULS 65 The number of output pulses must be speci fied again with PULS 65 each time that the pulse output has been stopped The frequency cannot be changed with SPED 64 when pulses are already be ing ou...

Page 509: ...fier 000 Ladder Symbols Operand Data Areas ACC P M C C First control word IR SR AR DM HR LR M Mode specifier 000 002 or 010 to 013 ACC P M C Limitations This instruction is available in the CPM2A CPM2C only P must be 001 or 002 and M must be 000 to 003 C to C 3 must be in the same data area Description ACC is used to specify the acceleration deceleration rate and start the pulse output for a pulse...

Page 510: ...requency is decreased by the amount set in C 2 every 10 ms C must be BCD from 0001 to 1000 10 Hz to 10 kHz Two output bits are required for pulse outputs controlled by ACC Up down pulse output mode IR 01000 CW operation IR 01001 CCW operation Pulse direction output mode IR 01000 Pulse output IR 01001 Direction specifier The pulse output will start when ACC is executed and the output frequency will...

Page 511: ...ways accurately output If the number of output pulses required for acceleration and deceleration the time to reach the target frequency the target frequency exceeds the preset number of pulses the acceleration and deceleration will be cut short and the pulse output will be triangular rather than trapezoidal Pulse frequency Time The number of output pulses is always accurately output If a high acce...

Page 512: ... have no effect if it is executed when pulses are being output by one of the following instructions The pulse output will continue unchanged Pulses being output from output 01000 by SPED 64 Pulses being output from output 01001 by SPED 64 Pulses being output from output 01000 by PWM Pulses being output from output 01001 by PWM Note Be sure to check the status of the pulse output before executing A...

Page 513: ...ed under these circumstances Note Refer to 2 5 Pulse Output Functions for more details Port Specifier P The port specifier indicates the output bit where the pulses will be output P Pulse output location s 000 Variable duty ratio pulse output 0 output 01000 010 Variable duty ratio pulse output 1 output 01001 Frequency F The 4 digit BCD value of F sets the pulse frequency in units of 0 1 Hz The fre...

Page 514: ...lse output location s 000 Synchronized pulse output 0 output 01000 010 Synchronized pulse output 1 output 01001 Scaling Factor C The 4 digit BCD value of C sets the scaling factor by which the input frequency is multiplied The scaling factor can be set between 0001 and 1000 1 to 1 000 The counter input mode for inputs 00000 and 00001 is set in bits 00 to 03 of DM 6642 DM 6642 bits 00 to 03 High sp...

Page 515: ... 005 or switching the PC to PROGRAM mode Flags ER A data area boundary is exceeded Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded P1 is not 000 P2 is not 000 or 010 or C is not BCD between 0001 and 1000 SYNC is executed when bits 08 to 15 of DM 6642 are not set for synchronized pulse control SYNC is executed in an interrupt subr...

Page 516: ... the message data changes while the message is being displayed the display will also change Flags ER Indirectly addressed DM word is non existent Content of DM word is not BCD or the DM area boundary has been exceeded The following example shows the display that would be produced for the instruc tion and data given when 00000 was ON If 00001 goes ON a message will be cleared MSG 46 DM 0010 FAL 06 ...

Page 517: ...nge IR 000 to IR 019 St is greater than E If St E IORF 97 will be treated as NOP 00 Flags There are no flags affected by this instruction 7 28 3 BIT COUNTER BCNT 67 N Number of words BCD IR SR AR DM HR TC LR SB Source beginning word IR SR AR DM HR TC LR Operand Data Areas R Destination word IR SR AR DM HR TC LR Ladder Symbols BCNT 67 N SB R BCNT 67 N SB R Note BCNT 67 is an expansion instruction i...

Page 518: ...function of bits in C are shown in the following diagram and explained in more detail below 15 14 13 12 11 00 Number of items in range N BCD 001 to 999 words or bytes First byte when bit 13 is ON 1 ON Rightmost 0 OFF Leftmost Calculation units 1 ON Bytes 0 OFF Words C Not used Set to zero Number of Items in Range The number of items within the range N is contained in the 3 rightmost digits of C wh...

Page 519: ...ction Operands 00000 LD 00000 00001 FCS 0008 DM 0000 DM 0010 DM 0000 0001 DM 0001 0002 DM 0002 0003 DM 0003 0004 DM 0004 0005 DM 0005 0006 DM 0006 0007 DM 0007 0008 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 8 0 0 FCS calculation 3 0 3 8 DM 0011 3 0 3 0 DM 0010 ASCII code conversion 7 29 Interrupt Control Instructions This section describes the operation of INT 89 and STIM 69 For general information on int...

Page 520: ...k 1 mask Interrupt input 00006 0 unmask 1 mask Word C2 bits 3 2 1 0 All of the interrupt inputs are masked at the start of PC operation so the inputs must be unmasked in order to be used This function is used to clear interrupt inputs 00003 to 00006 Since interrupt in puts are recorded masked interrupts will be serviced as soon as the mask is re moved unless they are cleared first Set the correspo...

Page 521: ...n an interrupt has already been enabled unmasked the SV cannot be re freshed just by writing a new value to the SV word Refresh the SV by executing INT 89 with C1 003 C1 004 for an incrementing counter A counter mode interrupt can be masked by executing INT 89 with C1 000 and the corresponding bit in C2 set to 1 but an input will operate in interrupt input mode not counter mode when its correspond...

Page 522: ...2 The function code 69 is the default setting and can be changed if desired C1 must be 000 003 006 or 010 If C1 is 000 or 003 C3 represents a BCD subroutine number up to 0049 If C1 is 006 constants cannot be used for C2 or C3 If C1 is 010 both C2 and C3 must be set to 000 Description STIM 69 is used to control the interval timers by performing four basic func tions starting the timer for a one sho...

Page 523: ...er has been decremented hexadecimal 0000 to 9999 and C2 1 receives the timing units BCD in 0 1 ms units C3 specifies the destination word that receives the time which has elapsed since the last time the timer was decremented BCD in 0 1 ms units Note The time that has elapsed since the timer was started is computed as follows Content of C2 Content of C2 1 Content of C3 0 1 ms Set C1 010 to stop the...

Page 524: ...ag is turned ON AR 0806 for the RS 232C port AR 0814 for the peripheral port Control Word The value of the control word determines the port from which data will be read and the order in which data will be written to memory Byte order 0 Most significant bytes first same word 1 Least significant bytes first same word Not used Set to 00 Port 0 RS 232C port 1 Peripheral port Digit number 3 2 1 0 The o...

Page 525: ...ea DM 6144 to DM 6655 cannot be used for S or N N must be BCD from 0000 to 0256 0000 to 0061 in Host Link mode Description When the execution condition is OFF TXD 48 is not executed When the execution condition is ON TXD 48 reads N bytes of data from words S to S N 2 1 converts it to ASCII and outputs the data from the specified port TXD 48 operates differently in Host Link mode and RS 232C mode s...

Page 526: ...en to memory Control Word The value of the control word determines the port from which data will be read and the order in which data will be written to memory Byte order 0 Most significant bytes first 1 Least significant bytes first Not used Set to 00 Port 0 Specifies RS 232C port 1 Specifies peripheral port Digit number 3 2 1 0 The specified number of bytes will be read from S through S N 2 1 and...

Page 527: ...cution condition is ON STUP changes the PC Setup settings for the built in RS 232C port The settings are changed in the PC Setup but they are not written to flash memory until the PC is switched to PROGRAM mode from RUN or MONITOR mode or the PC is turned OFF and then ON again In CPM2A CPM2C and SRM1 V2 PCs N must be 000 because STUP can change the RS 232C Setup for the built in RS 232C port DM 66...

Page 528: ...ications settings in DM 0101 and sets the communications mode to no protocol DM 0101 DM 6646 0803 Sets the following communications settings 9 600 bps 1 start bit 8 bit data 1 stop bit no parity DM 0102 DM 6647 0000 No transmission delay 0 ms DM 0103 DM 6648 2000 Enables the end code CR LF DM 0104 DM 6649 0000 No function when DM 6648 is set to 2000 Flags ER Indirectly addressed DM word is non exi...

Page 529: ... to one PC Link I O Response Time 515 8 1 5 Interrupt Processing Time 517 8 1 6 CPM1 CPM1A Instruction Execution Times 518 8 2 CPM2A CPM2C Cycle Time and I O Response Time 523 8 2 1 CPM2A CPM2C Cycle Time 523 8 2 2 I O Response Time 524 8 2 3 One to one PC Link I O Response Time 525 8 2 4 Interrupt Processing Time 527 8 2 5 CPM2A CPM2C Instruction Execution Times 528 8 3 SRM1 V2 Cycle Time and I O...

Page 530: ...gram Check cycle time setting Minimum cycle time set Wait until minimum cycle time expires Compute cycle time Refresh input bits and output terminals Service peripheral port Set error flags and activate indicators ERROR or ALARM No ERROR lit ALARM flashing Initialization Overseeing processes Program execution Cycle time processing I O refreshing Service peripheral port Cycle time No Yes No Yes Yes...

Page 531: ...ects of the cycle time on CPM1 CPM1A operations are as shown below When a long cycle time is affecting operation either reduce the cycle time or im prove responsiveness with interrupt programs Cycle time Operation conditions 10 ms or longer TIMH 15 may be inaccurate when TC 004 through TC 127 are used operation will be normal for TC 000 through TC 003 20 ms or longer Programming using the 0 02 sec...

Page 532: ...response time is the time it takes after an input signal has been received i e after an input bit has turned ON for the PC to check and process the in formation and to output a control signal i e to output the result of the proces sing to an output bit The I O response time varies according to the timing and processing conditions The minimum and maximum I O response times are shown here using the ...

Page 533: ...CPM1 CPM1A by means of 1 1 PC Link communications The minimum and maximum I O response times are shown here using as an example the following instructions executed at the master and the slave In this example communications proceed from the master to the slave Input Output LR Input LR Output Master Slave The following conditions are taken as examples for calculating the I O response times In CPM1 C...

Page 534: ...A receives an input signal just after the input refresh phase of the cycle 2 The Master s communications servicing just misses the Master to Slave transmission 3 The transmission is completed just after the Slave s communications servic ing ends I O Maximum Response Time Input ON response time Master s cycle time x 2 Transmission time x 3 Out put ON response time Output point I O refresh Periphera...

Page 535: ...detail See below Change to interrupt processing This is the time it takes to change processing to an interrupt 30 µs Return This is the time it takes from execution of RET 93 to return to the proces sing that was interrupted 30 µs Mask Processing Interrupts are masked during processing of the operations described below Un til the processing is completed any interrupts will remain masked for the in...

Page 536: ...0 72 OUT OUT NOT 4 0 SET 5 8 RSET 5 9 TIM 10 0 Constant for SV 16 2 16 0 6 4 DM for SV 31 4 31 6 4 CNT 12 5 Constant for SV 14 1 6 2 6 6 DM for SV 29 1 6 2 6 6 Special Instructions Code Mnemonic ON execution time µs Conditions Top min bottom max OFF execution time µs 00 NOP 0 36 Any 01 END 10 8 y 02 IL 4 6 2 6 03 ILC 3 6 3 6 04 JMP 4 3 2 4 05 JME 4 7 4 7 06 FAL 38 5 5 5 07 FALS 5 0 5 4 08 STEP 14 ...

Page 537: ...r 45 5 When transferring DM to DM 22 MVN 16 4 When transferring a constant to a word 5 6 17 5 When transferring from one word to another 45 7 When transferring DM to DM 23 BIN 31 6 When converting a word to a word 5 6 45 7 When converting DM to DM 24 BCD 29 5 When converting a word to a word 5 6 57 3 When converting DM to DM 25 ASL 17 3 When shifting a word 5 5 31 3 When shifting DM 26 ASR 16 9 Wh...

Page 538: ...d word 5 6 32 1 Word word word 73 9 DM DM DM 51 SBB 30 9 Constant word word 5 6 32 7 Word word word 74 5 DM DM DM 52 MLB 34 7 Constant word word 5 6 36 3 Word word word 80 7 DM DM DM 53 DVB 35 1 Word constant word 5 6 36 7 Word word word 81 1 DM DM DM 54 ADDL 48 9 Word word word 5 6 94 7 DM DM DM 55 SUBL 48 9 Word word word 5 6 94 7 DM DM DM 56 MULL 138 7 Word word word 5 6 184 3 DM DM DM 57 DIVL ...

Page 539: ...6 656 words via DM 68 BCMP 79 6 Comparing constant results to word 5 6 80 8 Comparing word results to word 123 2 Comparing DM results to DM 69 STIM 47 5 Word set one shot interrupt start 5 6 58 7 DM set one shot interrupt start 47 9 Word set scheduled interrupt start 59 1 DM set scheduled interrupt start 33 5 Word set timer read 63 5 DM set timer read 25 7 Word set timer stop 54 1 DM set timer sto...

Page 540: ...to LIFO stack 112 0 When setting a DM DM to LIFO stack via DM 82 MOVB 32 5 When transferring a constant to a word 5 6 37 5 When transferring from one word to another 79 1 When transferring DM to DM 83 MOVD 28 3 When transferring a constant to a word 5 6 33 3 When transferring from one word to another 75 5 When transferring DM to DM 84 SFTR 39 3 Shifting 1 word 5 6 52 9 Shifting 10 word 1 42 ms Shi...

Page 541: ...CPM2A CPU Unit 0 3 ms 60 point CPM2A CPU Unit 0 54 ms Expansion I O Unit 0 3 ms RS 232C port servicing Communications processing when a Programming Device or Communications Adapter is connected to the RS 232C port 0 55 ms min 5 or less of cycle time up to 131 ms The percentage of cycle time allocated to RS 232C servicing can be set in DM 6616 Peripheral port servicing Devices connected to peripher...

Page 542: ...5 Peripheral port servicing Minimum time 0 55 ms 0 ms Cycle time 1 2 3 4 5 1 75 ms CPM2C 1 51 ms 1 2 ms CPM2C 0 96 ms Note 1 The cycle time can be read from the PC via a Programming Device 2 The maximum and current cycle time are stored in AR 14 and AR 15 3 The cycle time can vary with actual operating conditions and will not neces sarily agree precisely with the calculated value 8 2 2 I O Respons...

Page 543: ...delay 10 ms I O refreshing Program execution and other processes 15 ms I O refreshing 8 2 3 One to one PC Link I O Response Time When two CPM2A CPM2Cs are linked 1 1 the I O response time is the time re quired for an input executed at one of the CPM2A CPM2Cs to be output to the other CPM2A CPM2C by means of 1 1 PC Link communications The minimum and maximum I O response times are shown here using ...

Page 544: ...ollowing circum stances 1 2 3 1 The CPM2A CPM2C receives an input signal just after the input refresh phase of the cycle 2 The Master s communications servicing just misses the Master to Slave transmission 3 The transmission is completed just after the Slave s communications servic ing ends I O Maximum Response Time Input ON response time Master s cycle time 2 Transmission time 3 Slave s cycle tim...

Page 545: ...ime it takes to change processing to the interrupt process 30 µs Return This is the time it takes from execution of RET 93 to return to the processing that was interrupted 30 µs Mask Processing Interrupts are masked during processing of the operations described below Un til the processing is completed any interrupts will remain masked for the indi cated times Generation and clearing of non fatal e...

Page 546: ...0 52 AND LD OR LD 0 26 OUT OUT NOT 1 88 SET 2 58 RSET TIM 4 76 Constant for SV 7 8 7 6 2 9 DM for SV 15 6 15 4 2 9 CNT 4 50 Constant for SV 6 8 2 9 3 1 DM for SV 14 5 2 9 3 1 Special Instructions Code Mnemonic ON execution time µs Conditions Top min bottom max OFF execution time µs 00 NOP 0 15 Any 01 END 6 2 y 02 IL 1 1 2 1 03 ILC 1 6 1 6 04 JMP 0 95 1 8 05 JME 2 1 2 1 06 FAL 20 5 2 5 07 FALS 2 9 ...

Page 547: ...nother 22 8 When transferring DM to DM 22 MVN 7 9 When transferring a constant to a word 2 6 8 4 When transferring from one word to another 22 8 When transferring DM to DM 23 BIN 15 8 When converting a word to a word 2 6 30 3 When converting DM to DM 24 BCD 14 6 When converting a word to a word 2 6 29 0 When converting DM to DM 25 ASL 8 6 When shifting a word 2 5 15 8 When shifting DM 26 ASR 8 4 W...

Page 548: ... input 48 TXD 32 4 Word specification 1 byte input RS 232C 2 6 264 5 DM specification 256 bytes input RS 232C 27 7 Word specification 1 byte input Host Link 42 2 DM specification 256 bytes input Host Link 50 ADB 14 1 Constant constant word 2 6 15 6 Word word word 37 4 DM DM DM 51 SBB 14 4 Constant constant word 2 6 15 9 Word word word 37 7 DM DM DM 52 MLB 16 8 Constant constant word 2 6 18 5 Word ...

Page 549: ...speed counter 20 0 Specifying a constant when changing interrupt counter PV 27 6 Specifying DM when changing interrupt counter PV 62 PRV 36 9 Reading high speed counter PV via word 2 6 44 7 Reading high speed counter PV DM 36 6 Specifying increment mode via word 44 3 Specifying increment mode via D 38 5 Specifying a word when using synchronized control 46 2 Specifying DM when using synchronized co...

Page 550: ...a word 399 7 Registering a range comparison table and start ing comparison in incrementing mode via DM 183 4 Only registering a target value comparison table in incrementing decrementing pulse input mode via word 810 3 Only registering a target value comparison table in incrementing decrementing pulse input mode via DM 182 4 Only registering a target value comparison table in incrementing mode via...

Page 551: ...t scheduled interrupt start 47 8 DM set scheduled interrupt start 34 0 Constant set timer read 46 4 DM set timer read 10 6 Stopping timer 70 XFER 21 3 When transferring a constant to a word 2 6 23 8 When transferring a word to a word 1 52 ms When transferring 2 048 words using DM 71 BSET 13 8 When setting a constant to a word 2 6 14 3 When setting a word to a word 971 1 When setting DM to 2 048 wo...

Page 552: ...word 2 6 16 2 When transferring from one word to another 38 1 When transferring DM to DM 84 SFTR 22 8 Shifting 1 word 2 6 24 3 Shifting 10 words 1 15 ms Shifting 2 048 words using DM 85 TCMP 27 5 Comparing constant to word set table 2 6 28 0 Comparing word to word set table 48 3 Comparing DM to DM set table 86 ASC 19 1 Word word 2 6 52 2 DM DM 89 INT 22 1 Set masks via word 2 6 30 1 Set masks via ...

Page 553: ... designation in CCW continuous mode and CW CCW mode 65 0 When executing the word designation in CW continuous mode and Feed Dir mode 74 5 When executing the DM designation in CW continuous mode and Feed Dir mode 45 4 When changing the word designation in CW continuous mode and Feed Dir mode 53 5 When changing the DM designation in CW continuous mode and Feed Dir mode 65 4 When executing the word d...

Page 554: ... 34 1 Constant specification executed second scan or later 3 44 ms DM specification executed first scan 39 8 DM specification executed second scan or later SUM 22 8 Word added and output to word 2 6 1 44 ms DM specification 999 bytes added and output to DM SYNC 34 6 Constant ratio specification when executed 2 6 35 3 Word ratio specification when executed 42 5 DM ratio specification when executed ...

Page 555: ...esses Program execution Cycle time processing RS 232C servicing Peripheral port ser vicing Cycle time Output re freshing CompoBus S end wait Input refreshing Note 1 The cycle time can be read using Programming Devices 2 Cycle time maximum and current cycle time are stored in AR 14 and AR 15 3 Change to processing will cause cycle times to change therefore the calcu lated values and actual values f...

Page 556: ...s are started 0 05 ms RS 232C port servicing Devices connected to RS 232C port serviced 5 or less of cycle time but always between 0 55 and 131 ms Set in DM 6616 Peripheral port servicing Devices connected to peripheral port serviced 5 or less of cycle time but always between 0 55 and 131 ms Set in DM 6617 Minimum Cycle Time In SRM1 V2 PCs CompoBus S communications are started after the output ref...

Page 557: ... User s program 500 instructions consists of only LD and OUT Cycle time Variable no minimum set RS 232C port Not used Max nodes 32 nodes and high speed communications mode CompoBus S communication response time 0 8 ms Peripheral 0 7 ms The average processing time for a single instruction in the user s program is as sumed to be 1 16 µs The cycle times are as shown in the following table Process Cal...

Page 558: ...the output refresh Accordingly the SRM1 V2 I O response time varies according to the cycle time and CompoBus S communications cycle status or I O timing Example calculations of the I O response time are provided next Minimum I O Response Time Minimum I O response time Input ON delay Output ON delay CompoBus S communications cycle time SRM1 V2 cycle time SRM1 V2 cycle Communications response time I...

Page 559: ...servicing occurs just as the Master to Slave transmission begins 3 The Slave s communications servicing occurs just after the transmission is completed Output point Master s cycle time 10 ms Program execution Transmission time 39 ms Slave s cycle time 15 ms Min I O response time 8 10 39 15 10 82 ms Input point Input bit I O refresh Overseeing communica tions etc Input ON delay 8 ms Master to Slave...

Page 560: ... only 5 Return to initial location The table below shows the times involved from the generation of an interrupt sig nal until the interrupt processing routine is called and from when the interrupt processing routine is completed until returning to the original position Item Contents Time Wait for completion of interrupt mask processing This is the time during which interrupts are waiting until pro...

Page 561: ...NOT 0 78 Any AND LD OR LD 0 39 Any OUT OUT NOT 2 2 SET 2 7 RSET 2 8 TIM 5 7 Constant for SV 9 3 9 1 3 5 DM for SV 17 4 17 2 3 5 CNT 6 6 Constant for SV 8 0 3 6 3 8 DM for SV 16 3 3 6 3 8 Special Instructions and Expansion Instructions Code Mnemonic ON execution time µs Conditions Top min bottom max OFF execution time µs 00 NOP 0 20 Any 01 END 4 8 y 02 IL 2 5 1 4 03 ILC 1 9 1 9 04 JMP 2 2 1 3 05 JM...

Page 562: ...a constant to a word 3 0 9 5 When transferring from one word to another 24 9 When transferring DM to DM 22 MVN 9 3 When transferring a constant to a word 3 0 9 8 When transferring from one word to another 25 1 When transferring DM to DM 23 BIN 17 2 When converting a word to a word 3 0 32 0 When converting DM to DM 24 BCD 15 8 When converting a word to a word 3 0 30 6 When converting DM to DM 25 AS...

Page 563: ...age in words 2 9 19 4 With message in DM 47 RXD 39 1 Word specification 1 byte input 2 9 116 8 DM specification 256 bytes input 48 TXD 31 3 Word specification 1 byte input RS 232C 2 9 266 5 DM specification 256 bytes input RS 232C 26 7 Word specification 1 byte input Host Link 34 0 DM specification 256 bytes input Host Link 50 ADB 16 8 Constant word word 3 0 17 6 Word word word 39 9 DM DM DM 51 SB...

Page 564: ... a constant to a word 3 0 24 0 When transferring a word to a word 902 0 When transferring 1 024 words using DM 71 BSET 15 2 When setting a constant to 1 word 3 0 15 7 When setting word constant to 10 words 565 2 When setting DM to 1 024 words 73 XCHG 16 2 Word word 3 1 31 5 DM DM 74 SLD 13 6 Shifting 1 word 3 0 26 7 Shifting 10 word 1 54 ms Shifting 1024 words using DM 75 SRD 13 6 Shifting 1 word ...

Page 565: ...to DM 84 SFTR 21 0 Shifting 1 word 3 0 26 9 Shifting 10 word 718 5 Shifting 1 024 words using DM 85 TCMP 30 0 Comparing constant to word set table 3 0 30 7 Comparing word to word set table 53 1 Comparing DM to DM set table 86 ASC 30 0 Word word 3 0 53 7 DM DM 91 SBS 13 2 Any 3 0 92 SBN y 1 3 93 RET 7 8 1 3 99 MCRO 26 8 With word set I O operands 3 0 43 5 With DM set I O operands Note Those instruc...

Page 566: ...ime and I O Response Time 548 Code OFF execution time µs Conditions Top min bottom max ON execution time µs Mnemonic ZCP 45 0 Comparing a word to a constant range 3 0 46 5 Comparing a word to a word range 69 0 Comparing DM to DM ...

Page 567: ... occur during PC operation 9 1 Introduction 550 9 2 Programming Console Operation Errors 550 9 3 Programming Errors 551 9 4 User defined Errors 552 9 5 Operating Errors 553 9 5 1 Non fatal Errors 553 9 5 2 Fatal Errors 554 9 5 3 Other Errors 554 9 6 Error Log 555 9 7 Host Link Errors 557 9 8 Troubleshooting Flowcharts 557 ...

Page 568: ...vided starting on page 555 There are flags and other information provided in the SR and AR areas that can be used in troubleshooting Refer to Section 3 Memory Areas for lists of these Note In addition to the errors described above communications errors can occur when the PC is part of a Host Link System Refer to page 557 for details 9 2 Programming Console Operation Errors The following error mess...

Page 569: ...am Check instruction requirements and correct the program JME UNDEFD A JME 05 instruction is missing for a JMP 04 instruction Correct the jump number or insert the proper JME 05 instruction DUPL The same jump number or subroutine number has been used twice Correct the program so that the same number is only used once for each SBN UNDEFD The SBS 91 instruction has been programmed for a subroutine n...

Page 570: ...on is ON Refer to page 497 for details FAL 06 is an instruction that causes a non fatal error Refer to page 385 for de tails The following will occur when an FAL 06 instruction is executed 1 2 3 1 The ERR ALM indicator on the CPU Unit will flash PC operation will contin ue 2 The instruction s 2 digit BCD FAL number 01 to 99 will be written to SR 25300 to SR 25307 3 The FAL number will be recorded ...

Page 571: ...been executed in the program Check the FAL number to determine conditions that would cause execution correct the cause and clear the error 9B An error has been detected in the PC Setup Check flags AR 1300 to AR 1302 and correct as directed AR 1300 ON An incorrect setting was detected in the PC Setup DM 6600 to DM 6614 when power was turned on Correct the settings in PROGRAM Mode and turn on the po...

Page 572: ...rred in CompoBus S communications If the error cannot be corrected replace the CPU Unit SRM1 V2 only NO END INST F0 END 01 is not written in the program Write END 01 at the end of the program I O BUS ERR See note 1 C0 An error has occurred during data transfer between the CPU Unit and an Expansion Unit or Expansion I O Unit Check the Unit s connecting cable I O UNIT OVER See note 1 E1 Too many Exp...

Page 573: ... a new record is generated Error log record 6 Error log record 7 Error log record 1 Error log record 2 Lost New record added All records shifted 2 You can store only the first 10 error log records and ignore any subsequent errors beyond those 10 3 You can disable the log so that no records are stored The default setting is the first method Refer to Error Log Settings on page 21 for details on the ...

Page 574: ...214 from a Programming Device Af ter the error log has been cleared SR 25214 will turn OFF again automatically In SRM1 V2 PCs the error log is stored in DM 2000 through DM 2021 DM2000 Error log pointer DM2001 Error log record 1 DM2002 DM2003 DM2019 Error log record 7 DM2020 DM2021 to Error classification Error code 00 00 00 00 Leading word Leading word 1 Leading word 2 Indicates the number of reco...

Page 575: ...description of the response format and the response codes that are returned when a command from a host computer cannot be processed 9 8 Troubleshooting Flowcharts The troubleshooting flowcharts are available in the Operation Manuals Refer to 5 6 Troubleshooting Flowcharts in the CPM1 Operation Manual Refer to 5 6 Troubleshooting Flowcharts in the CPM1A Operation Manual Refer to 5 5 Troubleshooting...

Page 576: ... operand bit ON when the execution condition is ON and does not affect the status of the operand bit when the execution condition is OFF 378 TIM TIMER ON delay decrementing timer operation 389 00 NOP NO OPERATION Nothing is executed and program moves to next instruction 381 01 END END Required at the end of the program 381 02 IL INTERLOCK If interlock condition is OFF all outputs are turned OFF an...

Page 577: ...word 458 32 MUL BCD MULTIPLY Multiplies two four digit BCD values and outputs result to specified result words 460 33 DIV BCD DIVIDE Divides four digit BCD dividend by four digit BCD divisor and outputs result to specified result words 461 34 ANDW LOGICAL AND Logically ANDs two 16 bit input words and sets correspond ing bit in result word if corresponding bits in input words are both ON 480 35 ORW...

Page 578: ...ts up to four hexadecimal digits in source word into decimal values from 0 to 15 and turns ON in result word s bit s whose position corresponds to converted value 442 77 DMPX 16 TO 4 ENCODER Determines position of highest ON bit in source word s and turns ON corresponding bit s in result word 444 78 SDEC 7 SEGMENT DECODER Converts hexadecimal values from source word to data for seven segment displ...

Page 579: ...g conversion on the calculated value Use the Programming Console or SSS to ac cess this instruction for the SRM1 V2 All But Ver sion 2 only for SRM1 421 67 BCNT BIT COUNTER Counts the total number of bits that are ON in the specified block of words All 499 68 BCMP BLOCK COMPARE Judges whether the value of a word is within 16 ranges defined by lower and upper limits All 434 69 STIM INTERVAL TIMER C...

Page 580: ...at contain the data CPM2A CPM2C 471 STUP CHANGE RS 232C SETUP Changes the communications parameters in the PC Setup for a specified port All 509 SUM SUM CALCULATE Computes the sum of the contents of the words in the specified range of memory CPM2A CPM2C 478 SYNC SYNCHRONIZED PULSE CONTROL Multiplies an input pulse frequency by a fixed scaling factor and outputs pulses from the speci fied output bi...

Page 581: ... of the ER CY GT LT and EQ Flags is affected by instruction execution and will change each time an instruction that affects them is executed Differentiated instructions are executed only once when their execution condition changes ON to OFF or OFF to ON and are not executed again until the next specified change in their execution condition The status of the ER CY GT LT and EQ Flags is thus affecte...

Page 582: ...affected Unaffected 470 DVB 53 Unaffected Unaffected Unaffected 470 ADDL 54 Unaffected 463 SUBL 55 464 MULL 56 Unaffected Unaffected Unaffected Unaffected 466 DIVL 57 466 BINL 58 OFF 440 BCDL 59 Unaffected 441 XFER 70 Unaffected Unaffected Unaffected Unaffected Unaffected 413 BSET 71 414 XCHG 73 Unaffected Unaffected Unaffected Unaffected Unaffected 415 SLD 74 408 SRD 75 408 MLPX 76 442 DMPX 77 44...

Page 583: ...S 65 487 SCL 66 Unaffected 421 BCNT 67 499 BCMP 68 Unaffected 434 STIM 69 504 INT 89 501 SRCH 471 MAX 472 MIN 474 HMS Unaffected 454 NEG 455 SEC 453 SUM 478 FCS Unaffected Unaffected 500 HEX Unaffected 451 AVG 476 PID 426 ZCP Unaffected 437 Note Depending on the results NEG may also affect the status of the underflow flag SR 25405 Expansion Instructions CPM2A CPM2C Only Instructions 25503 ER 25504...

Page 584: ... Error log2 DM 1000 to DM 1021 22 words Used to store the error code of errors that occur These words can be used as ordi nary read write DM when the error log func tion isn t being used Read only4 DM 6144 to DM 6599 456 words Cannot be overwritten from program PC Setup4 DM 6600 to DM 6655 56 words Used to store various parameters that con trol PC operation Note 1 IR and LR bits that are not used ...

Page 585: ...ot used in counter mode SR 243 00 to 15 Input Interrupt 3 Counter Mode SV SV when input interrupt 3 is used in counter mode 4 digits hexadecimal Can be used as work bits when input interrupt 3 is not used in counter mode SR 244 00 to 15 Input Interrupt 0 Counter Mode PV Minus One Counter PV 1 when input interrupt 0 is used in counter mode 4 digits hexa decimal Read only 82 SR 245 00 to 15 Input In...

Page 586: ...when starting or stopping operation The status of this bit can be maintained when PC power turns off by using the PC Setup 17 13 Not used 14 Error Log Reset Bit Turn ON to clear error log Automatically turns OFF again when operation is complete Read write 555 15 Not used SR 253 00 to 07 FAL Error Code The error code a 2 digit number is stored here when an error occurs The FAL number is stored here...

Page 587: ...For details regarding the backup time refer to the CPM1A or CPM1 Operation Manual Refer to 1 1 2 CPM1 CPM1A PC Setup Settings for details on the PC Setup AR Area These bits mainly serve as flags related to CPM1 CPM1A operation These bits retain their status even after the CPM1 CPM1A power supply has been turned off or when operation begins or stops Word s Bit s Function Page AR 00 AR 01 00 to 15 N...

Page 588: ...rns ON when a non existent data area address is specified in the program 09 Flash Memory Error Flag Turns ON when there is an error in flash memory 10 Read only DM Error Flag See note 3 Turns ON when a checksum error occurs in the read only DM DM 6144 to DM 6599 and that area is initialized 554 11 PC Setup Error Flag Turns ON when a checksum error occurs in the PC Setup area 12 Program Error Flag ...

Page 589: ...Data area Words Bits Function IR area1 Input area IR 000 to IR 009 10 words IR 00000 to IR 00915 160 bits These bits can be allocated to the external I O terminals Output area IR 010 to IR 019 10 words IR 01000 to IR 01915 160 bits O e a s Work area IR 020 to IR 049 IR 200 to IR 227 58 words IR 02000 to IR 04915 IR 20000 to IR 22715 928 bits Work bits can be freely used within the pro gram SR area...

Page 590: ...icated when SR 22915 is ON The same PV data can be read immediately with PRV 62 Only Pulse Output PV 0 is used for ACC Read only 106 SR 230 SR 231 00 to 15 Pulse Output PV 1 Contains the pulse output PV 16 777 215 to 16 777 215 SR 23115 acts as the sign bit a negative number is indicated when SR 23115 is ON The same PV data can be read immediately with PRV 62 SR 232 to SR 235 00 to 15 Macro Functi...

Page 591: ...Pulse Output 0 PV Reset Bit Turn ON to clear the PV of pulse output 0 Read write 97 05 Pulse Output 1 PV Reset Bit Turn ON to clear the PV of pulse output 1 e 06 07 Not used 08 Peripheral Port Reset Bit Turn ON to reset the peripheral port Automatically turns OFF when reset is complete Read write 09 RS 232C Port Reset Bit Turn ON to reset the RS 232C port Automatically turns OFF when reset is comp...

Page 592: ...Underflow UF Flag Turns ON when an underflow occurs in a signed binary calculation o y 06 Differential Monitor Complete Flag Turns ON when differential monitoring is completed 159 07 STEP 08 Execution Flag Turns ON for 1 cycle only at the start of process based on STEP 08 385 08 to 15 Not used SR 255 00 0 1 second clock pulse 0 05 second ON 0 05 second OFF Read l 01 0 2 second clock pulse 0 1 seco...

Page 593: ...he CPU Unit is OFF 13 to 15 Not used AR 08 00 to 03 RS 232C Port Error Code 0 Normal completion 1 Parity error 2 Frame error 3 Overrun error 250 258 04 RS 232C Communications Error Flag Turns ON when an RS 232C port communications error occurs 05 RS 232C Transmit Ready Flag Turns ON when the PC is ready to transmit data No protocol and Host Link only 06 RS 232C Reception Completed Flag Turns ON wh...

Page 594: ... 11 Pulse Output 0 Output Status ON Pulse output 0 is accelerating or decelerating OFF Pulse output 0 is operating at a constant rate 104 12 Pulse Output 0 Overflow Underflow Flag ON An overflow or underflow occurred OFF Normal operation 13 Pulse Output 0 Pulse Quantity Set Flag ON Pulse quantity has been set OFF Pulse quantity has not been set 14 Pulse Output 0 Pulse Output Completed Flag ON Comp...

Page 595: ...ion instruction assignments will be cleared to their default settings 14 Data Save Error Flag Turns ON if data could not be retained with the backup battery The following words are normally backed up by the battery DM read write words DM 0000 to DM 1999 and DM 2022 to DM 2047 Error Log DM 2000 to DM 2021 HR area counter area SR 25511 SR 25512 if DM 6601 is set to hold I O memory at startup AR 23 o...

Page 596: ...618 A setting of 00 specifies 0 1 ms units 01 specifies 0 1 ms units 02 specifies 1 ms units and 03 specifies 10 ms units SRM1 Memory Areas Memory Area Structure The following memory areas can be used with the SRM1 Data area Words Bits Function IR area1 Input area IR 000 to IR 007 8 words IR 00000 to IR 00715 128 bits These bits can be allocated to the external I O terminals The ON OFF status of t...

Page 597: ...or code of errors that occur Refer to 7 5 Coding Right hand Instructions Read only4 DM 6144 to DM 6599 456 words Cannot be overwritten from program PC Setup4 DM 6600 to DM 6655 56 words Used to store various parameters that con trol PC operation Note 1 IR and LR bits that are not used for their allocated functions can be used as work bits 2 The contents of the HR area LR area Counter area and read...

Page 598: ...7 13 Not used 14 Error Log Reset Bit Turn ON to clear error log Automatically turns OFF again when operation is complete Read write 555 15 Not used SR 253 00 to 07 FAL Error Code The error code a 2 digit number is stored here when an error occurs The FAL number is stored here when FAL 06 or FALS 07 is executed This word is reset to 00 by executing a FAL 00 instruction or by clearing the error from...

Page 599: ...ned off or when operation begins or stops Word s Bit s Function Page AR 00 AR 01 00 to 15 Not used AR 02 00 to 07 Not used 08 to 11 Not used system use 12 to 15 Not used AR 03 00 to 15 Not used AR 04 to AR 07 00 to 15 Slave Status Flag AR 08 00 to 03 RS 232C Error Code 1 digit number 0 Normal completion 1 Parity error 2 Framing error 3 Overrun error 04 RS 232C Communications Error 05 RS 232C Trans...

Page 600: ...DM Error Flag Turns ON when a checksum error occurs in the read only DM DM 6144 to DM 6599 and that area is initialized 554 11 PC Setup Error Flag Turns ON when a checksum error occurs in the PC Setup area 12 Program Error Flag Turns ON when a checksum error occurs in the program memory UM area or when an improper instruction is executed 13 Not used Cleared when power is turned on AR 13 14 Data Sa...

Page 601: ...el Sheet No y y y IR_____ Unit No Model IR_____ Unit No Model 00 00 01 01 02 02 03 03 04 04 05 05 06 06 07 07 08 08 09 09 10 10 11 11 12 12 13 13 14 14 15 15 IR_____ Unit No Model IR_____ Unit No Model 00 00 01 01 02 02 03 03 04 04 05 05 06 06 07 07 08 08 09 09 10 10 11 11 12 12 13 13 14 14 15 15 ...

Page 602: ...f system Produced by Verified by Authorized by PC Chart No y y y Address Instruction Function code Operands 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 ...

Page 603: ...am Coding Sheet 590 Address Operands Function code Instruction 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 5 0 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 6 0 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 7 0 7 1 7 2 ...

Page 604: ...Appendix E Program Coding Sheet 591 Address Operands Function code Instruction 7 3 7 4 7 5 7 6 7 7 7 8 7 9 8 0 8 1 8 2 8 3 8 4 8 5 8 6 8 7 8 8 8 9 9 0 9 1 9 2 9 3 9 4 9 5 9 6 9 7 9 8 9 9 ...

Page 605: ...art No y y y FAL No FAL contents Corrective measure FAL No FAL contents Corrective measure 00 35 01 36 02 37 03 38 04 39 05 40 06 41 07 42 08 43 09 44 10 45 11 46 12 47 13 48 14 49 15 50 16 51 17 52 18 53 19 54 20 55 21 56 22 57 23 58 24 59 25 60 26 61 27 62 28 63 29 64 30 65 31 66 32 67 33 68 34 69 ...

Page 606: ...Appendix F List of FAL Numbers 594 FAL No Corrective measure FAL contents FAL No Corrective measure FAL contents 70 85 71 86 72 87 73 88 74 89 75 90 76 91 77 92 78 93 79 94 80 95 81 96 82 96 83 97 84 99 ...

Page 607: ... for details Right di i Left digit g digit 0 1 8 9 2 3 4 5 6 7 A B C D E F 0 0 P p Ć P p 1 1 A Q a q 1 A Q a q 2 2 B R b r 2 B R b r 3 3 C S c s 3 C S c s 4 4 D T d t 4 D T d t 5 5 E U e u 5 E U e u 6 6 F V f v 6 F V f v 7 7 G W g w 7 G W g w 8 8 H X h x 8 H X h x 9 9 I Y i y 9 I Y i y A J Z j z J Z j z B K k K k C L l L l D Ć M m Ć M m E N n N n F O _ o O _ o ...

Page 608: ...PM2C 231 SRM1 268 NT Link CPM1 CPM1A 228 types 226 wiring 226 communications functions 225 Communications Switch setting CPM2A 253 262 266 CPM2C 254 262 267 CompoBus S I O Link Unit 147 214 using 214 CompoBus S I O Master functions 148 CompoBus S I O Slave functions 147 214 constants operands 365 counter mode interrupts CPM2A CPM2C 68 counters conditions when reset 394 396 creating extended timers...

Page 609: ...ames FCS 239 function codes 364 expansion instructions 160 161 162 371 372 H high speed counter interrupts CPM1 CPM1A 86 CPM2A CPM2C 46 high speed counters CPM2A CPM2C 45 hold bit status PC Setup settings 17 host link CPM1 CPM1A 227 CPM2A CPM2C 231 SRM1 268 host link commands 304 EX 304 FK 298 IC 305 KC 299 KR 297 KS 296 MF 295 MM 300 MS 293 QQ 302 R 289 R 290 RC 282 RD 283 RG 283 RH 282 RJ 284 RL...

Page 610: ...EX 451 HTS 65 453 IL 02 351 381 383 ILC 03 351 381 383 INC 38 483 INI 61 133 399 INT 89 83 501 IORF 97 498 JME 05 383 JMP 04 383 JMP 04 and JME 05 353 KEEP 11 379 in controlling bit status 355 ladder instructions 337 LD 338 376 LD NOT 338 376 MAX 472 MCRO 99 157 486 MIN 474 MLB 52 470 MLPX 76 442 MOV 21 411 MOVB 82 419 MOVD 83 420 MSG 46 497 MUL 32 460 MULL 56 466 MVN 22 412 NEG 455 NOP 00 381 NOT...

Page 611: ...nmasking 84 CPM2A CPM2C high speed counter 46 input interrupts 30 interval timers 37 scheduled interrupt mode 39 masking 34 order of priority 27 selecting interrupts to be used 51 setting modes 33 types 26 unmasking 34 35 high speed counter programming 57 90 masking masking 35 SRM1 interval timers 94 scheduled interrupt mode 95 types 94 unmasking 504 interval timer interrupts CPM1 CPM1A 84 CPM2A C...

Page 612: ...le time 523 effects on SRM1 cycle time 539 SRM1 internal processing flowchart 537 output bit controlling ON OFF time 378 controlling status 354 356 P PC Link CPM2A CPM2C 263 PC Setup See settings PC Setup settings CPM1 CPM1A 3 CPM2A CPM2C 7 SRM1 V2 13 peripheral port servicing time 18 peripheral port servicing time PC Setup settings 18 positioning 126 precautions general xvii program coding sheet ...

Page 613: ...mers and counters 389 synchronized pulse control 134 errors delays 146 synchronized pulse output 496 T W target value comparison table CPM2A CPM2C 57 TC numbers 388 temperature sensor input functions 147 Temperature Sensor Units 147 193 time reading the time 163 setting the time 163 timers conditions when reset 389 390 TIML 393 TMHH 392 timing basic instructions CPM1 CPM1A 518 CPM2A CPM2C 528 SRM1...

Page 614: ...f notes changed Pages 54 55 56 57 58 71 79 92 99 106 107 112 113 115 116 117 119 133 153 154 160 174 175 198 201 213 348 414 425 428 429 Changes to graphics Pages 96 111 Change to Pulse Output Flag description Page 120 Pulse output number changed in program Page 134 Section added on data calculations Pages 137 to 139 Analog control sections combined Pages 148 149 Corrections made for function code...

Page 615: ...llustration corrected Page 202 DM area address corrected for SBB and BCD instructions at bottom of ladder program code Page 216 Communications current consumption added to top table Page 219 Callouts in top illustration corrected Pages 229 231 257 and 261 V1 version added to illustration Pages 240 and 248 V1 added to version in note Page 251 Recommended cables added Page 313 Model number added at ...

Reviews: