LSIS MASTER-K Series Instructions & Programming Download Page 252

Chapter 5. Application instructions  

5-140 

 

2)  Program example 

Program that read 5 words from M010 of the slave station (station number = h1A), and stores the 

data to D0000 ~ D0004 of the master station while the M0000 turns on. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M0000 

RECV  h1A  D0000  M010  h05 

 

 

 

 

 

 

 

 

 

 

5 words  
 

Slave station 

 

 

 

M010 
 

Station No. = h1A 

 

 

 

 

 

 

 

 

 

 

D0000 
 

5 words 
 

Master station 

 

 

Station No. = h1F 

Summary of Contents for MASTER-K Series

Page 1: ...Instructions Programming MASTER K z Readthismanualcarefullybeforeinstalling wiring operating servicingorinspectingthis equipment z Keep this manual within easy reach for quick reference ...

Page 2: ...Chapter 1 Introduction 1 1 Introductions 1 1 1 2 Features 1 1 ...

Page 3: ...gnostic error codes the cause of error can be identified easily c Debugging operation The MASTER K 200S 300S 1000S provides various debugging methods as following and it enable on line debugging execution with command by command execute with the break point designation execution according to the status of device execution with designated numbers of scan d Execution of various program types The MAS...

Page 4: ... K 2 8 2 3 4 Link relay L 2 8 2 3 5 Step control relay S 2 8 2 3 6 Timer relay T 2 9 2 3 7 Counter relay C 2 10 2 3 8 Data register D 2 11 2 3 9 Indirect assignment data register D 2 11 2 3 10 Special relay F 2 12 2 3 11 Special M L relay M L 2 12 2 3 12 Special data register D 2 12 2 4 Parameter setting 2 13 2 4 1 Watch dog timer setting 2 13 2 4 2 Timer area setting 2 13 2 4 3 The latch non vola...

Page 5: ...ns of MASTER K series 2 20 2 6 1 Interrupt functions 2 20 2 6 2 RTC Real Time Clock function 2 24 2 6 3 Forced I O setting 2 27 2 6 4 Program edit in RUN mode 2 28 2 6 5 Self diagnosis 2 29 2 7 Program check 2 30 2 7 1 JMP JME 2 30 2 7 2 CALL SBRT RET 2 31 2 7 3 MCS MCSCLR 2 32 2 7 4 FOR NEXT 2 33 2 7 5 END RET 2 34 2 7 6 Dual coil 2 34 2 8 Error handling 2 35 2 8 1 RUN STOP at operation error 2 3...

Page 6: ...L Link relay L0000 L007F 128 points L0000 L015F 256 points F Special relay F0000 F015F 256 points F0000 K015F 256 points 100ms T000 T031 32 points T000 T095 96 points T Timer relay 10ms T032 T047 16 points T096 T127 32 points C Counter relay C000 C015 16 points C000 C127 128 points S Step controller S00 00 S15 99 16 100 steps S00 00 S31 99 32 100 steps D Data register D0000 D0063 64 words D0000 D0...

Page 7: ...2 points L Link relay L0000 L063F 1 024 points F Special relay F0000 F063F 1 024 points T Timer relay 100msec T000 T191 192 points 10msec T192 T255 64 points The range of 100ms and 10ms timer can be changed with parameter setting C Counter relay C000 C255 256 points S Step controller S00 00 S99 99 100 100 steps D Data register D0000 D4999 5 000 words D0000 D9999 10 000 words The range of integer 1...

Page 8: ...Value 48 words T000 T047 T000 Timer Elapsed Value 48 words CounterSetting Value 16 words Counter Elapsed Value 16 words T047 C000 C015 C000 C015 Parameter setting area Word UserProgram Area 800 steps Timer relay 100ms 32 points T Timer relay 10ms 16 points T Counterrelay 16 points C T000 T031 T032 T047 C000 C015 StepController 16x100steps S00 00 S15 99 S S00 S15 0 F 0000 FFFF Retentive area Parea ...

Page 9: ...s T000 T127 T000 Timer Elapsed Value 128 words Counter Setting Value 128 words Counter Elapsed Value 128 words T127 C000 C127 C000 C127 Parameter setting area Word UserProgram Area 2 048 steps Timer relay 100ms 96 points T Timer relay 10ms 32 points T Counterrelay 128 points C T000 T095 T096 T127 C000 C127 StepController 32x100steps S00 00 S31 99 S S00 S31 0 F 0000 FFFF Retentive area Parea None T...

Page 10: ...al usage Timer Setting Value 256 words T000 T255 T000 Tim er Elapsed Value 256 words Counter Setting Value 256 words Counter Elapsed Value 256 words T255 C000 C255 C000 C255 Parameter setting area Word UserProgram Area MK1000S 30k steps MK300S 15k steps MK200S 7k steps Timer relay 100ms 192points T Timer relay 10ms 64 points T Counterrelay 256 points C T000 T191 T192 T255 C000 C255 StepController ...

Page 11: ...devices The redundant P devices that are not connected to external device s can be used in the same way with the auxiliary relay M Figure 1 The example of input output configuration The input signals are stored in batch in the input data memory before execution of each scan The data in the input data memory is used for execution of the sequence program operation The operation results are output by...

Page 12: ...n an output OUT instruction is executed The operation result is stored in the output data memory Output refresh Data in the output data memory is output in batch to the output module after execution of the END instruction 2 3 2 Auxiliary relay M The M area is internal relay used in the PLC CPU and can not be connected directly with external devices All M area except designated as latched area will...

Page 13: ...of L area please refer the list of link relay at appendix and the computer link user s manual 2 3 5 Step control relay S The S area can be used for two kinds of step control according to the instruction OUT or SET If the OUT instruction is used the S area functions as last in priority Otherwise it functions as sequential control See the chapter 4 for detailed usage When the CPU is switched on or t...

Page 14: ...s Timer instruction Description Timing method Time chart TON ON Delay Increment TOFF OFF Delay Decrement TMR Accumulation ON Delay Increment TMON Monostable Decrement TRTG Retriggerable Decrement Timer instruction No of timer relay Input contact Setting value ON Delay timer Input condition t t setting value OFF Delay timer t Accumulation timer t1 t2 t t1 t2 Monostabletimer t Retriggerable timer t ...

Page 15: ...pes and counting methods of counter instructions Counter instruction Type Counting method Input signal Time chart CTU Up Counter Increment 1 CTD Down counter Decrement 1 CTUD Up Down Counter Increment Decrement 2 CTR Ring counter Increment 1 Rising Edge OFF à ON U CXX CXXX R S XXXX Setting value Reset signal CountPulse Elapsedvalue Counteroutput Increasepulse Decreasepulse Setting value Setting va...

Page 16: ...ed for indirect addressing of the D area The contained value of data register assigned with symbol points the real address of data register at which the result of operation is stored If D is used with a double word instruction the lower 16 bits will stored at the data resister number designated by the contained value of D and higher 16 bits will stored at the data resister number 1 Example DMOV h1...

Page 17: ... Some M or L relays are reserved for special usage See the list of special relays at the appendix and be careful when use those M or L area in the program 2 3 12 Special data register D Some data registers are reserved for special usage These registers are various according to the type of CPU See the list of special registers at the appendix and be careful when use those data register in the progr...

Page 18: ...utomatically set as the rest of area 2 4 3 The latch non volatile area setting Applicable to K80S 200S K300S K1000S only The latch area designated by parameter setting will hold the result of operation when the CPU is switched on or turned to RUN mode The latch area of K10S1 K10S K30S K60S is fixed and cannot be changed Please refer the Chapter 2 2 for memory configuration Device Setting range Def...

Page 19: ...99999999 Over range error One or more operands exceed the specified device range RUN STOP ON OFF F110 F115 The F110 bit is updated after each instruction is completed Therefore even an operation error was occurred the F110 will be cleared if the next instruction is completed normally In other hand the F115 will be set when an operation error occurs and keep the on status until user cleared the F11...

Page 20: ...n be set with parameters by 10 msec unit The longest period is 60 seconds 3 PDI Process driven interrupt PDI is the interrupt that occurs when an input of interrupt module was turned on Refer the chapter 2 6 1 for more details 2 4 8 The reservation of I O number allocation Applicable for K200S K300S K1000S The I O number is allocated automatically by CPU module according to the actual status of mo...

Page 21: ...s Empty 0Pts TR Output 16 Pts Parameter setting 000 00F 1 010 01F 2 020 03F 040 04F 050 05F 3 060 06F 070 07F 1 The upper 16 pts of module is disabled 2 The upper 16 pts P030 P03F are used as internal relay 3 Since the slot is reserved as empty the input module is disabled 2 4 9 The output during debugging Applicable for K80S 200S K300S K1000S With this parameter setting user can decide that the r...

Page 22: ...nternal memory beginning with step 0 to the END instruction After executing the END instruction the CPU performs self diagnosis and refreshes output data and then returns to input refresh Input refresh Step 0000 Step 0001 END Self diagnosis Output refresh 1Scan Operation Scan The series of steps from step 0 to the next step 0 is called a scan Therefore a scan time of the CPU is calculated as a tot...

Page 23: ... mode change is available Figure 2 4 Operation modes of MASTER K series 1 The flow of RUN mode 1 END processing Self diagnosis Timer Counter update RUN mode Pause mode Program mode Debug mode Start RUN mode Clear the non latched memoryarea Check user program Execution of sequence program END processing 1 I O refresh Check mode change ...

Page 24: ...low of Pause mode Stops the operation of CPU but keep the status of output and internal memory 4 The flow of Debug mode Start PGM mode Turn the output off Self diagnosis I O refresh Check mode change StartPausemode Self diagnosis Check mode change Start Debug mode Clear non latched memory area Stop operation Self diagnosis I O refresh Check mode change Execute the operation at The designated step ...

Page 25: ... the corresponding interrupt The interrupt routine is not executed if an interrupt factor occurs before execution of an EI instruction Once an interrupt is enabled with EI instruction it keeps the enabled status until DI instruction is executed to disable the interrupt When a CPU is turned to RUN mode all interrupts are disabled by default When multiple interrupt factors occur simultaneously inter...

Page 26: ... 1 2 13 TDI0 TDI2 TDI5 INT7 10msec 25msec 100msec 0 1 2 29 TDI0 TDI2 TDI5 INT15 10msec 25msec 100msec a Period is the interval of time driven interrupt occurring It is variable from 10msec to 60000msec 60sec by 100msecunit b The priority is also used as the number of interrupt To enable disable the TDI5 interrupt with priority level 2 forexample useEI DIinstructionas EI5 DI5 Remark ...

Page 27: ... stopped and the interrupt of higher priority will be executed first Otherwise two interrupts are executed consequently The maximum numbers of TDI for K200S 300S 1000S are shown as following table See the 2 4 5 for details of parameter setting PLC type Available TDI K80S TDINT 0 7 K200S TDINT 0 7 K300S TDINT 0 13 K1000S TDINT 0 29 The following figure shows an example of TDI execution Figure 2 6 T...

Page 28: ...ts is similar as TDI The following figure shows an example of execution order of multiple PDI Figure 2 7 The execution order of multiple PDI MainProgram Interrupt routine 0 Interrupt routine 1 1 3 5 7 8 2 4 Interrupt routine 2 6 PDI 0 PDI 1 PDI 2 2 4 6 9 Program starts Interrupt 2 occurs Stop main program and run PDI routine 2 Interrupt 0 occurs higher priority Stop routine 2 and execute routine 0...

Page 29: ...name Description Year The lower 2 digits or 4 digits of the Christian Era Month 1 to 12 Date 1 to 31 A leap year is distinguished automatically Hour 0 to 23 24 hours Minute 0 to 59 Second 0 to 59 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday Day of the week 6 Saturday 2 Precision Max 1 728 second per 24 hours general temperature 3 K10S K30S K60S a Read RTC data RTC data is stored as ...

Page 30: ...ledata BCD format D249 Year h99xx D250 Date Month h1701 D251 Hour Day of the week h1100 D252 Second Minute h2453 Example 1999 1 17 11 53 24 Sunday M310 RTC data change bit When the M 310 bit is switched on the new data in D249 D252 will be moved to L12 L15 After data is moved M310 has to be switched off immediately because current data will be updated every scan while M310 is on Example program MO...

Page 31: ...iption K80S 200S K300S K1000S Higher byte Lower byte Data BCD format D4990 D9990 Lower 2 digits of year Month h9901 D4991 D9991 Date Hour h1711 D4992 D9992 Minute Second h5324 D4993 D9993 Higher 2 digits of year Day of the week h1900 Example 1999 1 17 11 53 24 Sunday M1904 RTC data change bit When the M1904 bit is switched on the new data in D4990 D4993 D9990 D9993 will be moved to F53 F56 After d...

Page 32: ...rd by force K80S 200S K300S a Write the forced I O data h8721 to the corresponding data word P10 is matched to the D4810 word D4810 word F E D C B A 9 8 7 6 5 4 3 2 1 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 b Write the forced I O address All bit hFFFF to the corresponding address word Write hFFFF to the D4710 D4710 word 0 disable forced I O 1 enable forced I O F E D C B A 9 8 7 6 5 4 3 2 1 0 1 1 1 1 1 1...

Page 33: ...M1910 d Output of P07 word P The previous result of operation F E D C B A 9 8 7 6 5 4 3 2 1 0 P P P P P P P P P P P P P P P P F E D C B A 9 8 7 6 5 4 3 2 1 0 P P P P P P P P P P P P P P P 1 2 6 4 Program edit in RUN mode Applicable for K80S 200S K300S K1000S User can insert delete or change instructions of program while the CPU is running This function is useful to debugging or test operation Plea...

Page 34: ...ed all outputs of the PLC are turned OFF and the ERR LED of the CPU will flashes RUN LED will be turned OFF Therefore when use FOR NEXT or CALL instruction insert WDT instruction to reset the watch dog timer 2 I O module check function If one or more I O modules are mounted dismounted while the PLC is powered the corresponding bit F0040 F0050 32 bits will be switched on If a module is mounted impr...

Page 35: ... only one JME n instruction The duplication of JME is not permitted However the duplication of JMP n instructions is possible 3 The JMP n instruction without corresponding JME n instruction stand alone JMP n will cause program error If only JME or JMP is inside of a loop subroutine FOR NEXT block or interrupt routine an operation error will occur when the JMP instruction is enabled JMP 005 Error S...

Page 36: ... n Multiple levels of nesting of the CALL P instruction are allowed 2 SBRT RET SBRT instruction shows the start of subroutine program and RET shows the end Those two instructions should be in pairs LOAD P000 SBRT 40 Error SBRT before END END RET Error Stand Alone LOAD P042 CALL 30 Error No SBRT END LOAD P010 CALL 30 END SBRT 30 Error No RET ...

Page 37: ...LR n instruction ends a master control sequence If a MCSCLR instruction is executed all master controls that have lower priority are cleared automatically MCS 0 MCS 1 MCSCLR 0 MCS 1 is cleared automatically MCSCLR 1 Error Improper order of MCSCLR When use master control it should start from the highest priority level and end from the lowest priority level The MCS n and MCSCLR n instructions should...

Page 38: ...um nesting level of FOR NEXT blockis 5 If there is a stand alone FOR or NEXT instruction or the nesting level exceeds 6 a program error occurs and CPU stops operation LOAD P000 FOR 1 No error 3 level nesting FOR 2 FOR 3 NEXT NEXT NEXT END LOAD P001 FOR 20 NEXT NEXT Error Stand alone NEXT END LOAD P002 FOR 20 END Error No END instruction is permitted between FOR and NEXT NEXT END ...

Page 39: ...T in a subroutine program a program error occurs and CPU stops operation END SBRT LOAD P000 OUT P 010 2 7 6 Dual coil If a memory device is used as an output of operation two or more times a dual coil error occurs Because this is not a serious error it does not make the CPU stop LOAD P0000 OUT M000 OUT M000 Dual coil error SET M000 Dual coil error Missing END Missing RET ...

Page 40: ...he executed instruction is not related to any error such as the LOAD instruction it keeps the previous value In other hand the F115 keeps the on status after it was switched on at once To clear the F115 flag execute the CLE instruction The following table shows an example of F110 and F115 operation Program Error occurred F110 F115 Remarks ADD D0 10 M20 No OFF OFF MOV D0 D10 Yes ON ON D10 hFFFF LOA...

Page 41: ...ing with 1sec period CPU is in RUN mode Always ON RUN CPU is in Stop mode or an error occurred Always OFF 2 K200S K300S K1000S LEDName Operating Status LED Indication CPU is in Stop Remote mode Always ON Serious error Flickering with 200ms period Light error Flickering with 600ms period STOP Program or parameter error Flickering with 1sec period RUN CPU is in RUN mode Always ON ...

Page 42: ...G representative Fuse break error I O fuse error h000A Run Stop The fuse used in output module is blown Check the fuse and replace it Instruction code error OP code error h000B Stop CPU meets an instruction can not be decoded during executing program Contact the nearest LG representative Flash Memoryerror User memory error H000C Stop CPU can not access the internal flash memory Check the flash mem...

Page 43: ...ompleted Program change error PGMChange error h0033 Run A code error occurred while editing program in RUN mode Code check error Code chack error h0040 Stop There is an instruction connot be decoded in program Revise program MissingEND instruction MissingEND instruction h0041 Stop There is no END instruction in program Insert END instruction at the end of program Missing RET error Missing RET inst...

Page 44: ... Counter instructions 3 4 3 2 Application instructions 3 5 3 2 1 Data transfer instructions 3 5 3 2 2 Conversion instructions 3 6 3 2 3 Compare instructions 3 6 3 2 4 Increment Decrement instructions 3 9 3 2 5 Rotation instructions 3 9 3 2 6 Shift instructions 3 10 3 2 7 Exchange instructions 3 11 3 2 8 BIN arithmetic instructions 3 11 3 2 9 BCD arithmetic instructions 3 13 3 2 10 Logical opration...

Page 45: ...lag instructions 3 18 3 2 16 Special module instructions 3 18 3 2 17 Data link instructions 3 18 3 2 18 Interrupt instructions 3 19 3 2 19 Sign inversion instructrions 3 19 3 2 20 Bit contact instructions 3 20 ...

Page 46: ...4 3 1 2 Connection instructions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page ANDLOAD Series connection of blocks 4 6 OR LOAD Parallel connection of blocks 4 8 MPUSH 005 Stores the operation result 4 10 MLOAD 006 Reads the operation result from MPUSH 4 10 MPOP 007 Reads the operation result from MPUSH and clears the result 4 10 3 1 3 Inversion instruction Mnemonic ...

Page 47: ...ing edge of input signal 4 16 DNOT 018 Generates o ne scan pulse on the falling edge of input signal 4 18 SET Set a device 4 19 RST Reset a device 4 20 OUT Output a device 3 1 6 Step controller instructions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page SET S Sequential processing control 4 22 OUT S Sxx xx Last in priority control 4 24 3 1 7 END instruction Mnemonic...

Page 48: ...4 27 TOFF 4 29 TMR 4 31 TMON 4 33 TRTG 4 35 t Input Output t settingvalue On delay timer Timersettingvalue TOFF Txxx v TimerrelayNo Timersettingvalue TON Txxx v TimerrelayNo t t settingvalue Off delay timer t1 t2 t settingvalue t t1 t2 Accumulation timer Input Output Timersettingvalue TMR Txxx v TimerrelayNo Timersettingvalue TMON TimerrelayNo Txxx v Timersettingvalue TimerrelayNo TRTG Txxx v t t ...

Page 49: ...terrelay Cxxx v Reset Count Pulse Current value Output Setting value D C T D R S Count Pulse Reset Settingvalue Counterrelay Cxxx v Reset Count Pulse Current value Output Setting value Reset Up Pulse Current value Output Down Pulse Setting value U CTUD R S Up Pulse Reset Settingvalue Counterrelay Cxxx v D Down Pulse Output Reset Count Pulse Current value D C T R R S Count Pulse Reset Settingvalue ...

Page 50: ...1 CMOV CMOVP 084 085 16 bits Complement data move 5 3 DCMOV DCMOVP 086 087 32 bits Complement data move 1 1 5 3 GMOV GMOVP 090 091 16 bits Group move 5 5 FMOV FMOVP 092 093 16 bits Filling move 5 7 BMOV BMOVP 100 101 n bit Bit move See the 5 9 page for detail usage 5 9 S D DMOVP S D MOV S D MOVP S D DMOV S D S D S D CMOV CMOVP DCMOV S D S D S D DCMOVP S D S D S D S D GMOV GMOVP S D n S D n S D n F...

Page 51: ...ng CPU Page CMP CMPP 050 051 16 bits Compare S1 and S2 Result is indicated by F120 F125 5 16 DCMP DCMPP 052 053 32 bits Compare S1 1 S1 and S2 1 S2 Result is indicated by F120 F125 5 16 TCMP TCMPP 054 055 16 bits Compare S1 and 16 words from S2 Result 16bits is stored at D 5 19 DTCMP DTCMPP 056 057 32 bits Compare S1 1 S1 and 32 words from S2 Result 32 bits is stored at D 1 D 5 19 S D Binary BCD B...

Page 52: ... LOAD AND OR 048 098 198 16 bits The input condition is switched on when S1 S2 Signed comparison 5 21 5 22 5 23 LOAD AND OR 058 106 216 16 bits The input condition is switched on when S1 S2 Signed comparison 5 21 5 22 5 23 LOAD AND OR 068 108 218 16 bits The input condition is switched on when S1 S2 Signed comparison 5 21 5 22 5 23 LOAD AND OR 078 118 228 16 bits The input condition is switched on...

Page 53: ...NDD ORD 049 099 199 32 bits The input condition is switched on when S1 1 S1 S2 1 S2 Signed comparison 5 21 5 22 5 23 LOADD ANDD ORD 059 107 217 32 bits The input condition is switched on when S1 1 S1 S2 1 S2 Signed comparison 5 21 5 22 5 23 LOADD ANDD ORD 069 109 219 32 bits The input condition is switched on when S1 1 S1 S2 1 S2 Signed comparison 5 21 5 22 5 23 LOADD ANDD ORD 079 119 229 32 bits ...

Page 54: ...n instructions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page ROL ROLP 020 021 16 bits 5 28 ROR RORP 034 035 16 bits 5 30 RCL RCLP 040 041 16 bits 5 32 RCR RCRP 044 045 16 bits 5 34 INC INCP D D DINC DINCP D D DEC DECP D D DDEC DDECP D D D D D D D D D D D D D D ROL ROLP D D D 15 0 D 15 0 1 bit rotate to left Carry ROR RORP D D RCL RCLP D D RCR RCRP D D D 15 0 D 15 0...

Page 55: ...PU Page BSFT BSFTP 074 075 S1 S2 bits 5 36 WSFT WSFTP 070 071 S1 S2 words 5 38 SR 16 bits 5 40 DROL DROLP D D DROR DRORP D D DRCL DRCLP D D DRCR DRCRP D D 1 bit rotate to left Carry 1 bit rotate to left include carry Carry Carry 1 bit rotate to right Carry 1 bit rotate to right include carry D 15 0 D 15 0 15 1 D 15 0 D 15 0 15 1 D 15 0 D 15 0 15 1 D 15 0 D 15 0 15 1 BSFT BSFTP S1 S2 S1 S2 0 S2 S1 ...

Page 56: ...0 111 16 bits S1 S2 D 5 44 DADD DADDP 112 113 32 bits S1 1 S1 S2 1 S2 D 1 D 5 44 SUB SUBP 114 115 16 bits S1 S2 D 5 46 DSUB DSUBP 116 117 32 bits S1 1 S1 S2 1 S2 D 1 D 5 46 MUL MULP 120 121 16 bits S1 S2 D 1 D D 1 High word D Low word 5 48 DMUL DMULP 122 123 32 bits S1 1 S1 S2 1 S2 D 3 D 2 D 1 D D 3 D 2 Higher 2 words D 1 D Lower 2 words 5 48 XCH XCHP D1 D2 D1 D2 DXCH DXCHP D1 D2 D1 D2 S1 S2 S1 S2...

Page 57: ...ng operation S1 S2 D 1 D D 1 High word D Low word DMULS DMULSP 076 077 32 bits Signed multiplying operation S1 1 S1 S2 1 S2 D 3 D 2 D 1 D D 3 D 2 Higher 2 words D 1 D Lower 2 words DIVS DIVSP 088 089 16 bits Signed dividing operation S1 S2 D D 1 Remainder D Quotient DDIVS DDIVSP 128 129 32 bits Signed dividing operation S1 1 S1 S2 1 S2 D 3 D 2 D 1 D D 3 D 2 Remainder D 1 D Quotient S1 S2 S1 S2 D S...

Page 58: ...41 16 bits BCD multiplication S1 S2 D 1 D D 1 High word D Low word 5 56 DMULB DMULBP 142 143 32 bits BCD multiplication S1 1 S1 S2 1 S2 D 3 D 2 D 1 D D 3 D 2 Higher 2 words D 1 D Lower 2 words 5 56 DIVB DIVBP 144 145 16 bits BCD division S1 S2 D D 1 Remainder D Quotient 5 58 DDIVB DDIVBP 146 147 32 bits BCD division S1 1 S1 S2 1 S2 D 3 D 2 D 1 D D 3 D 2 Remainder D 1 D Quotient 5 58 S1 S2 D DMULB ...

Page 59: ...2 D 5 62 DWOR DWORP 156 157 32 bits S1 1 S1 OR S2 1 S2 D 1 D 5 62 WXOR WXORP 160 161 16 bits S1 XOR S2 D 5 64 DWXOR DWXORP 162 163 32 bits S1 1 S1 XOR S2 1 S2 D 1 D 5 64 WXNR WXNRP 164 165 S1 XNR S2 D 5 66 DWXNR DWXNRP 166 167 S1 1 S1 XNR S2 1 S2 D 1 D 5 66 S1 S2 S1 S2 D WAND WANDP D S1 S2 D DWAND DWANDP S1 S2 D S1 S2 S1 S2 D WAND WANDP D S1 S2 D DWAND DWANDP S1 S2 D S1 S2 S1 S2 D WXOR WXORP D S1 ...

Page 60: ... DBSUM DBSUMP 172 173 32 bits 5 73 ENCO ENCOP 176 177 2 n bits 5 75 DECO DECOP 178 179 n bits 5 77 FILR FILRP 180 181 16 bits 5 79 DFILR DFILRP 182 183 32 bits 5 79 SEG SEGP S D Cw S D Cw decoding ASC ASCP S D Cw S D Cw DBIN DBINP S D S D 15 0 Quantity of 1 DBIN DBINP S D S D 15 0 S Quantity of 1 0 15 S 1 S D 1 D D ENCO ENCOP S D n S D n DECO DECOP S D n S D n 2 n bits 0 Encode S D n bits 0 Decode...

Page 61: ... 32 bits 5 81 DIS DISP 194 195 16 bits 5 83 UNI UNIP 192 193 32 bits 5 85 IORF IORFP 200 201 16 bits Refreshes the memory area from D1 to D2 D1 D2 5 87 FILW FILWP S D n S D n S S S n D File table write S S File table write DFILW DFILWP S D n S D n S n S n 1 D D 1 4bits 4bits S D D 1 D 2 All 0 When n 3 DIS DISP S D n S D n S S 1 S 2 4bits 4bits D When n 3 UNI UNIP S D n S D n IORF IORFP D1 D2 D1 D2...

Page 62: ...ructions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page JMP JME 012 013 Jump Jump end 5 96 CALL CALLP 014 015 Call the subroutine 5 98 SBRT RET 016 004 Start of a subroutine End of subroutine 3 2 14 Loop instructions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page FOR NEXT 206 207 Executes the sequence program between FOR and NEXT n ti...

Page 63: ...4 PUT PUTP 234 235 Write data to shared RAM of a special module 5 106 3 2 17 Data link instructions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page READ WRITE 244 245 Read Write data of remote station 5 108 5 111 RGET RPUT 232 233 Read Write data of shared RAM of remote special module 5 113 5 116 CONN 246 Establish a communication channel STATUS 247 Read the informat...

Page 64: ...all interrupts Disable all interrupts 5 119 TDINT INT IRET 226 227 225 Start of TDI routine Start of PDI routine End of interrupt routine 5 120 5 121 3 2 19 Sign inversion instructrions Mnemonic symbol Function No Ladder symbol Unit Contents of processing CPU Page NEG NEGP 240 241 Invert the sign of D 5 122 DNEG DNEGP 242 243 Invert the sign of D 1 D 5 122 DI n EI n DI EI TDINT n INT n IRET NEG D ...

Page 65: ...D 250 NO contact series connection with the n th bit of D 5 125 BANDN 251 NC contact series connection with the n th bit of D 5 125 BOR 252 NO contact parallel connection with the nth bit of D 5 126 BORN 253 NC contact parallel connection with the n th bit of D 5 126 BOUT 236 Output the result of operation to the n th bit of D 5 127 BSET 223 Set the n th bit of D 5 128 BRST 224 Clear the nth bit o...

Page 66: ...version instruction 4 12 4 3 1 NOT 4 12 4 4 Master control instructions 4 13 4 4 1 MCS MCSCLR 4 13 4 5 Output instructions 4 16 4 5 1 OUT 4 16 4 5 2 D 4 17 4 5 3 D NOT 4 19 4 5 4 SET 4 20 4 5 5 RST 4 21 4 6 Step controller instructions 4 23 4 6 1 SET Sxx xx 4 23 4 6 2 OUT Sxx xx 4 25 4 7 End instructions 4 26 4 7 1 END 4 26 4 8 No operation instruction 4 27 4 8 1 NOP 4 27 4 9 Timer instructions 4 ...

Page 67: ...4 9 3 TMR 4 32 4 9 4 TMON 4 34 4 9 5 TRTG 4 36 4 10 Counter instructions 4 38 4 10 1 CTU 4 38 4 10 2 CTD 4 39 4 10 3 CTUD 4 40 4 10 4 CTR 4 42 ...

Page 68: ...n do not use computer link module or data link module 1 LOAD a Functions Starts a NO contact Draw the on off data of the specified device and use the data as an operation result 2 LOAD NOT a Functions Starts a NC contact Draw the on off data of the specified device and use the data as an operation result 3 OUT a Functions Outputs the operation result to the specified device Several OUT instruction...

Page 69: ...tions 4 2 OUT 4 Programexample When the input condition P020 is switched on the P060 and P061 will be switched on and the P062 will be switched off LOAD P020 P060 LOADNOT P020 P063 P061 P020 P060 P061 P063 Program Time chart ...

Page 70: ...ice performs the AND operation of that data and the previous operation result and use it as a new operation result 2 ANDNOT a Functions The NC contact series connection Read the on off data of the specified device performs the AND operation of that data and the previous operation result and use it as a new operation result 3 Programexample The P061 contact will be switched on when the P020 and P02...

Page 71: ...he specified device performs the OR operation of that data and the previous operation result and use it as a new operation result 2 OR NOT a Functions TheNCcontact parallel connection Draw the on off data of the specified device performs the OR operation of that data and the previous operation result and use it as a new operation result 3 Programexample The P061 contact will switched on when the o...

Page 72: ... is pushed 2 System structure 3 Program 0 1 2 3 0 1 2 3 Stop PB0 Forward PB1 Digital input module P03 Digital output module P06 Reverse PB2 Mag S W Mag S W M Forward rotation Reverse rotation Motor P060 P031 P060 P061 P032 P061 P030 P032 P061 P030 P031 P060 END 0000 0006 0011 Forward operation Set an interlock with reverse operation P032 P061 P032 P061 Reverse operation Set an interlock with forwa...

Page 73: ...ger Steps Error F110 Zero F111 Carry F112 ANDLOAD 1 1 Functions Performs the AND operation of block A and block B and uses it as an operation result The AND LOAD instruction can be written consecutively up to 7 times 2 Programexample ANDLOAD Block A Block B P060 P021 P023 P024 P026 P025 P022 P020 ANDLOAD P020 P022 P026 P060 Program Time chart ...

Page 74: ...ite program in ladder mode the KGL WIN software will convert the ladder program into mnemonic program A automatically P060 M000 M002 M004 M006 M008 M001 M003 M004 M007 M009 END Ladder program Mnemonic program LOAD OR LOAD OR ANDLOAD LOAD OR ANDLOAD LOAD OR ANDLOAD LOAD OR ANDLOAD OUT END M000 M001 M002 M003 M004 M005 M006 M007 M008 M009 P060 A Don t use AND LOAD instructions consecutively LOAD OR ...

Page 75: ...r F110 Zero F111 Carry F112 OR LOAD 1 1 Functions Performs theOR operation of block A and block B and uses it as an operation result The AND LOAD instruction can be written consecutively up to 7 times 2 Programexample Block A Block A P060 P021 P023 P023 P020 OR LOAD P024 P025 P060 P061 P025 P024 P026 P061 P020 Program Time chart ...

Page 76: ... program in ladder mode the KGL WIN software will convert the ladder program into mnemonic program A automatically Ladder program Mnemonic program LOAD AND LOAD AND OR LOAD LOAD AND OR LOAD LOAD AND OR LOAD LOAD AND OR LOAD OUT END M000 M001 M002 M003 M004 M005 M006 M007 M008 M009 P060 A Don t use OR LOAD instructions consecutively LOAD AND LOAD AND LOAD AND LOAD AND LOAD AND OR LOAD OR LOAD OR LO...

Page 77: ... b MLOAD Reads the operation result stored by the MPUSH instruction and resume the operation with that operation result starting at the next step c MPOP Reads the operation result stored by the MPUSH instruction and resumes the op eration with that operation result starting at the next step Then clears the operation result stored by the MPUSH instruction d The MPUSH instruction can be used up to 8...

Page 78: ...07 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 STEP INSTRUCTION LOAD MPUSH AND MPUSH AND AND MPUSH AND OUT MLOAD AND OUT MPOP AND OUT MLOAD AND OUT MPOP AND OUT MLOAD AND OUT MPOP AND OUT END NOP NOP NOP P020 P021 P022 P023 P024 P061 P025 P061 P026 P061 P027 P063 P028 P064 P029 P065 P02A P066 Ladder program Mnemonic program ...

Page 79: ...tions Inverts the operation result before the NOT instruction Before NOT instruction After NOT instruction NC contact NO contact NO contact NC contact Serial AND connection Parallel OR connection Parallel OR connection Serial AND connection 2 Programexample The following two programs perform same operation NOT ProgramA P060 P020 P021 P022 P023 P024 ProgramB P060 P020 P021 P022 P023 P024 ...

Page 80: ...e program between the MCS instruction and the MCSCLR instruction that has same nof the MCS instruction is executed Each MCS instructions are followed by a number n that shows the priority of master control 0 is the highest priority and 7 is lowest priority The MCS instruction should be used in order of priority level The MCSCL R instruction shows the end of master control When a MCSCLR n instructi...

Page 81: ...truction is off Therefore scan time does not become shorter 2 When On Off command for the MCS instruction is off the operation result of MCS to MCSCLR is as indicated below TIMER The timer output contact turns off and the current value becomes 0 COUNTER The counter output contact turns off but the current value holds the present value OUT All turns off SET RST Hold present value 3 If an instructio...

Page 82: ...d with master control MCS and MCSCLR instructions P024 P021 P023 P061 P060 P029 P060 P022 P027 P026 P027 P061 Manual operation P020 Automatic operation P061 M010 P020 P022 MCS 0 P021 P026 P027 M011 MCSCLR 0 M020 P021 P024 MCS 1 P020 P027 P029 M021 MCSCLR 0 M010 P060 M020 P061 M011 P061 M02 P060 P061 END P023 Manual circuit Automatic circuit Common circuit PLC program with master control Relay circ...

Page 83: ...teps Error F110 Zero F111 Carry F112 OUT O O O O 2 Available only when do not use computer link module or data link module 1 Functions Outputs the operation result to the bit device specified as D 2 Programexample Program that turn the P020 on when the M000 or M001 is turn on D D Device to be output the operation result D P020 M000 M001 ...

Page 84: ...instruction turns on the specified device for one scan when the input condition of D instruction is turned on Be careful when use a P area as 2 Programexample When the P032 is switched on the M002 is turned on for one scan D D D Device to be converted into pulse D P032 D M002 P060 P060 M002 The self locking circuit that shows the M002 is turned on P032 1scan On M002 P060 The P060 keeps the on stat...

Page 85: ...shed the P060 is switched on It is switched off when the PB0 is pushed again The P060 will repeat on off whenever the PB0 is pushed 2 System structure 3 Program 4 Time chart 0 1 2 3 Program 0 1 2 PB0 Digital input module P00 Digital output module P06 Repeat On Off P000 D M000 P060 P060 M000 P060 M000 0000 0003 0009 END P000 P060 ...

Page 86: ...he D instruction turns on the specified device for one scan when the input condition of D instruction is turned on Be careful when use a P area as 2 Programexample When the P033 is switched off the M003 is turned on for one scan DNOT D D Device to be converted into pulse D P033 D M003 P060 P060 M003 The self locking circuit that shows the M003 is turned on P033 1scan On M003 P060 The P060 keeps th...

Page 87: ...dule 1 Functions When the input condition of SET instruction turns on the specified device is switched on The turned on device remains on even if the input condition of SET instruction is turned off The device can be switched off by the RST instruction 2 Programexample When the input condition P020 turns on the P060 and P061 is turned on by OUT and SET instruction D D SET D P060 P020 P020 SET P061...

Page 88: ...le or data link module 1 Functions When the input condition of RST instruction turns on the specified device is changed as described Device Status M P K L The specified bit is turned off T The timer output is turned off and current value is cleared as 0 2 Programexample Set the P061 with the P020 and reset the P061 with the P021 D RST D P060 P020 P020 SET P061 RST P061 P021 P020 P021 P060 P061 Pro...

Page 89: ...ff and turned on again power failure operations of P and K are different as shown below 2 The difference of I O relay P and keep relay K with the SET RST instruction The SET instruction makes turn a specified device on and keep the on status until the RST instruction is executed However the Pand K area operate differently when a power failure occurred P060 P060 PB0 PB1 K000 K000 PB0 PB1 PB0 PB1 P0...

Page 90: ... on or the step controller group is initialized The Sxx 00 is switched on Even if multiple input condition turn on only one step controller is switched on The Sxx 00 is initialization step and the Sxx xx group will be initialized by switching on the Sxx 00 When the CPU is turned to RUN mode the Sxx 00 is set by default 2 Programexample A sequential control by using S01 xx group D SET S xx xx S xx ...

Page 91: ...ET S01 02 End of process 1 SET S01 03 SET S01 04 SET S01 00 Process1 End of process 1 S00 01 S00 02 S00 03 S00 04 END Start process 1 Start process 2 Start process 3 Start process 4 Initialize step controller End of process 2 End of process 3 End of process 4 Perform the process 1 and turn on End of process 1 when the process 1 is finished Process2 End of process 2 Perform the process 2 and turn o...

Page 92: ...p controller of same group turns on Only one step controller turns on even if multiple input conditions turn on At this time the last turned on step controller has the highest priority The Sxx 00 is initialization step and the Sxx xx group will be initialized by switching on the Sxx 00 When the CPU is turned to RUN mode the Sxx 00 is set by default 2 Programexample D S xx xx Step No 00 99 Group 00...

Page 93: ...es the en d of sequence program When the CPU meet the END instruction it stops the execution of sequence program and perform the END process All instructions after END instruction except subroutines and interrupt routine are ignored and not executed If there is no END instruction the program error will occur END Input refresh 0000 LOAD P020 0001 AND P021 2550 END Self diagnosis Output refresh The ...

Page 94: ...ation instruction and has no effect on the previous operation result The NOP instruction is used in the following cases a To provide space for debugging of sequence programs b To delete aninstruction without changing the number of steps c To delete an instruction temporarily 2 Programexample 00000 Mnemonic program 0000 LOAD P020 0001 AND P021 0002 NOP 0003 OUT P060 0004 LOAD P022 0005 OUT P061 000...

Page 95: ...0 01 sec until it reaches to the setting value or input condition turns off The timer contact will be switched on when the current value reaches to the setting value The timer contact and current value is cleared when the input condition turns off or RST instruction is executed 2 Programexample The T097 0 01 sec timer will turn on 20 seconds later until the P020 is switched on V TON Inputcondition...

Page 96: ...mp flickers periodically while the P020 is on 2 System diagram 3 Program 0 1 2 3 F Program 0 1 2 3 F Start P020 Input module P02 Output module P06 L P020 T001 TON T000 00005 T000 TON T001 00006 P065 END Set a Off time 0 5sec Set a On time 0 6 sec T000 T001is set as 100 msec timer Ladder program Time chart T0 T1 P020 ...

Page 97: ...lue will decrease by 1 at every 0 1 or 0 01 sec until it reaches to 0 or input condition turns off The timer contact will be switched off when the current value reaches to 0 When the input condition turns off or RST instruction is executed the timer contact will turn off and the current value will be cleared as 0 2 Programexample The T000 0 1 sec timer will turn off 5 seconds later until the P020 ...

Page 98: ... 2 3 F On Off MC0 MC1 MC2 Motor 1 Motor 0 A B C Conveyer M2 M1 M0 P060 P020 T010 TOFF T010 00100 P020 TON T000 00050 P062 T011 TOFF T011 00050 T000 T011 P020 TON T001 00100 P062 T001 P020 END 0000 0004 0006 0010 0014 0017 0021 0024 Set the off delay time of conveyer A 10sec Set the on delay time of conveyer B 5sec Set the off delay time of conveyer B 5sec Set the on delay time of conveyer C 5sec T...

Page 99: ...turns on Even if the input condition is off the current value is not cleared If uses a timer of retentive data area the timer will keep the current value while theCPU is powered off When the RST instruction is executed the timer contact and current value will be cleared as 0 2 Programexample V TMR Inputcondition Timer setting value Timer contact number Setting time t Unit period 0 1 or 0 01 sec x ...

Page 100: ...larm signal to notice that a replacement of drill is required 2 System diagram I O Description P020 Detect of drill down P021 Replacement completion P060 Turn on an alarm lamp T000 Timer for the lifetime of drill 3 Program 0 1 2 F Program 0 1 2 F Motor Inputmodule P02 Output module P06 L Completion of replacement Sensor Drill Alarm lamp P060 P020 C000 TMR T000 36000 U CTU C000 R s 00100 RST T096 T...

Page 101: ...the current value will decrease by 1 at every 0 1 or 0 01 sec until it reaches to 0 and the timer contact will be switched off when the current value reaches to 0 While a timer is operating on off changed of input condition is ignored When the RST instruction is executed the timer contact will turn off and the current value will be cleared as 0 2 programexample V TMON Inputcondition Timer setting ...

Page 102: ...ignal 2 System diagram I O Description P020 Limit switch output M0020 Stabilized signal of P020 T000 Chattering prevention timer 3 Program 0 1 2 F Stabilized signal a fixed period T Cart Moving direction L S The limit switch output with low speed of cart The limit switch output with high speed of cart Inputmodule P02 M0020 P020 T000 TMON T000 0002 Even if P020 trembles after P020 turns on in a mom...

Page 103: ...very 0 1 or 0 01sec until it reaches to 0 and the timer contact will be switched off when the current value reaches to 0 If the input condition turns on again during timer operation the current value will reset as the setting value and re start to decreasing from the setting value When the RST instruction is executed the timer contact will turn off and the current value will be cleared as 0 2 Prog...

Page 104: ...t is passed within a specified period or not 2 System diagram 3 Program 0 1 2 F Inputmodule P02 Conveyer Detector Supplier M100 P020 T005 TRTG T005 00200 If there is no product passing during 20 seconds the timer turns off and M100 is switched off During normal operation the M100 keeps on state Detecting signal P020 T 20sec T5 M100 Timer contact Operating indicator ...

Page 105: ...lue is reached to the setti ng value the counter contact turns on After the counter contact turns on the current value keeps increasing until its maximum value 65535 When the reset signal is switched on the counter contact and current value is cleared as 0 2 Programexample Whenever the P030 is changed from off to on the current value of C010 is increased by 1 The P031 is reset condition V P030 P03...

Page 106: ...the setting value and when the current value reached to 0 the counter contact is switched on When the reset signal turns on the counter contact is switched off and the current value is reset as the setting value 2 Programexample Whenever the P030 is changed from off to on the current value of C010 is decreased by 1 The P031 is reset condition V P030 P031 D CTD C010 R S 00010 P060 C010 Setting valu...

Page 107: ...edge is detected at the down count input The initial current value is 0 The counter contact turns on when the current value is same or greater than the setting value When the reset signal turns on the counter contact and current value is cleared as 0 2 Programexample The P030 is up count input and the P031 is down count input The P032 is reset signal V P030 P031 U CTUD C000 R S 00010 P060 C000 P03...

Page 108: ...erating all motors will stop their operation 2 System diagram 3 Program 0 1 2 3 Program Input module P03 Input module P06 0 1 2 3 M3 M2 M1 PB1 PB2 M4 0006 P060 P030 P031 U CTUD C001 R S 00001 C005 D P030 P031 U CTUD C001 R S 00002 C005 D P030 P031 U CTUD C003 R S 00001 C005 D P030 P031 U CTUD C0004 R S 00004 C005 D P030 P031 U CTUD C005 R S 00005 C005 D C001 P061 C002 P062 C003 P063 C004 END 0000 ...

Page 109: ...urrent value will be cleared as 0 when the next rising edge is applied to the count pulse input When the reset signal turns on the counter contact and current value willbe cleared as 0 2 Programexample The P030 is count pulse input and when the current value is same as the setting value the counter contact is switched on When the P030 is switched on 11 th time the counter contact P060 is off and t...

Page 110: ...arison instructions 5 16 5 3 1 CMP CMPP DCMP DCMPP 5 16 5 3 2 TCMP TCMPP DTCMP DTCMPP 5 19 LD 5 21 5 3 4 AND 5 22 5 3 5 OR 5 23 5 4 Increment decrement operations 5 24 5 4 1 INC INCP DINC DINCP 5 24 5 4 2 DEC DECP DDEC DDECP 5 26 5 5 Rotation instructions 5 28 5 5 1 ROL ROLP DROL DROLP 5 28 5 5 2 ROR RORP DROR DRORP 5 30 5 5 3 RCL RCLP DRCL DRCLP 5 32 5 5 4 RCR RCRP DRCR DRCRP 5 34 5 6 Shift instr...

Page 111: ... instructions 5 64 5 10 1 WAND WANDP DWAND DWANDP 5 64 5 10 2 WOR WORP DWOR DWORP 5 66 5 10 3 WXOR WXORP DWXOR DWXORP 5 68 5 10 4 WXNR WXNRP DWXNR DWXNRP 5 70 5 11Data processing instructions 5 72 5 11 1 SEG SEGP 5 72 5 11 2 ASC ASCP 5 75 5 11 3 BSUM BSUMP DBSUM DBSUMP 5 77 5 11 4 ENCO ENCOP 5 79 5 11 5 DECO DECOP 5 81 5 11 6 FILR FILRP DFILR DFILRP 5 83 5 11 7 FILW FILWP DFILW DFILWP 5 85 5 11 8 ...

Page 112: ...8 Inturrupt instructions 5 123 5 18 1 EI DI 5 123 5 18 2 TDINT IRET 5 124 5 18 3 INT IRET 5 125 5 19 Sign inversion instruction 5 126 5 19 1 NEG NEGP DNEG DNEGP 5 126 5 20 Bit contact instructions 5 128 5 20 1 BLD BLDN 5 128 5 20 2 BAND BANDN 5 129 5 20 3 BAND BANDN 5 130 5 20 4 BOUT 5 131 5 20 5 BSET BRST 5 132 5 21 Computer link module instructions 5 133 5 21 1 SND 5 133 5 21 2 RCV 5 134 5 22 Hi...

Page 113: ...nly when do not use computer link module or data link module 1 Functions MOV P Transfer the 16 bits data of the device specified at S to the device specified at D DMOV P Transfer the 32 bits data of the device specified at S 1 S to the device specified at D 1 D Operand setting D S MOV MOVP DMOV DMOVP S D S D The source device at which the data to be transferred is stored The device of transfer des...

Page 114: ...ogramexample Whenever a rising edge is detected at the P020 the h00F3 is movedto the P04 word MOVP h70F3 P04 P020 Inputcondition MOV DMOV MOVP DMOVP Executed only once Executed only once Executed per scan Executed per scan 0 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 P04F P040 ...

Page 115: ...uter link module or data link module 1 Functions CMOV P Reverses the 16 bits data of S per bit and transfers the result to D DCMOV P Reverses the 32 bits data of S 1 S per bit and transfers the result to D 1 D Operand setting D S CMOV CMOVP DCMOV DCMOVP S D S D The source device at which the data to be transferred is stored The device at which the reversed result is stored D S 16 bits D S 0 1 1 1 ...

Page 116: ...0 is on reverse the data of P02 word and transfer the result to P06 word CMOV P02 P06 M020 16 bits 0 0 1 1 1 0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 Reverse P02 P06 Inputcondition CMOV DCMOV CMOVP DCMOVP Executed only once Executed only once Executed per scan Executed per scan ...

Page 117: ...e computer link module or data link module 1 Functions Transfers the content of n words which begin with the device specified at S in blocks to n words which begin with the device specified at D Operand setting GMOV GMOVP S D S D The start address of source data area The start address of destination area will store transferred data D D S S n n Numbers of transferred words n h0002 h0007 h007F h005A...

Page 118: ...e While the P020 is on move the data of D000 D001 and D002 to P04 P05 and P06 area Inputcondition GMOV GMOVP Executed only once Executed only once Executed per scan Executed per scan h0001 h0004 h005F h0001 h0004 h005F D0000 D0001 D0002 P04 P05 P06 D S n GMOV D0000 P04 3 P020 ...

Page 119: ...7 O Available only when do not use computer link module or data link module 1 Functions Transfers the content of device specified at S in blocks to n points which begin with the device specified at D Operand setting FMOV FMOVP S D S D The device at which source data area is stored The start address of destination area will store transferred data D D S S n n Numbers of transferred words n n h005A h...

Page 120: ...mple Whenever a rising edge is detected at P030 transfer the content of P02 word to the block of P04 P05 and P06 Inputcondition FMOV FMOVP Executed only once Executed only once Executed per scan Executed per scan FMOVP P02 P04 3 P020 h0098 P02 h0098 h0098 h0098 P04 P05 P06 ...

Page 121: ... start bit of S b d The start bit of D c zz Numbers of transferredbits Hexadecimal Transfers the content of zz bits from the s bit of the device specified at S to the zz bits from d bit of the device specified at D The maximum value of the zz is h10 16 If the value of zz is 0 or over h10 the instruction will be ignored The error flag F110 is set when the zz is over h10 Operand setting BMOV BMOVP S...

Page 122: ...ising edge is detected at the P030 transfer 4 bits from the P020 bit to the 4 bits from the P063bit Inputcondition BMOV BMOVP Executed only once Executed only once Executed per scan Executed per scan BMOVP P02 P06 h0304 P030 1 0 0 1 1 P02F P020 1 0 0 1 1 P06F P060 P063 P023 P066 4bits 4bits ...

Page 123: ... device specified at S into BCD format and transfers the result to the device specified at D DBCD Converts binary data 0 to 99999999 of the device specified at S into BCD format and transfers the result to the device specified at D Operand setting D S BCD BCDP DBCD DBCDP S D S D The source device at which the data to be converted to BCD format is stored The device at which the converted result is ...

Page 124: ...urce S is outside the range of 0 to 99999999 2 Programexample While P020 is on convert the binary data of D001 and transfer the result to the P05 word Inputcondition BCD DBCD BCDP DBCDP Executed only once Executed only once Executed per scan Executed per scan BCD D0001 P05 P020 0 8192 1 4096 0 32768 0 16384 0 512 1 256 0 2048 0 1024 0 32 1 16 0 128 0 64 0 2 1 1 0 8 0 4 0 2000 0 1000 0 8000 1 4000 ...

Page 125: ...aches to 30 the incoming conveyer will be stopped 2 System diagram 3 Program Conveyer motor n n n n n n n n n n n n n n n n n n n n n n Incoming n n P030 Light S W n n P031 Light S W Light S W n Outgoing 0 1 2 3 4 5 6 7 F 0 1 2 3 Program Inputmodule P03 Output module P04 Output module P06 Ÿ M 0 F 1 8 Counter reset S W P032 Digital indicator F010 U CTUD C000 D R S 0003 P031 P030 P06F BCD C000 M000 ...

Page 126: ...evice specified at S into binary format and transfers the result to the device specified at D DBIN Converts BCD data 0 to 99999999 of the device specified at S into binary format and transfers the result to the device specified at D Operand setting D S BIN BINP DBIN DBINP S D S D The source device at which the data to be converted to BCD format is stored The device at which the converted result is...

Page 127: ...gramexample While P020 is on convert the BCD data of P00 word and transfer the result to the D0001 Inputcondition BIN DBIN BINP DBINP Executed only once Executed only once Executed per scan Executed per scan BIN P00 D0001 P020 0 8192 1 4096 0 32768 0 16384 0 512 1 256 0 2048 0 1024 0 32 1 16 0 128 0 64 0 2 1 1 0 8 0 4 0 2000 0 1000 0 8000 1 4000 1 200 1 100 0 800 0 400 1 20 0 10 0 80 1 40 0 2 1 1 ...

Page 128: ...O O O O O O O 5 9 O 1 Functions Compares contents of two devices specified at S1 and S2 After comparing set corresponding flag among F 120 F125 F120 F121 F122 F123 F124 F125 Flag 0 0 0 1 1 1 1 1 0 0 0 1 0 1 1 0 1 0 Above flags indicate the result of CMP instruction executed at last The error flag F110 is set when S1 or S2 specified as D format is over device range The instruction at which error oc...

Page 129: ...1 and set flags according to the result F120 F121 F122 F123 F124 F125 Flag Result 1 1 0 0 0 1 Inputcondition CMP DCMP CMPP D CMPP Executed only once Executed only once Executed per scan Executed per scan 0 0 0 1 0 0 0 h0008 D0000 0 0 1 0 0 0 1 h2001 D0001 M0000 M0001 M0002 END CMP D0000 D0001 F120 F123 F122 Program Flag setting ...

Page 130: ...rn on when 30 39 and P064 will be on when the current value is 40 or larger 2 Program U CTUD C000 D R S 00050 P030 P031 P032 F010 CMP C000 00010 F120 M0000 F010 CMP C000 00020 F120 M0001 F010 CMP C000 00030 F120 M0002 F010 CMP C000 00040 F120 M0003 M0000 P060 M0000 P061 M0001 M0001 P062 M0002 M0002 P063 M0003 M0003 P064 END 0000 0006 0014 0012 0020 0028 0022 0030 0038 0036 0040 0046 0043 0051 0049...

Page 131: ...s content of the device specified at S1 with each contents of 16 words from the device specified at S2 The comparison result If two words are same 1 is output If not 0 is output consists of 16 bits and they are stored at the device specified at D If all comparison result are 0 then the zero flag F111 is switched on D 0 Execution conditions Operand setting TCMP TCMPP DTCMP DTCMPP Data to be compare...

Page 132: ...tent of D0001 with 16 words from M00 M00 M15 and output the comparison result to P06 word P060 P06F TCMP D0001 M000 P06 P020 hBCDE h1234 hBCDE h0000 hBCDE hB C D E h00FF hBCDE h0000 M000 M002 M004 M012 M015 1 0 1 0 1 1 0 1 0 P060 P062 P06D P064 P06E P06C P06F M013 M014 hBCDE D0001 P063 P061 ...

Page 133: ...act according to the comparison operation result The comparison is executed as signed operation The comparison operation result is as shown below Instruction symbol in Condition Comparison operation result Instruction symbol in Condition Comparison operation result S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 On S1 S2 Off 2 Programexample a Compare P0000 P000F and D0001 If the...

Page 134: ... according t o the comparison operation result The comparison is executed as signed operation The comparison operation result is as shown below Instruction symbol in Condition Comparison operation result Instruction symbol in Condition Comparison operation result S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 On S1 S2 Off 2 Programexample a Compare P0000 P000F and D0001 If their...

Page 135: ...ccording to the comparison operation result The comparison is executed as signed operation The comparison operation result is as shown below Instruction symbol in Condition Comparison operation result Instruction symbol in Condition Comparison operation result S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 On S1 S2 Off 2 Programexample a Compare P0000 P000F and D0001 If their va...

Page 136: ... P Performs the addition of 1 to the device 16 bits data specified at D DINC P Performs the addition of 1 to the device 32 bits data D 1 D If the INC P or DINC P is executed when the content of device is hFFFF or hFFFFFFFF the content of device will be 0 At the same time the zero flag F111 and the carry flag F112 are set If the device specified by D is out of the range the operation error occurs a...

Page 137: ...rising edge is detected at P030 the content of P06 word will be increased by 1 Inputcondition INC DINC INCP DINCP Executed only once Executed only once Executed per scan Executed per scan P030 INCP P006 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 P006 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 h00C6 1 h00C7 P006 ...

Page 138: ...1 to the device 16 bits data specified at D DDEC P Performs the subtraction of 1 to the device 32 bits data D 1 D If the DEC P or DDEC P is executed when the content of device is 0 the content of device will be hFFFF or hFFFFFFFF and the carry flag F112 is set The zero flag will be set when the content of device is 0 If the device specified by D is out of the range the operation error occurs and t...

Page 139: ...rising edge is detected at P020 the content of M06 word will be decreased by 1 Inputcondition DEC DDEC DECP DDECP Executed only once Executed only once Executed per scan Executed per scan P020 DECP M006 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 M006 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 h00C6 1 h00C5 M006 ...

Page 140: ...ailable only when do not use computer link module or data link module 1 Functions ROL P Rotates 16 bits of the device specified at D in left direction The M SB will be transferred to the LSB and carry flag F112 DROL P Rotates 32 bits of the device specified as D 1 D in left direction The MSB of D 1 will be transferred to the LSB of D and carry flag Operand setting ROL ROLP DROL DROLP D D The devic...

Page 141: ...otated with left direction 16 bits 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 Rotate left 0 0 Carry flag Carry flag MSB MSB LSB LSB 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 Rotate left 1 Carry flag MSB LSB Inputcondition ROL DROL ROLP DROLP Executed only once Executed only once Executed per scan Executed per scan ROLP D0000 P030 D0000 h78D3 ...

Page 142: ...when do not use computer link module or data link module 1 Functions ROR P Rotates 16 bits of the device specified at D in right direction The LSB will be transferred to the MSB and carry flag F112 DROR P Rotates 32 bits of the device specified as D 1 D in right direction The LSB of D will be transferred to the MSB of D 1 and carry flag Operand setting ROR RORP DROR DRORP D D The device to be rota...

Page 143: ...ated with right direction 16 bits 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 Rotate right 0 0 Carry flag Carry flag MSB MSB LSB LSB 1 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 Rotate right 1 Carry flag MSB LSB Inputcondition ROR DROR RORP DRORP Executed only once Executed only once Executed per scan Executed per scan RORP D0000 P030 D0000 h78D2 ...

Page 144: ...dule 1 Functions RCL P Rotates 16 bits of the device specified at D and carry flag F112 in left direction The MSB will be transferred to the carry flag F112 and the carry flag will be transferred to the LSB DRCL P Rotates 32 bits of the device specified as D 1 D and carry flag in left direction The MSB of D 1 will be transferred to the carry flag F112 and the carry flag will be transferred to the ...

Page 145: ...ll be rotated with left direction 16 bits 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 Rotate left 0 0 Carry flag Carry flag MSB MSB LSB LSB 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 Rotate left 1 Carry flag MSB LSB Inputcondition ROL DROL ROLP DROLP Executed only once Executed only once Executed per scan Executed per scan RCLP D0000 P030 D0000 h78D3 ...

Page 146: ...dule 1 Functions RCR P Rotates 16 bits of the device specified at D and the carry flag in right direction The LSB will be transferred to the carry flag F112 and the carry flag will be transferred to the MSB DRCR P Rotates 32 bits of the device specified as D 1 D and the carry flag in right direction The LSB of D will be transferred to the carry flag and the carry flag will be transferred to the MS...

Page 147: ...l be rotated with right direction 16 bits 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 Rotate right 0 0 Carry flag Carry flag MSB MSB LSB LSB 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 Rotate right 1 Carry flag MSB LSB Inputcondition RCR DRCR RCRP DRCRP Executed only once Executed only once Executed per scan Executed per scan RCRP D0000 P030 D0000 h78D2 ...

Page 148: ...ck specified as S1 S2 by 1 bit The direction of shift is from S1 to S2 Therefore if S1 is lower than S2 the block is shifted in left direction Otherwise the block is shifted in right direction Operand setting S1 The start bit of block to be shifted S2 BSFT S1 S2 BSFTP S1 S2 S1 S2 The end bit of block to be shifted n bits 0 0 1 1 1 0 0 0 1 1 0 1 0 0 1 0 S2 S1 0 0 1 1 1 0 0 0 1 1 0 1 0 0 1 0 S2 S1 0...

Page 149: ... second clock flag F093 is used for input condition P040 is set as 1 when the P031 is on Inputcondition BSFT BSFTP Executed only once Executed only once Executed per scan Executed per scan BSFT P040 P045 F093 P031 SET P040 0 0 1 1 1 0 0 0 1 P045 0 0 1 1 1 0 0 1 0 is entered while P031 is off and 1 is entered while P031 is on Erased P044 P043 P042 P041 P040 P03F P046 ...

Page 150: ... module 1 Functions Shifts the block specified as S1 S2 by 1 word The direction of shift is from S1 to S2 Therefore if S1 is lower than S2 the block is shifted in left direction Otherwise the block is shifted in right direction Operand setting The start word of block to be shifted WSFT S1 S2 WSFTP S1 S2 S1 S2 The end word of block to be shifted n words S2 S1 h0000 is entered Erased When S1 is lowe...

Page 151: ...3 is used for input condition D0040 is set as h1234 when the P031 is on Inputcondition WSFT WSFTP Executed only once Executedonlyonce Executed per scan Executed per scan WSFT D0040 D0043 F093 P031 MOV h1234 D0040 h4F29 h5849 hF0B4 h7802 hA006 D0043 h0000 is entered while P031 is off and h1234 is entered while P031 is on Erased D0042 D0041 D0040 D0044 h9201 D0039 h4F29 hF0B4 h7802 hA006 h9201 ...

Page 152: ...ed when the input data is off and 1 is entered when the input data is on The start bit of shift operation is various according to the direction of shift operation left direction shift LSB right direction shift MSB The shift direction indicates the direction of shift operation If the shift direction is off it means a left direction shift Otherwise it means a right direction shift When the reset sig...

Page 153: ... when M000A 0 and M000B 0 P001 Fill with 0 Left direction shift F E D C B A 9 8 7 6 5 4 3 2 1 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 1 0 b After 2 clocks when M000A 1 and M000B 0 P001 F E D C B A 9 8 7 6 5 4 3 2 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 1 0 Fill with 1 Left direction shift c After 3 clocks when M000A 0 and M000B 1 P001 F E D C B A 9 8 7 6 5 4 3 2 1 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 Fill with 0 Right...

Page 154: ... O O O O O 5 O Available only when do not use computer link module or data link module 1 Functions XCHG P Exchanges 16 bits contents of two devices specified at D1 and D2 DXCHG P Exchanges 32 bits contents of two devices specified as D1 1 D1 and D2 1 D 2 Operand setting Two words that their contents are exchanged each other XCHG D1 D2 XCHGP D1 D2 D1 D2 D1 D2 DXCHG DXCHGP h5849 hF0B4 hA006 D1 1 D1 ...

Page 155: ...on 2 Programexample While P020 is on exchange contents of P04 and P05 words each other Inputcondition XCHG DXCHG XCHGP DXCHGP Executed only once Executed only once Executed per scan Executed per scan XCHGP P04 P05 P020 h5849 hF0B4 P05 P04 hF0B4 h5849 P05 P04 ...

Page 156: ...of 16 bits BIN data specified at S1 and S2 The addition result is stored at the device specified at D DADD P Performs the addition of 32 bits BIN data specified at S1 1 S1 and S2 1 S2 The addition result is stored at the device specified at D1 1 D1 When the addition result is over hFFFF ADD ADDP or hFFFFFFFF DADD DADDP the carry flag F112 is set When the addition result is 0 the zero flag is set I...

Page 157: ... of D0000 and D0001 and store the addition result to P06 word Inputcondition ADD DADD ADDP DAD DP Executed only once Executed only once Executed per scan Executed per scan ADDP D0000 D0001 P06 16 bits 0 0 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 h38D3 h120C 0 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 h4ADF D0000 D0001 P06 ...

Page 158: ...ified at S1 and S2 The subtraction result is stored at the device specified at D DSUB P Performs the subtraction of 32 bits BIN data specified at S1 1 S1 and S2 1 S2 The subtraction result is stored at the device specified at D1 1 D1 When the minuend is less than subtrahend the LSB will underflow and the carry flag F112 will be set When the subtraction result is 0 the zero flag is set If indirect ...

Page 159: ...s of D0000 and D0001 and store the addition result to P06 word Inputcondition SUB DSUB SUBP DSUBP Executed only once Executedonlyonce Executed per scan Executed per scan 16 bits 0 0 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 h38D3 h120C 0 0 1 0 0 1 1 0 1 1 0 0 0 1 1 1 h26C7 D0000 D0001 P06 SUBP D0000 D0001 P06 P020 ...

Page 160: ...ltiplication result into the device specified as D 1 D DMUL P Performs the multiplication of BIN data specified as S1 1 S and the BIN data specified as S2 1 S2 and stores the multiplication result into the device specified as D 3 D 2 D 1 D If the multiplication result is zero the zero flag will be set If indirect address specified by D format is out of device range the operation error occurs and t...

Page 161: ...11 while P020 is on Program which stores the multiplication result of D0001 D0002 and D0003 D0004 at D0010 D0013 when P020 is switched on MUL D0001 D0002 D0010 P020 h1234 h5678 h6260 D0001 h0060 D0002 D0011 D0010 DMULP D0001 D0003 D0010 h1234 h5678 h4321 D0001 h8765 D0002 D0003 D0004 h04C6 h1501 D0013 D0012 h55B7 h6558 D0011 D0010 P020 ...

Page 162: ...tion result into the device specified as D 1 D DMULS P Performs the multiplication of signed BIN data specified as S1 1 S and the signed BIN data specified as S2 1 S2 and stores the multiplication result into the device specified as D 3 D 2 D 1 D If the multiplication result is zero the zero flag will be set If indirect address specified by D format is out of device range the operation error occur...

Page 163: ... of D0001 D0002 and D0003 D0004 at D0010 D0013 when P020 is switched on Inputcondition MULS DMULS MULSP DMULSP Executed only once Executed only once Executed per scan Executed per scan MULS D0001 D0002 D0010 P020 h04D2 hE9D2 hFF95 D0001 h1644 D0002 D0011 D0010 DMULSP D0001 D0003 D0010 hFDCD hDCE8 hCC78 D0001 h4AAA D0002 D0003 D0004 h0071 h26FC D0013 D0012 h794F hC210 D0011 D0010 P020 7006652 1234 ...

Page 164: ...stored at D and the remainder is stored at D 1 DDIV P Performs the division of BIN data specified as S1 1 S and the BIN data specified as S2 1 S2 and stores the division result into the device specified as D 3 D 2 D 1 D The quotient is stored at D 1 D and the remainder is stored at D 3 D 2 If the quotient is zero the zero flag will be set If indirect address specified by D format is out of device ...

Page 165: ... Program which stores the division result of D0001 D0002 and D0003 D0004 at D0010 D0013 when P020 is switched on DIV D0001 D0002 D0010 P020 h78AB h0678 h017D D0001 h002D D0002 D0011 D0010 DDIVP D0001 D0003 D0010 hF904 h5678 h0021 D0001 h8765 D0002 D0003 D0004 h0009 hED77 D0013 D0012 h0000 h076D D0011 D0010 P020 Remainder Quotient Remainder Quotient ...

Page 166: ...d at D 1 DDIVS P Performs the division of the signed BIN data specified as S1 1 S and the signed BIN data specified as S2 1 S2 and stores the division result into the device specified as D 3 D 2 D 1 D The quotient is stored at D 1 D and the remainder is stored at D 3 D 2 If the quotient is zero the zero flag will be set If indirect address specified by D format is out of device range or the conten...

Page 167: ...4 at D0010 D0013 when P020 is switched on Inputcondition DIVS DDIVS DIVSP DDIVSP Executed only once Executed only once Executed per scan Executed per scan DIVS D0001 D0002 D0010 P020 h78AB hC678 h059B D0001 hFFFE D0002 D0011 D0010 DDIVSP D0001 D0003 D0010 hF904 h5678 h0021 D0001 h8765 D0002 D0003 D0004 hFFF5 h5E61 D0013 D0012 hFFFF hFFCB D0011 D0010 P020 Remainder Quotient Remainder Quotient 11715...

Page 168: ...ed at S1 and S2 The addition result is stored at the device specified at D DADDB P Performs the addition of 32 bits BIN data specified at S1 1 S1 and S2 1 S2 The addition result is stored at the device specified at D1 1 D1 When the addition result is over h9999 ADD ADDP or h99999999 DADD DADDP the carry flag F112 is set When the addition result is 0 the zero flag is set If indirect address specifi...

Page 169: ...D0000 and D0001 and store the addition result to P06 word Inputcondition ADDB DADDB ADDBP DADDBP Executed only once Executed only once Executed per scan Executed per scan ADDP D0000 D0001 P06 16 bits 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 h3893 h1204 0 1 0 1 0 0 0 0 1 0 0 1 0 1 1 1 h5097 D0000 D0001 P06 P020 ...

Page 170: ...raction result is stored at the device specified at D DSUBB P Performs the subtraction of 32 bits BCD data specified at S1 1 S1 and S2 1 S2 The subtraction result is stored at the device specified at D1 1 D1 When the minuend is less than subtrahend the LSB will underflow and the carry flag F112 will be set When the subtraction result is 0 the zero flag is set If indirect address specified by D for...

Page 171: ...f D0000 and D0001 and store the addition result to P06 word Inputcondition SUBB DSUBB SUBBP DSUBBP Executed only once Executed only once Executed per scan Executed per scan SUBB D0000 D0001 P06 P020 16 bits 0 0 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 h3803 h1209 0 0 1 0 0 1 1 0 1 1 0 0 0 1 1 1 h2594 D0000 D0001 P06 ...

Page 172: ...device specified as D 1 D DMULB P Performs the multiplication of BCD data specified as S1 1 S and the BCD data specified as S2 1 S2 and stores the multiplication result into the device specified as D 3 D 2 D 1 D If the multiplication result is zero the zero flag will be set If indirect address specified by D format is out of device range or contents of S1 and S2 is invalid BCD format out of 0 9 th...

Page 173: ...1 while P020 is on Program which stores the multiplication result of D0001 D0002 and D0003 D0004 at D0010 D0013 when P020 is switched on MULB D0001 D0002 D0010 P020 h1234 h5678 h0700 D0001 h6652 D0002 D0011 D0010 DMULBP D0001 D0003 D0010 h1234 h5678 h4321 D0001 h8765 D0002 D0003 D0004 h0533 h5649 D0013 D0012 h5624 h7670 D0011 D0010 P020 ...

Page 174: ...cified as D 1 D The quotient is stored at D and the remainder is stored at D 1 DDIVB P Performs the multiplication of BCD data specified as S1 1 S and the BCD data specified as S2 1 S2 and stores the multiplication result into the device specified as D 3 D 2 D 1 D The quotient is stored at D 1 D and the remainder is stored at D 3 D 2 If the quotient is zero the zero flag will be set If indirect ad...

Page 175: ...001 D0002 and D0003 D0004 at D0010 D0013 when P020 is switched on Inputcondition DIVB DDIVB DIVBP DDIVBP Executed only once Executed only once Executed per scan Executed per scan DIVB D0001 D0002 D0010 P020 h7806 h0078 h0006 D0001 h0100 D0002 D0011 D0010 DDIVBP D0001 D0003 D0010 h3904 h5678 h0001 D0001 h0765 D0002 D0003 D0004 h0000 h1023 D0013 D0012 h0000 h3627 D0011 D0010 P020 Remainder Quotient ...

Page 176: ...2 per bit Then stores the result of logical production into the device specified at D DWAND P Performs the logical product of the 32 bit data of device specified as S1 1 S1 and S2 1 S2 per bit and stores the result into the device specified at D 1 D If the result of logical product is 0 the zero flag F111 is set If the indirect addr ess specified by D format is out of device range the operation er...

Page 177: ...5 words then stores the result to the P06 word when the P020 is switched on Inputcondition WAND DWAND WANDP DWANDP Executed only once Executed only once Executed per scan Executed per scan WANDP P04 P05 P06 P020 16 bits 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 1 0 1 AND h3AD3 h224D 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 h2241 h3AD3 P05 P06 P04 ...

Page 178: ...he result of logical addition into the device specified at D DWOR P Performs the logical addition of the 32 bit data of device specified as S1 1 S1 and S2 1 S2 per bit and stores the result into the device specified at D 1 D If the result of logical addition is 0 the zero flag F111 is set If the indirect address spec ified by D format is out of device range the operation error occurs and the error...

Page 179: ...d P05 words then stores the result to the P06 word when the P020 is switched on Inputcondition WOR DWOR WORP DWORP Executed only once Executed only once Executed per scan Executed per scan WORP P04 P05 P06 P020 16 bits 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 1 0 1 WOR h3AD3 h224D 0 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 h3ADF P05 P06 P04 ...

Page 180: ... Then stores the result of logical production into the device specified at D DWXOR P Performs the exclusive OR of the 32 bit data of device specified as S1 1 S1 and S2 1 S2 per bit and stores the result into the device specified at D 1 D If the result of exclusive OR is 0 the zero flag F111 is set If the indirect address specified by D format is out of device range the operation error occurs and t...

Page 181: ...then stores the result to the P06 word when the P020 is switched on Inputcondition WXOR DWXOR WXORP DWXORP Executed only once Executed only once Executed per scan Executed per scan WXORP P04 h2345 P06 P020 16 bits 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 WXOR h3AD3 h2345 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 h1996 h3AD3 P06 P04 h2345 ...

Page 182: ...Then stores the result of logical production into the device specified at D DWXNR P Performs the exclusive NOR of the 32 bit data of device specified as S1 1 S1 and S2 1 S2 per bit and stores the result into the device specified at D 1 D If the result of exclusive NOR is 0 the zero flag F111 is set If the indirect address specified by D format is out of device range the operation error occurs and ...

Page 183: ...then stores the result to the P06 word when the P020 is switched on Inputcondition WXNR DWXNR WXNRP DWXNRP Executed only once Executed only once Executed per scan Executed per scan WXNRP P04 h2345 P06 P020 16 bits 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 WXOR h3AD3 h2345 1 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 hE669 h3AD3 P06 P04 h2345 ...

Page 184: ...ta link module 1 Functions The format of Cw a s The start bit of S b d The start bit of D c x Don t care d x Numbers of decoded nibbles range 0 F Decodes the data of z 4 bits block that start from the s th bit of device specified at S into 7 segment display data and stores the result to the z 8 bits block that starts from the s th bit of device D Operand setting SEG SEGP S D S D The device at whic...

Page 185: ...om the bit 3 of P06 when P030 is switched on Inputcondition SEG SEGP Executed only once Executed only once Executed per scan Executed per scan SEGP D0000 P06 h2302 P030 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 0 h3AD3 h3AD3 P04 0 1 1 D C F E 9 8 B A 5 4 7 6 1 0 3 2 D C F E 9 8 B A 5 4 7 6 1 0 3 2 1 0 3 2 P07 P06 hB h4 h7C h66 Start from bit 2 of D0000 Start from bit 3 of P06 P063 ...

Page 186: ... 1 0 1 2 0010 0 1 0 1 1 0 1 1 2 3 0011 0 1 0 0 1 1 1 1 3 4 0100 0 1 1 0 0 1 1 0 4 5 0101 0 1 1 0 1 1 0 1 5 6 0110 0 1 1 1 1 1 0 1 6 7 0111 0 0 1 0 0 1 1 1 7 8 1000 0 1 1 1 1 1 1 1 8 9 1001 0 1 1 0 1 1 1 1 9 A 1010 0 1 1 1 0 1 1 1 A B 1011 0 1 1 1 1 1 0 0 B C 1100 0 0 1 1 1 0 0 1 C D 1101 0 1 0 1 1 1 1 0 D E 1110 0 1 1 1 1 0 0 1 E F 1 1 1 1 0 1 1 1 0 0 0 1 F b0 b6 b5 b1 b4 b2 b3 D S ...

Page 187: ...nk module 1 Functions The format of Cw e s The start bit of S f d The start bit of D g x Don t care h x Numbers of decoded nibbles range 0 F Converts the data of z 4 bits block that start from the s th bit of device specified at S into ASCII code and stores the result to the z 8 bits block that starts from the sth bit of device D Operand setting ASC ASCP S D S D The device at which source data is ...

Page 188: ...ts from the bit 1 of P06 while P030 is on Inputcondition ASC ASCP Executed only once Executed only once Executed per scan Executed per scan ASC D0010 P06 h2102 P030 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 1 0 0 0 1 1 0 1 0 0 D0010 D C F E 9 8 B A 5 4 7 6 1 0 3 2 D C F E 9 8 B A 5 4 7 6 1 0 3 2 P06 hB h4 h42 h34 Start from bit 2 of D0000 Start from bit 1 of P06 P061 0 0 1 0 2 P07 ...

Page 189: ... stores the result into the device specified as D in hexadecimal format DBSUM P Counts the numbers of 1 in the device specified as S 1 S then stores the result into the device specified as D in hexadecimal format If the count result is 0 the zero flag is set If the indirect address specified by D format is out of device range the operation error occurs and the error flag F110 is set Execution cond...

Page 190: ...ult into D0030 when M020 is switched on DBSUMP P020 D0030 M020 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 P020 D C F E 9 8 B A 5 4 7 6 1 0 3 2 1 0 1 0 0 0 0 1 1 0 1 1 0 1 1 0 P021 D C F E 9 8 B A 5 4 7 6 1 0 3 2 The numbers of 1 9 The numbers of 1 8 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 D0030 D C F E 9 8 B A 5 4 7 6 1 0 3 2 Totalnum bers of 1 17 h0011 ...

Page 191: ...an be s pecified If the value of n is out of this range no processing is performed and the contents of D is not changed When multiple bits are 1 processing is performed for the most significant bit If the value of n is 0 the zero flag F111 will be set When the value of n is larger than 4 the source data area is expanded like S 1 S 2 When n 8 the length of source data is 256 bits S 15 S 14 S 1 S Ex...

Page 192: ...ogram that encode the current value of counter C000 and stores the encoding result at the P05 word The counter C000 is increased at every 1 sec ENCOP P02 P06 3 P020 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 P02 D C F E 9 8 B A 5 4 7 6 1 0 3 2 The highest position 1 is bit 7 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 P06 D C F E 9 8 B A 5 4 7 6 1 0 3 2 Encoding result h0007 When n 3 8 2 n bits are effective ...

Page 193: ...the bit 0 of the device specified as D For n 1 8 can be specified If the value of n is 0 no processing is performed and the contents of D is not changed If the value of n is over 8 the error flag F110 is set and no processing is performed When the value of n is larger than 4 the source data area is expanded like D 1 D 2 When n 8 the length of decoding result data is 256 bits D 15 D 14 D 1 D Execut...

Page 194: ...ult to P05 and P06 word The current value of counter is increased at every 1 second and when the current value reaches to 31 the counter C000 is reset DECOP P02 P05 4 P030 F093 U CTR C000 R S 00031 C000 DECO C000 P05 5 F010 END 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 P05 D C F E 9 8 B A 5 4 7 6 1 0 3 2 Decoding result h0009 When n 4 16 2 4 bits are effective The value of last 4 bit of P02 h9 0 0 0 0 1 0 0...

Page 195: ...dule or data link module 1 Functions FILR P Transfers the content of S n word to the device specified as D DFILR P Transfers the contents of S n 1 S n to the device specified as D 1 D When the S n is over the range of corresponding device area the error flag is set and no processing is performed Operand setting FILR DFILRP S D S D The origin address of the source data word The destination word at ...

Page 196: ...01 word when P020 is switched on The n is stored at D0010 word Inputcondition FILR DFILR FILRP DFILRP Executed only once Executed only once Executed per scan Executed per scan FILRP M03 M01 D0010 P020 h5030 h6030 M002 M000 M001 when n 3 M003 M004 M005 M006 M007 h6030 h5030 h6030 M002 M000 M001 when n 4 M003 M004 M005 M006 M007 h5030 ...

Page 197: ...dule or data link module 1 Functions FILW P Transfers the content of S word to the device specified as D n DFILW P Transfers the contents of S 1 S to the device specified as D n 1 D n When the D n is over the range of corresponding device area the error flag is set and no processing is performed Operand setting FILW DFILWP S D S D The origin address of the destination The source data or device at ...

Page 198: ... to M03 n word when P020 is switched on The n is stored at D0010 word Inputcondition FILW DFILW FILWP DFILWP Executed only once Executed only once Executed per scan Executed per scan FILWP M03 M01 D0010 P020 h6030 M002 M000 M001 when n 3 M003 M004 M005 M006 M007 h6030 h6030 M002 M000 M001 when n 4 M003 M004 M005 M006 M007 h6030 ...

Page 199: ...device specified as S into the lower 4 bits of the block specified as D n 1 D The higher 12 bits bit 4 bit F of the block specified as D n 1 D arecleared as 0 When n 0 no processing is performed When n 4 the error flag is set and no processing is performed Operand setting DIS S D S D The source device The start address of destination devices D D S S n n The number of nibble to be dissociated 1 4 n...

Page 200: ... P02 word to lower 4 bits of D0000 D0003 when P030 is switched on Inputcondition DIS DISP Executed only once Executed only once Executed per scan Executed per scan DISP P02 D0000 3 P030 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 D C F E 9 8 B A 5 4 7 6 1 0 3 2 0000 0000 0000 0001 0000 0000 0000 0010 0000 0000 0000 0011 D0000 D0001 D0002 P02 F 4 0 3 ...

Page 201: ...f the block specified as S n 1 S into the lower n nibbles of the device specified as D The higher bits bit 2n bit F of the device specified as D are cleared as 0 When n 0 no processing is performed When n 4 the error flag is set and no processing is performed Operand setting UNI S D S D The destination device The start address of source devices D D S S n n The number of nibble to be associated 1 4...

Page 202: ...00 D0003 to lower 3 nibbles of P02 word when P030 is switched on Inputcondition UNI UNIP Executed only once Executed only once Executed per scan Executed per scan UNIP D0000 P06 3 P030 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 D C F E 9 8 B A 5 4 7 6 1 0 3 2 0000 0000 0000 0001 0000 0000 0000 0010 0000 0000 0000 0011 D0001 D0002 F 4 0 3 D0000 P06 ...

Page 203: ...ld be lower word than D2 If the D1 is higher than D2 the error flag is set and no processing is performed This instruction is useful when read latest input data or output the data of P area to external device immediately in a sequence program that has a long scan time Execution conditions Operand setting The first word of the block to be refreshed D1 D2 D1 D2 D1 D2 D1 D2 IORF IORFP The last word o...

Page 204: ...During FOR NEXT loop execution the P060 is keep the initial status but the P061 is switched on off according to the status change of the P020 P060 P020 FOR 10000 WDT F010 IORF P02 P02 F010 P020 P061 IORF P06 P06 F010 NEXT END FOR NEXT loop Repeats 10000 times ...

Page 205: ... number specified as n to the F14 word F140 F14F and set the FALS flag F038 Once the F14 is set by a FALS instruction it keeps the value until it is cleared by executing FALS 0000 instruction Even if other FALS instruction is executed the value of F14 word is not changed Execution condition 2 Program example Operand setting The error code to be stored at the F area n FALS n n Inputcondition FALS E...

Page 206: ...n at the scan count specified as n1 and to OFF at the scan count specified as n2 At the initial status when the timing pulse is off the timing pulse is off When n1 0 the timing pulse is always off When n1 0 and n2 0 the timing pulse is always on Operand setting The contact of F device to which a pulse is output n1 DUTY n1 n2 D n2 D D Number of scans during which the pulse is on Number of scans dur...

Page 207: ...amexample Program that generates a timing pulse of 250 scans on and 300 scans off and output it to F100 contact when P030 switched on When P031 is switched on the timing pulse is stopped DUTY 0 1 D Scan during which timing pulse is off Scan during which timing pulse is on Be sure to set to 0 The F device which stops timing pulse F100 F107 DUTY F100 250 300 P030 P061 F100 DUTY F100 0 1 P031 P030 Ti...

Page 208: ...ons If the scan time exceeds the set value of watch dog timer at every scan change the set value of watch dog timer by the parameter setting Set the set value of the watch dog timer so that t1 from step 0 to WDT P instruction and t2 from the WDT P to END instruction do not exceed the set value See the diagram below The WDT P instruction can be user two or more times during one scan However please ...

Page 209: ...a long scan time because of FOR NEXT loop Inputcondition WDT WDTP Executed only once Executed only once Executedperscan Executed per scan FOR 50000 WDT P060 NEXT END P020 P02F When P020 is on the current value of WDT is reset and no WDT error occurs Otherwise a WDT error occurs and program is stopped ...

Page 210: ...evice and turn on the OUTOFF flag F113 when an input condition is turns on However the P device is updated according to the operation result When the input condition switched off the CPU restarts to output operation result of P area to external devices Useful for test operation of a PLC system Execution conditions 2 Programexample Program that stop to output to external devices while P020 is on OU...

Page 211: ...11 Carry F112 STOP 1 1 Functions When an input condition is switched on stops execution of sequence program and change mode to STOP mode after finishing the current scan To resume the operation of CPU after the execution of STOP instruction change the mode of CPU to the STOP mode and move it to the RUN mode again by loader or mode switch 2 Programexample Program that stops operation when P021 turn...

Page 212: ...ME n are not executed The JMP n instruction should be matched only one JME n instruction The duplication of JME n is not permitted However the duplication of JMP n instruction is possible A JMP n instruction without corresponding JME n instruction stand alone JMP n will cause program error If only a JME or JMP is inside of a loop subroutine FOR NEXT or interrupt routine anoperation error will occu...

Page 213: ...1 Execution conditions 2 Programexample Program that skips the ring counter operation between JMP 2 and JME 2 when P020 is on JMP 02 U CTU C002 R s 00100 P030 P031 P060 C002 P020 JME 02 Inputcondition JMP Executed per scan Executed per scan ...

Page 214: ...finishing execution of subroutine resume to execute sequence program from the next step of CALL n instruction Multiple levels of nesting of the CALL P instruction are allowed as much as 64 The range of pointer n is various according to the type ofCPU See the above picture If a CALL P n instruction has no corresponding SBRT instruction that has same pointer n with the CALL P n instruction an instru...

Page 215: ...Chapter 5 Application instructions 5 103 2 Programexample P050 P020 P051 P021 P022 CALL 0003 P02F END SBRT 0003 INCP D0000 F092 MOV D0000 P06 F010 RET ...

Page 216: ... 32767 If the value of n is out of range an instruction error occurs Up to five levels of the nesting of FOR is allowed In the following cases operation error occurs a After the execution of FOR instruction the END instruction has been executed before the NEXT instruction is executed b The NEXT instruction has been executed before the FOR instruction is executed c The number of the FOR instruction...

Page 217: ...Steps Error F110 Zero F111 Carry F112 BREAK 3 1 Function When the input condition is on exits immediately from the current FOR NEXT loop and go to the next step of the NEXT instruction Execution condition 2 Programexample BREAK Inputcondition BREAK Executed per scan Executed per scan M0006 FOR 5 M0000 BREAK FOR 4 NEXT NEXT When M000 turns on exits immediately from FOR NEXT loop and go to the step ...

Page 218: ... F110 Zero F111 Carry F112 STC CLC 1 O 1 Functions STC Turns the carry flag F112 on when the input condition is switched on CLC Turns the carry flag F112 off when the input condition is switched on Execution conditions 2 Programexample Program that set the carry flag F112 when M0000 is on Program that reset the carry flag F112 when M0001 is on STC CLC Inputcondition STC CLC Executed per scan Execu...

Page 219: ...L F T C S D D Integer Steps Error F110 Zero F111 Carry F112 CLE 1 1 Functions Reset the latched error flag F115 when the input condition turns on See the 2 8 2 for detail information of F115 flag Execution condition 2 Programexample Program that resets the latched error flag F115 when M0000 turns on CLE Inputcondition STC CLC Executed per scan Executed per scan CLE M0000 ...

Page 220: ...se computer link module or data link module 1 Functions Reads the data of n2 words which start at the address specified as S of buffer memory inside the special module specified at sl and stores the data into devices which begin with the device specified at D D sl n2 S GET sl S D n2 S n2 words The buffer memory of the special function module at the slot sl D n2 words CPU module Operand setting Slo...

Page 221: ...from the address 0 of buffer memory of A D module and stores them to the 4 words from D0010 of CPU module Inputcondition GET GETP Executed only once Executed only once Executed per scan Executed per scan Power supply module CPU module 16 points input module 32 points input module 4 channel A D module 2 channel D A module slot 0 slot 1 slot 2 slot 3 GET h0002 h0000 D0010 h0004 h0F0F hE246 h1122 h44...

Page 222: ...ink module 1 Functions Writes the data of n2 words which start at the address specified as S of CPU and transfer the data into the block starting at the address specified as S of buffer memory inside the special function module mounted at the slot specified as sl D sl n2 S PUT sl S D n2 S n2 words The buffer memory of the special function module mounted at slot sl D n2 words CPU module Operand set...

Page 223: ...from D0010 of CPU module and stores them to the 4 words from the address 0 of buffer memory of D A module Inputcondition PUT PUTP Executed only once Executed only once Executed per scan Executed per scan Power supply module CPU module 16 points input module 32 points input module 4 channel A D module 2 channel D A module slot 0 slot 1 slot 2 slot 3 GET h0003 h0000 D0010 h0004 h0F0F hE246 h1122 h44...

Page 224: ...ads n2 words which begin with the address S of the remote station that has station number St through the FUEA module mounted at the slot sl and store the read data to the block which begin with the address D of the master station The link status is stored at the address SS of the master station READ St S D n2 Operand setting Slot number of FUEA module is mounted Station number of remote station to...

Page 225: ...ough the FUEA module of slot number 2 and store the read data to the block which begin with D0300 The link status is stored at the M020 word Inputcondition READ Executed only once Executed only once S n2 words Remote station FUEA module Station No St D n2 words Self station FUEA module Slot No n1 Link status SS READ h0002 h001D D0300 D0200 h0020 M020 D0200 20 words Remote station FUEA module Stati...

Page 226: ...t 0 slot 1 slot 2 slot 3 Power supply module CPU module 16 points input module 32 points input module 4 channel A D module FUEA module Station No h2F slot 0 slot 1 slot 2 slot 3 Power supply module CPU module 16 points input module 32 points input module FUEA module Station No h01 FUEA module Station No h02 slot 0 slot 1 slot 2 slot 3 Self station System configuration ...

Page 227: ... begin with the address S and write the read data to the block which begin with the address D of the remote station that has a station number specified as St through the FUEA module mounted at the slot sl of self station The link status is stored at the address SS of the master station WRITE St S D n2 D sl n2 S St SS sl SS Operand setting Slot number of FUEA module is mounted Station number of rem...

Page 228: ...n No of FUEA module h2F through the FUEA module at slot number 3 of self station The link status is stored at the K015 word System configuration is same as the example of READ instruction Inputcondition WRITE Executed only once Executed only once D n2 words Remote station FUEA module Station No St S n2 words Self station FUEA module at slot No n1 Link status SS WRITE h0003 h002F D1234 D5678 h0014 ...

Page 229: ...ified as D Then stores the link status into the device specified as SS of self station D sl n2 S St SS RGET St S D n2 sl SS Operand setting Slot number of FUEA module is mounted Type of special function module to be read Station number of remote station to be read data Slot number of special function module Start address of self station at which read data is stored Start address of remote station ...

Page 230: ... h1D and stores the read data to the 10 words which begin with D0300 of self station The link status is stored at M020 word of self station n2 words Self station FUEA module at slot No sl Link status D SS S n2 words Remote station FUEA module Station No St Buffer memory of special function module Inputcondition RGET Executed only once Executed only once 10 words Self station FUEA module at slot No...

Page 231: ...3 Power supply module CPU module 16 points input module 32 points input module 4 channel A D module FUEA module Station No h2F slot 0 slot 1 slot 2 slot 3 Power supply module CPU module 16 points input module 32 points input module FUEA module Station No h01 FUEA module Station No h02 slot 0 slot 1 slot 2 slot 3 Self station System configuration Remote station 1 K1000S Remote station 2 K300S ...

Page 232: ...odule Then stores the link status into the device specified as SS of self station D sl n2 S St SS RPUT St S D n2 sl SS Operand setting Slot number of FUEA module is mounted Type of special function module to be read Station number of remote station to be read data Slot number of special function module Start address of self station at which source data is stored Start address of remote station at ...

Page 233: ... through the FUEA module at the slot 02 The link status is stored at M020 word of self station System conficuration is same as that of the example of RGET instruction p115 n2 words Self station FUEA module at slot No sl Link status S SS D n2 words Remote station FUEA module Station No St Buffer memory of special function module Inputcondition RPUT Executed only once Executed only once 15 words Sel...

Page 234: ...tores the information data to the block begin with the device specified as D The link status is stored into the device SS Execution conditions 2 Programexample Program that reads the information of remote station station number is stored at D0000 through the FUEA module of slot 07 and stores the data from D1234 The link status is stored into K015 word D sl St SS STATUS St D sl SS Operand setting S...

Page 235: ... PDI specified as n when input condition turns on If n is not specified all interrupts are enabled DI Disables the inturrupt TDI or PDI specified as n when input condition turns on If n is not specified all interrupts are disabled The n is assigned to each interrupt by parameter setting Execution conditions 2 Programexample Program that enable the interrupt 5 Program that disable all interrupts Op...

Page 236: ...utine Instructions between the TDINT n and the next IRET are executed only when the corresponding time driven interrupt occurs and is enabled by the EI instruction The interval of interrupt can be set as 60msec 60000msec unit 10msec with parameter setting The execution time of interrupt routine should be less than the interval of interrupt The TDINT n instruction has to be placed after the END ins...

Page 237: ... n and the next IRET are executed only when the corresponding time driven interrupt occurs and is enabled by the EI instruction To use process driven interrupts the interrupt module is required and general input module can not ube used for interrupt input However K200S can use general input module for interrupt input by parameter setting Refer 2 4 Parameter setting for details The INT n instructio...

Page 238: ...ses the sign of the 16 bits data of device specified as D and stores the result in the device specified as D DNEG P Reversees the sign of the 32 bits data of device specified as D 1 D and stores the result in the device specified as D 1 D Used to reverse the positive sign to the negative sign or vice versa Operand setting NEG NEGP DNEG DNEGP D D The device which stores the data to be inversed D D ...

Page 239: ...t an absolute value of D0000 when the value of D0000 is negative Input condition NEG DNEG NEGP DNEGP Executed only once Executed only once Executed per scan Executed per scan 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 23739 0 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 23739 D0000 D0000 NEG D0020 D0020 0000 M001A M001A ...

Page 240: ...n off status of the n th bit from the bit 0 of D and use the data as an operation result BLDN Start a NC contact Draw the on off status of the n th bit from the bit 0 of D and use the data as an operation result 2 Programexample Program that turns P01E on when the 5 th bit of the D0001 word is on Operand setting B BN D D The start address of source data D n n Offset from the bit 0 to the destinati...

Page 241: ...ation result BANDN A series connection of a NC contact Reads the on off status of the n th bit from the bit 0 of D and performs the AN D operation with previous result and use it as an new operation result 2 Programexample Program that turns on P001A and P001B according to the status of bit 1 and bit 8 of the D0003 word Operand setting B BN D D The start address of source data D n n Offset from th...

Page 242: ...he OR operation with previous result and use it as an new operation result BORN A parallel connection of a NC con tact Reads the on off status of the n th bit from the bit 0 of D and performs the OR operation with previous result and use it as an new operation result 2 Programexample Program that turns on P0010 and P0011 according to the on off status of bit 1 and bit 8 of the D0000 word Operand s...

Page 243: ...T C S D D Integer Steps Error F110 Zero F111 Carry F112 O O BOUT O 5 O 1 Function Outputs the current operation result to the the n th bit from the bit 0 of D 2 Programexample Program that turns on the bit 2 of D0001 when M0002 is on Operand setting BOUT D The start address of source data D n Offset from the bit 0 to the destination bit n n D BOUT D0001 7 M0002 ...

Page 244: ... of D is switched on The bit remains on state even if the input condition of BSET instruction is turned off It can be switched off by the BRST instruction BRST When the input condition of BRST instruction turns on the n th bit from the bit 0 of D is switched off 2 Programexample Program that set the bit 2 of D0001 when M0002 is on and reset the bit 2 of D0001 when M0003 is on Operand setting BSET ...

Page 245: ...ce Fnam The link status is stored at the device specified as SS The maximum size of data block to be sent is 256 bytes 2 Programexample Program that send 10 words from D1234 and frame name 8 words from D0000 to the Cnet module at slot 3 channel 0 RS232C The link status is stored at K015 word sl n S SS SND S n sl SS Operand setting Slot number of Cnet module is mounted Type of channel RS232C or RS4...

Page 246: ...s stored at the device specified as SS The maximum size of data block to be sent is 256 bytes 2 Programexample Program that receive 20 words and frame name from Cnet module at slot 5 channel 1 RS232C and stores them to the block which begin with D0200 and D0100 The link status is stored at K016 word sl n D SS RCV D n sl SS Operand setting Slot number of Cnet module is mounted Type of channel RS232...

Page 247: ...perates according to the parameter setting When the input condition is switched off the high speed counter is reset The HSCNT instruction can not be used with HSC instruction in a sequence program simultaneously The specification of high speed counter Items Contents Counting speed 1point Phase 1 phase Count speed 8kpps Count range 0 hFFFF 16 bits Level Max 20 level can be set up 0 19 Data Setting ...

Page 248: ...rent value reaches to setting value 0 F070 F077 is set reset according to the parameter setting and F15 is updated assetting value of step 1 c When the current value reaches to the setting value of last step step 5 at the this example F15 is updated as setting value of step 0 and current value F14 is cleared as 0 d If the input condition turns off current value and HSC output F070 F077 is cleared ...

Page 249: ...me or greater than SV the HSC output bit F070 turns on The current value can not be changed by user The current value is stored at F14 lower word and F15 higher word When the HSC instruction is used the high speed counter parameter setting is ignored Explanation of operands a EN High speed counter enable contact b U D operates as up counter when U D is 0 and down counter when U D is 1 c PR If the ...

Page 250: ...ctions 5 138 2 Programexample M1 HSC reset M2 U D input 0 up 1 down M3 Change current value as PV If the current value is same or greater than SV the F070 bit turns on HSC EN U D PR PV D010 SV 100 MOV 100 D010 M003 M001 M002 M003 ...

Page 251: ...pecified as S of slave station Station number st and stores the read data into the block which begin with the device specified as D of master station RECV instruction can be used with master station station number h1F only Execution condition Operand setting Station number of slave station to be read The start address of device of master station at which the received data is stored Start address o...

Page 252: ... that read 5 words from M010 of the slave station station number h1A and stores the data to D0000 D0004 of the master station while the M0000 turns on M0000 RECV h1A D0000 M010 h05 5 words Slave station M010 Station No h1A D0000 5 words Master station Station No h1F ...

Page 253: ...tion and stores the read data into the block which begin with the device specified as D of slave station Station number st SEND instruction can be used with master station station number h1F only Execution condition Operand setting Station number of slave station to which data to be written The start address of device of master station at which the source data is stored Start address of device of ...

Page 254: ... that send 5 words from D0010 of the master station and stores the data to M0000 M0004 of the slave station station number h0A while the M0000 turns on M0000 SEND h0A D0010 M000 h05 5 words Slave station M000 Station No h0A D0010 5 words Master station Station No h1F ...

Page 255: ...Appendix A 1 Memory configuration 1 A 2 Special relay 3 A 2 Instruction list 12 ...

Page 256: ...bit The P M L K F areas are bit memory devices However the bit memory device can be used as word device area The notation of bit memory device The memory structure ofbit memory device Assign the bit address 0 F Hexadecimal Assign the word address Decimal Assign the device P M L K F F E D C B A 9 8 7 6 5 4 3 2 1 0 000 001 002 003 nnn P002B ...

Page 257: ... of timer or counter If the T or C device is used as an operand of word instruction the current value word is effected by the instruction The setting value can not be changed by user A 1 3 Word memory device The D device used by word Therefore the D device can not be used as an operand of bit instruction such as LOAD OUT etc To control the D device by bit use special instructions such as BLD BAND ...

Page 258: ...r code lThe error code of time out error h20 l No error h000 F030 Serious error Set in case of internal ROM error 24V fail error F031 Light error Set in case of WDT error program error I O combination error missing END RET error F03A RTC data error flag Set when an error is detected in RTC data F040 F045 I O combination error Set in case of attachment detachment of I O unit During operation or imp...

Page 259: ...F11A Onsendingflag F11C Onreceivingflag F11E Receiv ecompletion Flag Theserelaysindicatethecommunicationstatus WhenDIN DOUTinstructionareused F11F Communication errorflag lDIN DOUT Setwhentime outerroroccurred lSEND RECV Setwhentime outerroroccursor NAKmassageisdetected F120 F121 F122 F123 F124 F125 Theserelaysaresetaccordingtotheresultof Compareinstructions CMP CMPP DCMP DCMPP F130 F135 I Ostatus...

Page 260: ...42 Analog Unit 1 Data of D A Output D243 Data of A D Ch 0 Input D244 Data of A D Ch 1 Input D245 Analog Unit 1 Data of D A Output D247 High Speed Counter Mode Set Area K30S A K60S A type Only D248 Time out Value of RS485 Communications O S V1 5 or later D249 D252 RTC User Write Data Area MK S Series Ver1 3 or Later Used when M310 Point is on Same format As L12 L15 D253 Current Scan Time D254 Minim...

Page 261: ...n run Turns on when the scan run is operated in the Debug mode F0023 Coincident junction value run Turns on when the coincident junction run is operated in the Debug mode F0024 Coincident word value run Turns on when the coincident word run is operated in the Debug mode F0025 to F002F Unused F0030 s_HEAVY_ER Fatalerror Turns on when a fatal error has occurred F0031 s_LIGHT_ER Ordinary error Turns ...

Page 262: ...0105 User clock 5 F0106 User clock 6 F0107 User clock 7 Turning On Off is repeated as many times as the scan specified by Duty instruction F0108 to F010f Unused F0110 _p_ERR Operation error flag Turns on when an operation error has occurred F0111 _p_ZERO Zero flag Turns on when the operation result is 0 F0112 _p_CARRY Carry flag Turns onwhen a carry occurs due to the operation F0113 _p_OUT_OFF All...

Page 263: ...me Stores the maximum scan time F0510 to F051F S_SCAN_MIN Minimum scan time Stores the minimum scan time F0520 to F052F S_SCAN_AVG Present scan time Stores the present scan time F0530 to F053F Clock data year month Clock data year month F0540 to F054F Clock data day hour Clock data day hour F0550 to F055F Clock data minute second Clock data minute second F0560 to F056F Clock data day of the week C...

Page 264: ... station connected to network has the token at least one time and sends a sending frame _CnLINF Word Dx510 Communications module system information Indicates operation state of communications module with a word _CnCRDER Bit Dx510 0 System error error 1 Indicates communications module hardware or system O S error _CnSVBSY Bit Dx510 1 Insufficient common RAM Insufficient 1 Indicates that service can...

Page 265: ...ormal run information This flag turns on when under the condition that _HSmRLINK is turned on communications of the stations and data blocks set in the parameter is under the following conditions 1 A station set in the parameter is not in the RUN mode or 2 A station set in the parameter has an error or 3 The communications of data blocks set in the parameter does not normally operate This flag tur...

Page 266: ...um Scan Time h0010 Word 2Byte _MONTHSTNO Mother Station No h0012 Word 2Byte _FSMVRCNT VariableRDCount h0014 Word 2Byte _FSMVWCNT Variable WR Count h0016 Word 2Byte _FSMHSTXCNT HS Link TX Count h0018 Word 2Byte _FSMHSRXCNT HS Link RX Count h001A Word 2Byte _ AC_Fail_CNT Power Fail Counter h001C Word 2Byte _IO_TYER_N Module Setting Error h0020 Word 2Byte _CNF_ER b0 CPU _ ER b1 IO _ TYER b2 _IO_DEER ...

Page 267: ...DDIVP DDIVS DDIVSP 13X ADDB ADDBP DADDB DADDBP SUBB SUBBP DSUBB DSUBBP 14X MULB MULBP DMULB DMULBP DIVB DIVP DDIVB DDIVBP 15X WAND WANDP DWAND DWAND WOR WORP DWIR DWORP RECV SEND 16X WXOR WXORP DWXOR DWXOR WXNR WXNRP DWXNR DWXNR RCV SND 17X BSUM BSUMP DBUSM DBUSMP SEG SEGP ENCO ENCOP DECO DECOP 18X BSUM FILRP DFILR DFILRP FILW FILWP DFILW DFILWP OR ORD 19X ASC ASCP UNI DSI DIS DISP OR ORD OR ORD 2...

Reviews: