MELSEC is registered trademark of Mitsubishi Electric Corporation. Other company and product names that appear in this manual are trademarks or registered trademarks of the respective company.
Introduction These specifications are the programming manual used when creating the sequence program for the EZMotion-NC E60/E68 with the onboard PLC development tool or PLC development software. The PLC (Programmable Logic Controller) is largely divided into the basic commands, function commands and exclusive commands, and ample command types are available. The commands can be used according to the purpose and application such as the PLC support function used when supporting the user PLCs.
Precautions for Safety Always read the specifications issued by the machine maker, this manual, related manuals and attached documents before installation, operation, programming, maintenance or inspection to ensure correct use. Understand this numerical controller, safety items and cautions before using the unit. This manual ranks the safety precautions into "DANGER", "WARNING" and "CAUTION".
CONTENTS 1. System Configuration .................................................................................... 1.1 System Configuration for PLC Development ............................................. 1.2 User PLC (Ladder) Development Procedure.............................................. 1 1 2 2. PLC Processing Program .............................................................................. 2.1 PLC Processing Program Level and Operation ......................................... 2.
7. Basic Commands (LD, LDI, AND, ANI, OR, ORI, ANB, ORB .....) ............................................... 41 8. Function Commands (=, >, <, +, –, *, /, BCD, BIN, MOV .....) ............................................................ 73 9. Exclusive Commands .................................................................................... 9.1 ATC Exclusive Command ......................................................................... 9.1.1 Outline of ATC Control ..............................
10. PLC Help Function......................................................................................... 10.1 Alarm Message Display............................................................................ 10.1.1 Interface ............................................................................................. 10.1.2 Screen Display ................................................................................... 10.1.3 Message Creation .........................................................
1. System Configuration 1. System Configuration 1.1 System Configuration for PLC Development The system configuration for PLC development is shown below. Setting and Display Setting and Display Unit Unit Ladder editing, ladder monitor and PLC RUN/STOP, etc. The ladder is developed using the setting and display unit. (Onboard development) A new development is possible with the personal computer.
1. System Configuration 1.2 User PLC (Ladder) Development Procedure The procedure for creating the user PLC, used to control the control target (machine) built into the control unit, is shown below.
2. PLC Processing Program 2. PLC Processing Program 2.1 PLC Processing Program Level and Operation Table 2.1-1 explains the contents of users PLC processing level and Fig. 2.1-1 shows the timing chart. Table 2.1-1 PLC processing level Program name Description (frequency, level, etc.) High-speed processing program This program starts periodically with a time interval of 7.1ms. This program has the highest level as a program that starts periodically.
3. Input/Output Signals 3. Input/Output Signals 3.1 Input/Output Signal Types and Processing The input/output signals handled in user PLC are as follows: (1) Input/output from/to controller (2) Input/output from/to operation board (Note 1) (3) Input/output from/to machine The user PLC does not directly input or output these signals from or to hardware or controller; it inputs or outputs the signals from or to input/output image memory.
3. Input/Output Signals Table 3.1-1 lists whether or not high-speed input/output, interrupt input and initial processing can be performed. Table 3.
3. Input/Output Signals 3.3 High-Speed Input/output Designation Method High-speed input/output is designated by setting the corresponding bit of the bit selection parameter as shown below. (1) High-speed input designation (2) High-speed output designation · · · · As listed above, one bit corresponds to two bytes (16 points). Input or output in which 1 is set in the table is not performed at the main processing program level.
3. Input/Output Signals 3.4 Limits for Using High Speed Processing Program 3.4.1 Separation of Main Processing and High Speed Processing Bit Operation Areas (1) Bit operation area When using high speed processing, the bit operation range such as the temporary memory is separated from the main process. (Method 1) When using the same M or G code, the bit operation area for high speed processing and the bit operation area for main processing are separated by 64 points or more and used.
3. Input/Output Signals (2) Data area Even with commands that handle data (numerical values) during the MOV command, etc., the bit area must be separated by 64 points or more and the data register (D) and file register (R) separated by four registers or more. Example) Use D0 to D896 for main processing Use D900 to D1023 for high speed processing Separate by four registers or more 3.4.
3. Input/Output Signals (Usage example 1) Avoid interference with the main process by assigning 7 (last channel) for the channel No. rotary switch for high speed processing output. For example, use YE0 to YFF (for 32-point DO-L) or YE0 to YEF (for 16-point DO-R) as the high speed processing output. (Refer to below.) (Usage example 2) Assign Y0 to Y1F (32-point) for high speed processing, and use Y20 and following for the main process. (Refer to below.
4. Parameters 4. Parameters 4.1 PLC Constants The parameters that can be used in user PLC include PLC constants set in the data type. Set up data is stored in a file register and is backed up. In contrast, if data is stored in the file register corresponding to PLC constant by using sequence program MOV instruction, etc., it is backed up. However, display remains unchanged. Display another screen once and then select the screen again. 48 PLC constants are set (the setting range is ±8 digits).
4. Parameters 4.2 Bit Selection Parameters The parameters that can be used in user PLC include bit selection parameters set in the bit type. Set up data is stored in a file register and is backed up. For use in bit operation in a sequence program, the file register contents are transferred to temporary memory (M) using the MOV command. In contrast, if data is stored in the file register corresponding to bit selection by using the MOV command etc., it is backed up. However, display remains unchanged.
4.
4.
4.
5. Explanation of Devices 5. Explanation of Devices 5.1 Devices and Device Numbers The devices are address symbols to identify signals handled in PLC. The device numbers are serial numbers assigned to the devices. The device numbers of devices X, Y and H are represented in hexadecimal notation. The device numbers of other devices are represented in decimal notation. 5.2 Device List Device Device No.
5. Explanation of Devices 5.3 Detailed Explanation of Devices 5.3.1 Input/output X, Y Input/output X and Y are a window for executing communication with the PLC and external device or CNC. Input X (a) This issued commands or data from an external device such as a push-button, changeover switch, limit switch or digital switch to the PLC. (b) Assuming that there is a hypothetical relay Xn built-in the PLC per input point, the program uses the "A" contact and "B" contact of that Xn.
5. Explanation of Devices 5.3.2 Internal Relays M and F, Latch Relay L The internal relay and latch relay are auxiliary relays in the PLC that cannot directly output to an external source. Internal relays M (a) These relays are cleared when the power is turned OFF. (b) There is no limit to the No. of "A" contacts and "B" contacts of the internal relays that can be used in the program. (c) The internal relay No. is expressed with a decimal.
5. Explanation of Devices 5.3.4 Timer T (1) The 100ms timer, 10ms timer and 100ms integrated timer are available for this count-up type timer. 100ms Timer T (a) When the input conditions are set, the count starts. When the set value is counted, that timer contact will turn ON. (b) If the input conditions are turned OFF, the 100ms timer count value will be set to 0, and the contact will turn OFF.
5. Explanation of Devices 100ms integrated timer T (a) When the input conditions are set, the count starts. When the set value is counted, that timer contact will turn ON. (b) Even the input conditions are turned OFF, the 100ms integrated timer current value (count value) will be held, and the contact state will not change. (c) The 100ms integrated timer count value will be set to 0 and the contact will turn OFF when the RST command is executed.
5. Explanation of Devices 5.3.5 Counter C (1) The counter counts up and detects the rising edge of the input conditions. Thus, the count will not take place when the input conditions are ON. Counter C (a) The value is set with a decimal, and can be designated from 1 to 32767. The data register (D) data can also be used as the setting value. File register (R) cannot be used. (b) The counter count value will not be cleared even if the input conditions turn OFF.
5. Explanation of Devices 5.3.7 File Register R (1) As with the data registers, the file registers are memories used to store data. However, there are some that have fixed applications, and those that are released. (2) The file register has a 1-point 16-bit configuration, and can be read and written in 16-bit units. To handle 32-bit data, two points must be used. The file register No. designated with the 32-bit command will be the low-order 16-bit, and the designated file register No.
5. Explanation of Devices 5.3.8 Index Registers Z (1) The index registers are used as ornaments for the device (T, C, D, R). 159 MOV 165 MOV K4X0 D5Z0 K3 Z0 D5Z0 Indicates D (5+Z) = D8 (2) The index register has a 1-point 16-bit configuration, and can be read and written in 16-bit units. (3) The data stored in the index register is cleared when the power is turned OFF.
5. Explanation of Devices 5.3.9 Nesting N (1) This indicates the master control nesting structure. (2) The master control nesting (N) is used in order from smallest number. A MC N0 N0 M15 M15 Execute when A conditions are set. B MC N1 N1 M16 M16 Execute when A,B conditions are set. C MC N2 N2 M17 M17 Execute when A,B,C conditions are set. MCR N2 Reset MC2 to 7 Execute when A,B conditions are set. MCR N1 Reset MC1 to 7 Execute when A conditions are set.
5. Explanation of Devices 5.3.10 Pointer P (1) The pointer indicates the branch command (CJ, CALL) jump destination. The pointer No. assigned at the jump destination head is called the label. (2) Pointers P0 to P159, P251, P252, P255 are user release pointers. (3) P255 always indicates END. (P255 can be used as a device for CJ command, etc, but cannot be used as a label. This cannot be used for the CALL command device.
5. Explanation of Devices 5.3.11 Decimal Constant K (1) The decimal constant can be used in the following ways. (a) Timer counter setting value: Designate in the range of 1 to 32767. (b) Pointer No.: 0 to 159 (c) Bit device digit designation: 1 to 8 (d) Basic command, function command, exclusive command value setting · 16-bit command: -32768 to 32767 · 32-bit command: -2147483648 to 2147483647 (2) The decimal constant is stored in the binary value (binary) in the PLC. 5.3.
6. Explanation of Commands 6. Explanation of Commands 6.1 Command List 6.1.1 Basic Commands Process unit Class Basic command Bit Command sign Process details Symbol No.
6. Explanation of Commands 6.1.2 Function Commands (1) Comparison commands Class Process unit 16-bit Command sign Process details Symbol No.
6.
6. Explanation of Commands (4) Data transmission commands Class Process unit Command sign 16-bit MOV 32-bit DMOV 16-bit XCH 32-bit DXCH Transmission Process details No. of step Page (D) 3 118 3~4 120 4 122 4 124 n 5 126 n 5 128 Process details No.
6. Explanation of Commands (6) Logical operation commands Class Process unit Comman d sign 16-bit WAND 32-bit DAND DAND 16-bit WOR WOR S1 32-bit DOR 16-bit WXOR 32-bit DXOR 16-bit NEG Symbol WAND S1 S2 Process details D (S1) ^ (S2) S D (D + 1, D) ^ (S + 1, S) S2 D (S1) V (S2) D (D + 1, D) V (S + 1, S) D (S1) V– (S2) D (D + 1, D) (S + 1, S) D (D) + 1 (D) No.
6. Explanation of Commands (7) Rotation commands Class Process unit Command sign Symbol Process details b15 ROR ROR D (D) b0 No. of step Page 3 150 3 152 3 154 3 156 3 158 3 160 3 162 3 164 3 166 4 168 3 170 4 172 SM12 n Rotate n bits right. 16-bit RCR b0 (D) b15 RCR D SM12 n Right rotation Rotate n bits right. (D+1) (D) b31 b16 b15 b0 DROR DROR D SM12 n Rotate n bits right. 32-bit (D+1) (D) b31 b16 b15 b0 DRCR DRCR D SM12 n Rotate n bits right.
6. Explanation of Commands (8) Data processing commands Class Process unit Command sign Symbol Process details No. of step Page 6 174 4 176 5 178 3 180 5 182 (S2) (S1) n Search Number of bits set to 1 16-bit 16-bit n 2 -bit SER SER S1 S2 SUM SUM DECO DECO S S D D D n (D) :Match No. (D+1) :Number of match data pieces b15 (S) b0 Number of bits set to 1.
6. Explanation of Commands 6.1.3 Exclusive commands Class Process unit Command sign Process details Symbol S.ATC Kn Rn Rm Mn ATC ROT TSRH DDB — — — — 198 K2: Tool number AND search 199 K3: Tool change 200 K4: Random position tool change 201 K5: Forward rotation of pointer 202 K8: Reverse rotation of tool table 203 K9: Tool data read 204 K10: Tool data write 205 K11: Automatic write of tool data 206 K1: Rotary body index S.TSRH S.
6. Explanation of Commands 6.2 Command Formats 6.2.1 How to Read the Command Table The basic command and function command explanations are shown below. Example of D+ command The command signal is indicated. D+······BIN 32-bit addition Usable device Bit device X Y M L SM F Digit Constant Word device T C D R Z K H Pointer Level P N No. of Index desig- steps nation S1 S2 D 4/5 The devices that can be used with the D+ command are circled.
6. Explanation of Commands 6.2.2 No. of Steps The basic No. of steps in the sequence command includes step 1 to step 6. Main examples of each step are shown below. Basic No.
6. Explanation of Commands 6.2.3 END Command With the END command, both the circuit mode and the list mode are automatically created, so programming is not necessary. 6.2.4 Index Ornament (1) The index ornament is used to add an index (Z0, Z1) to a device, add the details of the directly designated device No. and index register, and designate the device No. (2) The index (Z0, Z1) can be set between -32768 to 32767 with a sign added. (3) The index ornament is used only for the MOV command.
6. Explanation of Commands 6.2.5 Digit Designation A digit may need to be designated for the bit device (X, Y, M, L, SM, F) when using the function command. How many points of 4-point unit bit devices are to be used with the 16-bit or 32-bit command is selected with this digit designation. Use device K when designating the digit. The designation range is as shown below. A random bit device can be set for the bit device.
6. Explanation of Commands (1) When a digit is designated on the source (S) side, the values that can be handled as source data will be as shown below.
6. Explanation of Commands (2) When a digit is designated on the destination (D) side, the No. of points designated by the digit will be the target of the destination side. Circuit side Process When source data (S) is a value 1 2 3 4 H1234 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 MOV H1234 K2M0 M15................................... M8 M7 ...................................
- 40 -
7. Basic Commands 7. Basic Commands These commands are the basis for the sequence programs. The sequence program cannot be created without these commands. The circuit can be created (programmed) with the same image as creating a circuit by combining the actual relay A contacts and B contacts as done conventionally.
LD, LDI { LD, LDI ... Operation start Usable device Bit device X Y M Word device L SM F T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps nation Index 1 X9 Device No. LD X9 LDI Function LD is the A contact operation start command and LDI is the B contact operation start command. The ON/OFF information of the designated device is read in as the operation results. Execution conditions This is executed per scan regardless of the device ON/OFF setting.
LD, LDI Program example (1) Program used at head of circuit block. Coding M32 Y10 No. of steps Y11 10 LD M32 11 OUT Y10 12 LDI M32 13 OUT Y11 10 M32 12 Command Device 14 (2) Program used at head of circuit block connected with ANB. Coding X0 M9 M13 Y99 No. of steps 99 M35 ANB Circuit block connected with ANB. Command Device 99 LD X0 100 LD M9 101 AND M13 102 ORI M35 103 ANB 104 OUT Y99 105 (3) Program used at head of circuit block connected with ORB.
AND, ANI { AND, ANI ... Serial connection of contact Usable device Bit device X Y M L SM F Word device T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps nation Index 1 X0 Device No. AND X0 ANI Function AND is the A contact serial connection command, and ANI is the B contact serial connection command. The ON/OFF information of the designated device is read in, and the AND operation with the operation results up to that point is executed.
AND, ANI Program example (1) Program used after LD, LDI, AND or ANI, etc. Coding X3 M6 X4 M7 Y33 M9 10 ORB X5 M8 M11 Y34 17 M9 ANB No. of steps Command Device 10 LD X3 11 AND M6 12 LDI X4 13 ANI M7 14 ORB 15 ANI M9 16 OUT Y33 17 LD X5 18 LD M8 19 OR M9 20 ANB 21 ANI M11 22 OUT Y34 23 (2) Program used to connect contact in parallel with coil. Coding X5 Y35 No.
OR, ORI { OR, ORI ... Parallel connection of one contact Usable device Bit device X Y M L SM F Word device T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps nation Index 1 Device No. OR X0 ORI X0 Function OR is the one A contact parallel connection command, and ORI is the one B contact parallel connection operation command. The ON/OFF information of the designated device is read in, and the OR operation with the operation results up to that point is executed.
OR, ORI Program example (1) Program used at head of circuit block. Coding X3 Y33 10 X4 X5 X5 M11 Y34 14 X6 No. of steps Command Device 10 LD X3 11 OR X4 12 OR X5 13 OUT Y33 14 LD X5 15 AND M11 16 ORI X6 17 OUT Y34 18 (2) Program used in circuit. Coding X5 M8 Y35 93 M9 M10 X6 M111 M113 Y36 99 M105 L10 No.
ANB { ANB ... Serial connection of circuit block Usable device Bit device X Y M L SM F Word device T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps nation Index 1 ANB A block B block Function (1) AND operation of the A block and B block is executed, and the operation results are obtained. (2) The ANB symbol is a connection symbol instead of a contact symbol. (3) When consecutively writing ANB, a max. of 7 commands (8 blocks) can be written.
ANB Program example Program that serially connects continuous circuit blocks. X0 X2 X4 X6 X8 X1 X3 X5 X7 X9 M7 10 Coding No.
ORB { ORB ... Parallel connection of blocks Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps nation Index 1 A block ORB B block OR or ORI is used for the one contact parallel connection. Function (1) OR operation of the A block and B block is executed, and the operation results are obtained. (2) ORB connects circuit blocks with two or more contacts in parallel.
ORB Program example Program that connects continuous circuit blocks in parallel. Coding X0 X1 X2 X3 X4 X5 X6 X7 M7 10 No.
OUT (Y, M, L, SM, F) { OUT (Y, M, L, SM, F) ... Output (Y, M, L, SM, F) Usable device Bit device X Y M Word device L SM F T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps nation Index 1 Y35 Device No. M60 M61 F0 Function The operation results before the OUT command are output to the designated device.
OUT (Y, M, L, SM, F) Program example (1) Program output to output unit. Coding X5 Y33 No. of steps X6 Y34 10 LD X5 11 OUT Y33 12 LD X6 13 OUT Y34 14 OUT Y35 10 12 Y35 Command Device 15 (2) Program that turns internal relay or latch relay ON/OFF. Coding X5 M15 No.
OUT T { OUT T ... Timer output Usable device Bit device X Y M Word device L SM F T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps Index nation Device 3 Setting value Setting value (1 to 32767 is valid) T0 K50 Device No.(T0 to 255) T0 D10 Setting value (1 to 32767 is valid for the data register details) Device No.(T0 to 255) Function (1) When the operation results before the OUT command are ON, the timer coil will turn ON and count to the set value.
OUT T Execution condition This is executed per scan regardless of the operation results before the OUT command. Program example (1) Program to turn ON Y10 and Y14 ten seconds after X0 turns ON. Coding X0 10 T1 K100 T1 No. of steps Y10 14 Y14 Command Device 10 LD X0 11 OUT T1 14 LD T1 15 OUT Y10 16 OUT Y14 K100 17 (2) Program to use X10 to 1F BCD data as timer setting value. X0 BIN 10 X2 D10 T2 D10 14 18 K4X1 0 T2 The X10 to 1F data is BIN converted and stored in D10.
OUT C { OUT C ... Counter output Usable device Bit device X Y M Word device L SM F T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps Index nation Device 3 Setting value Setting value (1 to 32767 is valid) C0 K50 Device No.(C0 to 127) C1 D10 Setting value (1 to 32767 is valid for the data register details) Device No.(C0 to 127) Function (1) If the operation results before the OUT command change from OFF to ON, the current value (count value) will be incremented by one.
OUT C Program example (1) Program to turn Y30 ON when X0 turns ON ten times, and to turn Y30 OFF when X1 turns ON. Coding X0 10 C10 K10 C10 Y30 14 X1 16 RST C10 No. of steps Command Device 10 LD X0 11 OUT C10 K10 14 LD C10 15 OUT Y30 16 LD X1 17 RST C10 19 (2) Program to set C10 setting value to 10 when X0 turns ON, and to 20 when X1 turns ON. X0 10 MOV K10 D0 MOV K20 D0 10 is stored in D0 when X0 turns ON. X1 14 20 is stored in D0 when X1 turns ON.
SET { SET ... Device setting (ON) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D 1 Setting command SET Setting data D D Device N0. to be set (ON) Function (1) The designated device turns ON when the SET input turns ON. (2) The device turned ON remains ON even if the SET input turns OFF. The device can be turned OFF with the RST command.
SET Program example (1) Program to set Y8B (ON) when X8 turns ON, and reset Y8B (OFF) when X9 turns ON. Coding X9 RST Y8B 10 X8 12 SET Y8B No.
RST { RST ... Device resetting Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D 1/2 Reset command RST Setting data D D Device No. to be reset Function (1) The designated device will change as explained below when the RST input turns ON. Device Status Y, M, L, SM, F The coil and contact are turned OFF. T, C 0 is set for the current value, and the coil and contact are turned OFF.
RST Program example (1) Program to reset 100ms integrated timer and counter. X4 10 14 T96 K18000 When T96 is set for the integrated timer, T96 will turn ON when the X4 ON time is 30 min. C23 The No. of times that T96 turns ON is counted. T96 RST 20 C23 K16 T96 T96 is reset when T96 turns ON. Y55 Y55 turns ON when C23 counts up. X5 22 RST C23 C23 is reset when X5 turns ON. Coding No. of Comsteps mand 2 steps are used for T or C device. 1 step is used for the other devices.
MC, MCR { MC, MCR ... Master control set/reset Usable device Bit device X Y M Word device L SM F T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps Index nation n D 2/1 MC ON/OFF command MC n D n D Setting data n device Nesting (N0 to 7) D Device No. to be turned ON Nesting (N0 to 7) MCR n Function MC (1) If the MC ON/OFF command is ON when the master control starts, the operation results between MC and MCR will remain the same.
MC, MCR MCR (1) This is the master control cancel command, and indicates the end of the master control range. (2) The designated nesting (N) No. and following nests will be canceled. MCR N3 N3 to N7 master control is canceled. Program example (1) Program to turn MC ON when X9 is ON and turn MC OFF when OFF. X9 10 N0 MC N0 M98 X10 M98 Y30 13 X11 Y31 15 X12 Y32 X13 Y33 Control range of MC N0 M98 17 19 21 MCR N0 Coding No.
PLS, PLF { PLS, PLF ... Pulse (1 scan ON) Usable device Bit device X Y M L SM F Word device T C D R Z Constant K Pointer Level P N H Digit No. of desigsteps Index nation D 2 PLS command PLS PLS D Setting data D Device No. to be pulse coded PLF command PLF PLF D Function PLS (1) The designated device is turned ON for one scan when the PLS command changes from OFF to ON and is turned OFF in all other cases.
PLS, PLF Program example (1) Program to execute PLS command when X9 turns ON. Coding X9 PLS 10 M9 No. of steps Command Device 10 LD X9 11 PLS M9 13 ON X9 OFF ON M9 OFF 1 scan (2) Program to execute PLF command when X9 turns OFF. Coding X9 10 PLF M9 No.
SFT { SFT ... Device shift Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D 4 SFT command SFT SFT D Setting data D Device No. to be shifted Function (1) The device that designates the ON/OFF state of the device that is one number smaller than the device designated with D (destination) is shifted, and the device that is one number smaller is turned OFF.
SFT Execution condition The execution conditions for the SFT command are as shown below. ON SFT input OFF SFT command Executed per scan Executed per scan Program example (1) Program to shift Y57 to 5B when X8 turns ON. X8 PLS M0 6 M0 9 SFT Y5B SFT Y5A SFT Y59 SFT Y58 PLS M8 (pules coding) Shifting is executed when M0 turns ON. (program from the largest device No.) X7 26 X57 is turned ON when X7 turns ON. M8 29 SET Y57 Coding M0 No.
MPS, MRD, MPP { MPS, MRD, MPP ... Registering, reading and clearing of operation results Usable device Bit device X Y M L SM F Constant Word device T C D R Z K H Pointer Level P N Digit No. of desigsteps nation Index 1 MPS, MRD and MPP are not displayed. MPS MRD MPP Function MPS (1) The operation results (ON/OFF) just before the MPS command are registered. (2) The MPS command can be used consecutively up to four times. If the MPP command is used in between, the No.
MPS, MRD, MPP Point (1) The circuits when MPS, MRD and MPP are used and not used are as follow. Circuit using MPS, MRD and MPP X0 X2 X1 Circuit not using MPS, MRD and MPP Y10 10 X0 X1 X2 X0 X1 X3 X0 X1 X5 Y10 10 X3 X4 Y11 X4 Y11 14 X5 Y12 Y12 19 (1) Program using MPS, MRD and MPP. Coding X1C (a) M8 No.
DEFR DEFR ... Pulses in regard to operation results Usable device Bit device X Y M L SM F Word device T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps Index nation D 1 DEFR command D (Note) Setting data Operation memory for D generating one scan worth of pulses (Note) In programming with the MELSEC PLC development tool (GX Developer), "AND" command is substituted and used.
DEFR Program example (1) Program to turn Y0 ON for one scan when X9 turns ON. Coding No. of steps M0 X9 10 Y0 Command Device 10 LD X9 11 ANDP M0 12 OUT Y0 13 ON X9 OFF ON Y0 OFF 1 scan (2) Program to execute MOV command once when X9 turns ON. Coding X9 10 M0 MOV K0 D10 No.
- 72 -
8. Function Commands 8. Function Commands Recent sequence programs that require more advanced control cannot provide sufficient control only with basic commands and thus need four-rule operation and comparison, etc. Many function commands have been prepared for this. There are approx. 76 types of function commands. Each command is explained in the following section.
LD=, AND=, OR= { LD=, AND=, OR= .... Comparison of 16-bit data (=) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 3 = LD= S1 S2 Setting data Comparison data or No. of device where comparison data is S2 stored. S1 AND= = S1 S2 = S1 S2 OR= Function (1) 16-bit comparison operation is executed with "A" contact handling. (2) The comparison operation results will be as follow.
LD=, AND=, OR= Program example (1) Program to compare the X0 to F data and D3 data. Coding Y33 = 10 K4X0 D3 No. of steps Command Device 10 LD= K4X0 D3 13 OUT Y33 14 (2) Program to compare the BCD value 100 and D3 data. Coding M3 Y33 10 = H100 D3 No. of steps Command Device 10 LD M3 11 AND= H100 D3 14 OUT Y33 15 (3) Program to compare the BIN value 100 and D3 data. Coding Y33 M3 10 = K100 D3 M8 No.
LDD=, ANDD=, ORD= { LDD=, ANDD=, ORD= ... Comparison of 32-bit data (=) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 3/4 D= LDD= S1 S2 Setting data Comparison data or head No. of device where comparison S2 data is stored. S1 ANDD= D= S1 S2 D= S1 S2 ORD= Function (1) 32-bit comparison operation is executed with "A" contact handling. (2) The comparison operation results will be as follow.
LDD=, ANDD=, ORD= Program example (1) Program to compare the X0 to 1F data, D3 and D4 data. Coding Y33 D= 10 K8X0 D3 No. of steps Command Device 10 LDD= K8X0 13 OUT D3 Y33 14 (2) Program to compare the BCD value 18000, D3 and D4 data. Coding M3 Y33 10 D= H18000 D3 No. of steps Command Device 10 LD M3 11 ANDD= H18000 15 OUT Y33 D3 16 (3) Program to compare the BIN value -80000, D3 and D4 data. Coding M3 Y33 D= 10 K-80000 D3 M8 No.
LD>, AND>, OR> { LD>, AND>, OR> .... Comparison of 16-bit data (>) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 3 LD> > S1 S2 Setting data AND> > S1 S2 > S1 S2 Comparison data or No. of device where comparison data is S2 stored. S1 OR> Function (1) 16-bit comparison operation is executed with "A" contact handling. (2) The comparison operation results will be as follow.
LD>, AND>, OR> Program example (1) Program to compare the X0 to F data and D3 data. Coding Y33 10 > K4X0 D3 No. of steps Command Device 10 LD> K4X0 13 OUT Y33 D3 14 (2) Program to compare the BCD value 100 and D3 data. Coding M3 Y33 10 > H100 D3 No. of steps Command Device 10 LD M3 11 AND> H100 14 OUT D3 Y33 15 (3) Program to compare the BIN value 100 and D3 data. Coding M3 Y33 10 > K100 D3 M8 No.
LDD>, ANDD>, ORD> { LDD>, ANDD>, ORD> ... Comparison of 32-bit data (>) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 3/4 D> LDD> S1 S2 Setting data Comparison data or head No. of device where comparison S2 data is stored. S1 ANDD> D> S1 S2 D> S1 S2 ORD> Function (1) 32-bit comparison operation is executed with "A" contact handling. (2) The comparison operation results will be as follow.
LDD>, ANDD>, ORD> Program example (1) Program to compare the X0 to 1F data, D3 and D4 data. Coding Y33 10 D> K8X0 D3 No. of steps Command Device 10 LDD> K8X0 13 OUT Y33 D3 14 (2) Program to compare the BCD value 18000, D3 and D4 data. Coding M3 Y33 10 D> H18000 D3 No. of steps Command Device 10 LD M3 11 ANDD> H18000 15 OUT Y33 D3 16 (3) Program to compare the BIN value -80000, D3 and D4 data. Coding M3 Y33 10 D> K-80000 D3 M8 No.
LD<, AND<, OR< { LD<, AND<, OR< .... Comparison of 16-bit data (<) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 3 < LD< S1 S2 Setting data AND< < S1 S2 < S1 S2 Comparison data or No. of device where comparison data is S2 stored. S1 OR< Function (1) 16-bit comparison operation is executed with "A" contact handling. (2) The comparison operation results will be as follow.
LD<, AND<, OR< Program example (1) Program to compare the X0 to F data and D3 data. Coding Y33 10 < K4X0 D3 No. of steps Command Device 10 LD< K4X0 13 OUT Y33 D3 14 (2) Program to compare the BCD value 100 and D3 data. Coding M3 Y33 < 10 H100 D3 No. of steps Command Device 10 LD M3 11 AND< H100 14 OUT D3 Y33 15 (3) Program to compare the BIN value 100 and D3 data. Coding M3 Y33 < 10 K100 D3 M8 No.
LDD<, ANDD<, ORD< { LDD<, ANDD<, ORD< ... Comparison of 32-bit data (<) Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 3/4 D< LDD< S1 S2 Setting data ANDD< D< S1 S2 D< S1 S2 ORD< Function (1) 32-bit comparison operation is executed with "A" contact handling. (2) The comparison operation results will be as follow.
LDD<, ANDD<, ORD< Program example (1) Program to compare the X0 to 1F data, D3 and D4 data. Coding Y33 10 D< K8X0 D3 No. of steps Command Device 10 LDD< K8X0 13 OUT Y33 D3 14 (2) Program to compare the BCD value 18000, D3 and D4 data. Coding M3 Y33 D< H18000 D3 10 No. of steps Command Device 10 LD M3 11 ANDD< H18000 15 OUT Y33 D3 16 (3) Program to compare the BIN value -80000, D3 and D4 data. Coding M3 D< K-80000 10 D3 Y33 M8 No.
+ {+ ... BIN 16-bit addition Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4 Setting data Addition command + + S1 S2 D S1 Addition data or No. of device where addition data is stored. S2 Addition data or No. of device where addition data is stored. D No. of device to store addition results.
+ Execution conditions The execution conditions for + are as shown below. ON Addition command OFF + Executed per scan Executed per scan Program example (1) Program to add the D0 BIN data and D10 BIN data and output to D20. Coding M0 10 + D0 D10 (ON) D20 No.
D+ { D+ ... BIN 32-bit addition Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4/5 Setting data Addition data or head No. of device S1 where addition data is stored. Addition command D+ D+ S1 S2 D S2 Addition data or head No. of device where addition data is stored. D Head No. of device to store addition results.
D+ Execution conditions The execution conditions for D+ are as shown below. ON Addition command OFF D+ Executed per scan Executed per scan Program example (1) Program to add the D0, 1 data and D9, 10 data when X0 turns ON, and output the results to D20, 21. Coding X0 10 D+ D0 D9 D20 No.
– { – ... BIN 16-bit subtraction Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4 Setting data Subtraction command - - S1 S2 D S1 Subtraction data or No. of device where subtraction data is stored. S2 Subtraction data or No. of device where subtraction data is stored. D No. of device to store subtraction results.
– Execution conditions The execution conditions for - are as shown below. ON Subtraction command OFF - Executed per scan Executed per scan Program example (1) Program to subtract the BIN data D10 from D3 and output to D20. Coding M0 - 10 D3 D10 D20 (ON) No. of steps Command Device 10 LD M0 11 - D3 D10 D20 15 (2) Program to BCD output the difference of the timer T3 setting value and current value to D20. Coding X3 10 T3 K18000 M0 MOV K18000 13 D2 (ON) - D2 BCD D3 T3 D3 D20 No.
D– { D– ... BIN 32-bit subtraction Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4/5 Setting data Subtraction command D- D- S1 S2 D S1 Subtraction data or head No. of device where subtraction data is stored. S2 Subtraction data or head No. of device where subtraction data is stored. D Head No. of device to store subtraction results.
D– Execution conditions The execution conditions for D- are as shown below. ON Subtraction command OFF D- Executed per scan Executed per scan Program example (1) Program to subtract the D0, 1 data from the D10, 11 data when X1 turns ON, and output the results to D99, 100. Program to subtract the D0, 1 data from D10, 11 data when X2 turns ON, and output the results to D97, 98.
* { * ... BIN 16-bit multiplication Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4 Setting data Multiplication command * * S1 S2 D S1 Multiplication data or No. of device where multiplication data is stored. S2 Multiplication data or No. of device where multiplication data is stored. D Head No. of device to store multiplication results.
* Execution conditions The execution conditions for * are as shown below. ON Multiplication command OFF * Executed per scan Executed per scan Program example (1) Program to multiply the D0 data and BIN 5678 when X5 turns ON and output the results to D3, 4. Coding X5 10 * D0 K5678 D3 No. of steps Command Device 10 LD X5 11 * D0 K5678 D3 15 (2) Program to multiple the D0 BIN data and D10 BIN data, and output the results to D20. Coding M0 10 * D0 D10 D20 (ON) No.
D* { D* ... BIN 32-bit multiplication Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 D 5/6 Setting data Multiplication command D* D* S1 S2 D S1 Multiplication data or head No. of device where multiplication data is stored. S2 Multiplication data or head No. of device where multiplication data is stored. D Head No. of device to store multiplication results.
D* Execution conditions The execution conditions for D* are as shown below. ON Multiplication command OFF D* Executed per scan Executed per scan Program example (1) Program to multiply the D7, 8 BIN data and D18, 19 BIN data when X5 turns ON, and output the results to D1 to 4. Coding X5 10 D* D7 D18 D1 No. of steps Command Device 10 LD X5 11 D* D7 D18 D1 16 (2) Program to multiply the D20 BIN data and D10 BIN data when X0 turns ON, and output the high-order 16-bit to Y30 to 4F.
/ { / ... BIN 16-bit division Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H S1 S2 D Digit No. of desigsteps Index nation 5 Setting data Division command / / S1 S2 D S1 Division data or No. of device where division data is stored. S2 Division data or No. of device where division data is stored. D Head No. of device to store division results.
/ Execution conditions The execution conditions for / are as shown below. ON Division command OFF / Executed per scan Executed per scan Program example (1) Program to divide the D10 data by 3.14 when X3 turns ON, and output the value (quotient) to D5. Coding X3 10 * D10 K100 D0 / D0 K314 D5 No. of steps Command Device 10 LD X3 11 * D10 K100 D0 15 / D0 K314 D5 20 Point The source and destination sides of the above program are as follow.
D/ { D/ ... BIN 32-bit division Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 5/6 Setting data S1 Division command D/ D/ S1 S2 D Division data or head No. of device where division data is stored. Division data or head No. of S2 device where division data is stored. D Head No. of device to store division results.
D/ Execution conditions The execution conditions for D/ are as shown below. ON Division command OFF D/ Executed per scan Executed per scan Program example (1) Program to multiply the D10 data by 3.14 when X3 turns ON, and output the worth of low-order 16-bit of the results to Y30 to 3F. Coding No.
INC { INC ... (16-bit BIN data) +1 Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D 2 Setting data INC command IN C IN C D D No. of device to be INCed (+1) Function (1) The device (16-bit data) designated with D is incremented by one. D D B15..................................B0 B15..................................
INC Program example (1) Example of addition counter program X7 10 MOV K0 D8 Set D8 to 0 when X7 turns ON. M38 X8 14 INCP D8 Execute D8+1 at X8 OFF to ON when M38 is OFF. M38 18 = K100 M38 turns ON when D8 = 100. D8 Coding No.
DINC { DINC ... (32-bit BIN data) +1 Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D 2 DINC command DINC DINC Setting data D Head No. of device to be DINCed (+1) D Function (1) The device (32-bit data) designated with D is incremented by one. D+1 D+1 D B31...........B16B15...........B0 73500 (BIN) D B31...........B16B15...........
DINC Program example (1) Program to increment the D0, 1 data by one when M0 turns ON. Coding M0 10 DINC D0 (Pulse coding) No. of steps Command Device 10 LD M0 11 DINC D0 13 (2) Program to increment X10 to 27 data by one when M0 turns ON, and to store the results in D3, 4. Coding M0 10 DMOV K6X10 D3 DINC D3 (Pulse coding) No.
DEC { DEC ... (16-bit BIN data) –1 Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D 2 Setting data DEC command DEC DEC D D No. of device to be DECed (-1) Function (1) The device (16-bit data) designated with D is decremented by one. D D B15...................................B0 B15...................................
DEC Program example (1) Example of subtraction counter program X7 10 MOV K100 D8 Set D8 to 100 when X7 turns ON. M38 X8 DECP D8 14 Execute D8-1 at X8 OFF to ON when M38 turns OFF. M38 18 = K0 M38 turns ON when D8 = 0. D8 Coding No.
DDEC { DDEC ... (32-bit BIN data) –1 Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D 2 Setting data DDEC command DDEC DDEC D D Head No. of device to be DDECed (-1) Function (1) The device (32-bit data) designated with D is decremented by one. D+1 D D+1 B31.........B16B15...........B0 73500 (BIN) D B31.........B16B15...........
DDEC Program example (1) Program to decrement the D0, 1 data by one when M0 turns ON. Coding M0 DDEC 10 D0 (pulse coding) No. of steps Command Device 10 LD M0 11 DDEC D0 13 (2) Program to decrement X10 to 27 data by one when M0 turns ON, and to store the results in D3, 4. Coding M0 10 DMOV K6X10 D3 DDEC D3 (pulse coding) No.
BCD { BCD ... BIN BCD conversion (16-bit) Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 3 Setting data BCD conversion command BCD BCD S S BIN data or No. of device where BIN data is stored. D No. of device to store BCD data. D Function The BIN data (0 to 9999) of the device designated with S is BCD converted and transmitted to the device designated with D.
BCD Program example Y23 Y22 Y21 Y20 8 4 2 1 1 0 0 0 Y27 Y26 Y25 Y24 80 40 20 10 0 1 1 1 Y2B Y2A Y29 Y28 800 400 200 100 0 1 1 0 0 1 0 1 8000 4000 2000 1000 Y2 F Y2E Y2 D Y2 C (1) Program to output C4 current value from Y20 to 2F to BCD display. Coding M0 10 BCD C4 D4 MOV D4 K4Y20 (ON) No.
DBCD { DBCD ... BIN BCD conversion (32-bit) Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 4 Setting data BIN data or head No. of S device where BIN data is stored. DBCD conversion command DBCD DBCD S D D Head No. of device to store BCD data. Function The BIN data (0 to 99999999) of the device designated with S is BCD converted and transmitted to the device designated with D.
DBCD Execution conditions The execution conditions for DBCD are as follow. ON DBCD command OFF DBCD Executed per scan Executed per scan Program example Y1 C Y1 D Y1E Y1 F Y23 Y22 Y21 Y20 8 4 2 1 0 1 0 1 1 0 0 0 80 40 20 10 Y27 Y26 Y25 Y24 800 400 200 100 0 1 1 1 Y2B Y2A Y29 Y28 8000 4000 2000 1000 0 1 1 0 0 0 0 0 80000 40000 20000 10000 Y2 F Y2E Y2 D Y2 C (1) Program to output the current timer value of which the setting value exceeds 9999 to Y1C to 2F.
BIN { BIN ... BCD BIN conversion (16-bit) Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 3 Setting data BIN conversion command BIN BIN S S BCD data or No. of device where BCD data is stored. D No. of device to store BIN data D Function The BCD data (0 to 9999) of the device designated with S is BIN converted and transmitted to the device designated with D.
BIN Program example (1) Program to BIN convert the X10 to 1B BCD data when X8 turns On, and store in D8. 8 4 2 1 Y13 Y12 Y11 Y10 0 1 1 0 80 40 20 10 0 0 1 1 Y17 Y16 Y15 Y14 Y1B Y1A Y19 Y18 Y1 F Y1E Y1 D Y1 C 0 0 1 0 Can be used for other purposes 800 400 200 100 Digital switch BCD DI card Coding X8 10 BIN K3X10 D8 No.
DBIN { DBIN ... BCD BIN conversion (32-bit) Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 4 Setting data DBIN conversion command DBIN S DBIN S BCD data or head No. of device where BCD data is stored. D Head No. of device to store BIN data D Function The BCD data (0 to 99999999) of the device designated with S is BIN converted and transmitted to the device designated with D.
DBIN Execution conditions The execution conditions for DBIN are as follow. ON DBIN command OFF DBIN Executed per scan Executed per scan Program example (1) Program to BIN convert the X10 to 23 BCD data when X0 turns ON, and to store in D14, 15. Coding X0 10 DBIN K5X10 D14 No. of steps Command Device 10 LD X0 11 DBIN K5X10 D14 15 (2) Program to BIN convert the D0, 1 data when X0 turns ON, and store in D18, 19. X0 10 DBIN D0 D18 No.
MOV { MOV ... 16-bit data transmission Usable device Bit device X S D Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation 3 *1 : MOV from a bit device (word device) to Z is not possible. (MOV to Z is possible only for a constant.) Z cannot be independently placed on the source side, but can be used on the source side as ornaments for D and R. Refer to "Index Ornament" for details.
MOV Program example (1) Program to store input X0 to B data in D8. M0 10 MOV K3X0 D8 (ON) No. of steps Command Device 10 LD M0 11 MOV K3X0 D8 14 (2) Program to store 155 in D8 as binary value when X8 turns ON. X8 MOV 10 D8 K155 D8 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 1 No. of steps Command Device 10 LD X8 11 MOV K155 D8 14 (3) Program to store 155 in D93 as BCD value in when XB turns ON. XB 10 MOV 0 0 0 D93 H155 D93 0 0 0 0 1 0 1 0 1 0 1 0 1 No.
DMOV { DMOV ... 32-bit data transmission Usable device Bit device X S D Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation 3/4 *2 *1 DMOV from a bit device to a bit device is not possible. *2 DMOV to device X can be programmed, but this is a command for testing by Mitsubishi. Do not use it. Setting data Transmission command DMOV DMOV S D Transmission source data S or head No. of device where data is stored. D Head No.
DMOV Program example (1) Program to store D10, D11 data in D0, D1. M0 10 DMOV D10 D0 (ON) No. of steps Command Device 10 LD M0 11 DMOV D10 D0 14 (2) Program to store X0 to 1F data in D0, D1. M0 DMOV K8X0 10 D0 (ON) No.
XCH { XCH ... 16-bit data exchange Usable device Bit device X Y M L SM F Constant Word device T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D1 D2 4 Conversion command XCH XCH D1 D2 Setting data D1 No. of device where data to be exchanged D2 is stored. Function The D1 and D2 16-bit data are exchanged.
XCH Program example (1) Program to exchange T0 current value with D0 details when M8 turns ON. M8 XCH 10 T0 D0 (pulse coding) No. of steps Command Device 10 LD M8 11 XCH T0 D0 15 (2) Program to exchange D0 details with M16 to M31 data when M10 turns ON. M10 XCH K4M16 10 D0 (pulse coding) No. of steps Command Device 10 LD M10 11 XCH K4M16 D0 15 (3) Program to exchange D0 details with R9 details when M0 turns ON. M0 XCHP 10 D0 R9 (pulse coding) No.
DXCH { DXCH ... 32-bit data exchange Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D1 D2 4 Setting data Conversion command DXCH D1 Head No. of device where data to be D2 exchanged is stored. DXCH D1 D2 Function The D1 and D2 32-bit data are exchanged.
DXCH Program example (1) Program to exchange T0 and T1 current values with D0, 1 details when M8 turns ON. Coding M8 DXCH 10 T0 D0 (Pulse coding) No. of steps Command Device 10 LD M8 11 DXCH T0 D0 15 (2) Program to exchange D0, 1 details with M16 to M47 data when M10 turns ON. Coding M10 DXCH K8M16 10 D0 (Pulse coding) No. of steps Command Device 10 LD X10 11 DXCH K8M16 D0 15 (3) Program to exchange D0, 1 details with R9, 10 details when M0 turns ON.
BMOV { BMOV ... Block transmission of 16-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D n 5 Setting data Head No. of device where S data to be transmitted is stored. Transmission command BMOV BMOV S D D Head No. of device to store transmitted data n n No.
BMOV Program example (1) Program to transmit the current values of T33 to 48 to D908 to 923. Coding M90 10 BMOV T33 D908 H10 No.
FMOV { FMOV ... Batch transmission of same 16-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D n 5 Setting data S Transmission command FMOV FMOV S D n No. of device where data to be transmitted is stored. D Head No. of device to store transmitted data n No.
FMOV Program example (1) Program to reset (clear) D8 to 23 when XA turns ON. D S 0 D8 0 D9 0 D21 0 D22 0 D23 0 16 data items Transmission Resetting of data registers with FMOV command Coding XA 10 FMOV K0 D8 H10 No.
CJ { CJ ... Conditional jump Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H P Digit No. of desigsteps Index nation 2 Setting data Jump command CJ CJ P** P** Jump designation pointer No. (P0 to P159) Function CJ (1) The program of the designated pointer No. is executed when the jump command turns ON. (2) The program of the next step is executed when the jump command is OFF.
CJ Point (a) After the timer coil is turned ON, even if the timer that is turning the coil ON with the CJ command is jumped, the timer count will continue. (b) The scan time will be shortened if jumping is done after the CJ command. (c) The CJ command can be used to jump to a previous step. P8 30 X9 Y80 ...... M3 1001 CJ X10 P8 Y91 1004 When M3 turns ON, the program will jump to the P8 label. Executed when M3 is OFF. (d) The devices skipped with CJ will not change.
FEND { FEND ... Program end Usable device Bit device X Y M Word device L SM F T C D R Z Constant K H Pointer Level P N Digit No. of desigsteps Index nation 1 FEND Function The sequence program is ended. Operation when CJ command is not executed. 0 Sequence program CJ CALL P** Jump with CJ command Sequence program P** FEND Sequence program FEND P** Operation when CJ command is executed.
FEND Program example Program when using CJ command X0 Y20 10 XB 12 CJ X13 15 X14 17 19 When XB turns ON, the program jumps to the P23 label, and the step following P23 is executed. Y30 Y31 FEND X1 P23 20 P23 Execute when XB is OFF. When XB turns OFF, the end of the sequence program is indicated. Y22 Coding No.
CALL, RET { CALL, RET ... Call/return of sub-routine program Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation P 2/1 Call of sub-routine program Sub-routine execution command CALL CALL P** Setting data P** Head pointer No. of sub-routine program (P0 to P159) Head pointer No.
CALL, RET RET (1) The end of the sub-routine program is indicated. (2) When the RET command is executed, the sequence program in the step after the CALL command will be executed. Execution conditions The execution conditions of the CALL command are as shown below. ON Sub-routine execution command OFF CALL Executed per scan Executed per scan Program example Program to execute sub-routine program when X1 changes from OFF to ON.
WAND { WAND ... Logical AND of 16-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4 Setting data Operation command S1 WAND W AND S2 S1 Data to be logical ANDed or No. of device S2 where data is stored. D D No. of device to store logical AND results.
WAND Execution conditions The execution conditions for WAND are as follow. ON Operation command OFF WAND Executed per scan Executed per scan Program example (1) Program that executes logical AND of the D10 data and D20 data when XA turns ON, and stores the results in D33. Coding No. of steps XA WAND 10 D20 D10 D33 Command Device 10 LD XA 11 WAND D10 D20 D33 15 (2) Program that executes logical AND of the X10 to 1B data and D33 data when XA turns ON, and outputs the results to D50.
DAND { DAND ... Logical AND of 32-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 3/4 Setting data Data to be logical ANDed S or head No. of device where data is stored. Operation command DAND DAND S D D The logical AND results are stored in D device.
DAND Program example (1) Program that executes logical AND of the X30 to 47 24-bit data and D99, 100 data when X8 turns ON, and transmit the results to M80 to 103. X8 DAND K6X30 10 DMOV Logical AND the X30 to 47 data and D99, 100 data, and store the results in D99 to 100. D99 D99 K6M80 Transmit the D99, 100 data to M80 to 103. Coding No.
WOR { WOR ... Logical OR of 16-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4 Setting data Operation command WOR WOR S2 S1 S1 Data to be logical ORed or No. of device S2 where data is stored. D D No. of device to store logical OR results.
WOR Program example (1) Program that executes logical OR of the D10 data and D20 data when XA turns ON, and stores the results in D33. Coding XA 10 WOR D10 D20 D33 No. of steps Command Device 10 LD XA 11 WOR D10 D20 D33 15 (2) Program that executes logical OR of the X10 to 1B data and D33 data when XA turns ON, and outputs the results in D100. Coding XA 10 WOR K3X10 D33 D100 No.
DOR { DOR ... Logical OR of 32-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 3/4 Setting data Data to be logical ORed S or head No. of device where data is stored. Operation command DOR DOR S D The logical OR results are stored in D device.
DOR Program example (1) Program that executes logical OR of the X0 to 1F 32-bit data and the F0FF hexadecimal when XB turns ON, and stores the results in R66, 67. XB 10 DMOV HF0FF DOR K8X0 R66 Store the F0FF hexadecimal in R66, 67. R66 Logical OR the X0 to 1F 32-bit data and R66, 67 32-bit data, and store the results in R66, 67. Coding No.
WXOR { WXOR ... Exclusive OR of 16-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S1 S2 D 4 Setting data Operation command WXOR WXOR S1 Data to be exclusive ORed or No. of device where S2 data is stored. S1 S2 D D No. of device to store exclusive OR results.
WXOR Program example (1) Program that executes exclusive OR of the D10 data and D20 data when XA turns ON, and stores the results in D33. Coding XA WXOR 10 D10 D20 D33 No. of steps Command Device 10 LD XA 11 WXOR D10 D20 D33 15 (2) Program that executes exclusive OR of the X10 to 1B data and D33 data when XA turns ON, and outputs the results to D100. Coding XA 10 WXOR K3X10 D33 D100 No.
DXOR { DXOR ... Exclusive OR of 32-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D 3/4 Setting data Operation command Data to be exclusive ORed or head No. of device where data is stored. D The exclusive OR results are stored in D device.
DXOR Program example (1) Program that compares the X20 to 3F 32-bit data and the D9, 10 data when X6 turns ON, and stores the differing No. of bits in D16. X6 10 DXOR K8X20 SUM D9 D9 D16 Exclusive OR the X20 to 3F 32-bit data and D9, 10 data. Store the total No. of "1" bits of the D9 D16-bit data in D16. Coding No.
NEG { NEG ... Complement of 2 (BIN 16-bit data) Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D 2 Complement of 2 execution command NEG NEG D Setting data No. of device where data to D be complemented by 2 is stored. Function (1) The 16-bit data of the device designated with D is reversed and incremented by one, and then stored in the device designated with D.
NEG Program example (1) Program to calculate D10 - D20 when XA turns ON and obtain an absolute value when the results are negative. XA M3 < 10 D10 D20 M3 turns ON when D10 < D20 XA - 15 D10 D20 D10 D10-D20 is executed. M3 NEG D10 The absolute value (complement of 2) when M3 turns ON is obtalned. Coding No.
ROR { ROR ... Right rotation of 16-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D n 3 Right rotation command ROR ROR D n Setting data D No. of device where right ratation data is stored. n Times (0 to 15) Function The 16-bit data designated with D is rotated n bits to the right excluding the carry flag.
ROR Program example Program to rotate the D10 details 3 bits to the right when M0 turns ON. Coding No.
RCR { RCR ... Right rotation of 16-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Right rotation command RCR RCR D n Setting data D No. of device where right rotation data is stored. n Times (0 to 15) Function The 16-bit data designated with D is rotated n bits to the right including the carry flag. The carry flag must be set to 1 or 0 before executing RCR.
RCR Program example Program to rotate the D10 details 3 bits to the right when M0 turns ON. Coding No.
DROR { DROR ... Right rotation of 32-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Right rotation command DROR DROR D n Setting data D Head No. of device where right rotation data is stored. n Tim es (0 to 31) Function The 32-bit data designated with D is rotated n bits to the right excluding the carry flag.
DROR Program example Program to rotate the D10, 11 details 3 bits to the right when M0 turns ON. Coding XA DMOV 10 K1 D10 No.
DRCR { DRCR ... Right rotation of 32-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D n 3 Right rotation command DRCR DRCR n D Setting data D Head No. of device where right rotation data is stored. n Times (0 to 31) Function The 32-bit data designated with D is rotated n bits to the right including the carry flag. The carry flag must be set to 1 or 0 before executing DRCR.
DRCR Program example Program to rotate the D10, 11 details 3 bits to the right when M0 turns ON. Coding XA DMOV 10 K1 D10 M0 DRCR 15 D10 K3 (pulse coding) No.
ROL { ROL ... Left rotation of 16-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D n 3 Left rotation command ROL ROL D n Setting data D No.of device where left rotation data is stored. n Times (0 to 15) Function The 16-bit data designated with D is rotated n bits to the left excluding the carry flag. The carry flag must be set to 1 or 0 after executing ROL.
ROL Program example Program to rotate the D10 details 3 bits to the left when M0 turns ON. Coding No.
RCL { RCL ... Left rotation of 16-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Left rotation command RCL RCL D n Setting data D No. of device where left rotation datais stored. n Times (0 to 15) Function The 16-bit data designated with D is rotated n bits to the left including the carry flag. The carry flag must be set to 1 or 0 before executing RCL.
RCL Program example Program to rotate the D10 details 3 bits to the left when M0 turns ON. Coding No.
DROL { DROL ... Left rotation of 32-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Left rotation command DROL DROL D n Setting data D Head No. of device where left rotation data is stored n Tim es (0 to 31) Function The 32-bit data designated with D is rotated n bits to the left excluding the carry flag.
DROL Program example Program to rotate the D10, 11 details 3 bits to the left when M0 turns ON. Coding XA DMOV H80000000 D10 10 M0 DROL 15 D10 K3 (pulse coding) No.
DRCL { DRCL ... Left rotation of 32-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Left rotation command DRCL D DRCL n Setting data D Head No. of device where left rotation data is stored n Times (0 to 31) Function The 32-bit data designated with D is rotated n bits to the left including the carry flag. The carry flag must be set to 1 or 0 before executing DRCL.
DRCL Program example Program to rotate the D10, 11 details 3 bits to the left when M0 turns ON. Coding XA DMOV H80000000 D10 10 M0 DRCL 15 D10 K3 (Pulse coding) No.
SFR { SFR ... Right shift of 16-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Shift command D SFR SFR n Setting data D No. of device where shift data is stored. n No. of shifts Function (1) The 16-bit data of the device designated with D is shifted n bits to the right. n B15 ...........................................................
SFR Program example Program that shifts the details of D8 5 bits to the right when M10 turns ON. Coding No.
DSFR { DSFR ... Right shift of word device in batch Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 4 Shift command DSFR DSFR D n Setting data D Head No. of device to be shifted n Shift range Function (1) n points starting at the head of the device designated with D are shifted one point to the right.
DSFR Program example (1) Program to shift the details of D683 to 689 to the right when M10 turns ON. Coding No.
SFL { SFL ... Left shift of 16-bit data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation D n 3 Shift command SFL SFL D n Setting data D No. of device where shift data is stored. n No. of shifts Function (1) The 16-bit data of the device designated with D is shifted n bits to the left. (2) n bits from the lowest order are set to 0.
SFL Execution conditions The execution conditions for SFL are as shown below. ON Left shift command OFF SFL Executed per scan Executed per scan Program example (1) Program that shifts the details of D8 5 bits to the left when M10 turns ON. Coding No.
DSFL { DSFL ... Left shift of word device in batch Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation D n 4 Shift command DSFL DSFL n D Setting data D Head No. of device to be shifted n Shift range Function (1) n points starting at the head of the device designated with D are shifted one point to the left.
DSFL Program example (1) Program to shift the details of D683 to 689 to the left when M10 turns ON. Coding No.
SER { SER ... Search of 16-bit data Usable device Bit device X Y M L SM F Constant Word device T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 S2 D n 6 Setting data S1 No. of device where search data is stored. S2 Head No. of device to be searched D Head No. of device where search results are stored n No.
SER Program example Program to compare the data in D883 to D887 with 123 when XB turns ON. Coding No. of Comsteps mand XB SER 10 D0 D883 D10 K5 Device 10 LD XB 11 SER D0 D883 D10 K5 17 Search data 123 Search head No. D882 123 D883 10 D0 details Search results D884 500 D885 123 D886 Matched data Search range (5 data items) 20 D10 3 D11 2 D887 123 D10...Matched position D11...No.
SUM { SUM ... Count of No. of 16-bit data items set to 1 Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S D 4 Operation command SUM SUM S D Setting data No. of device to count S the total No. of bits set to 1 No. of device where the D total No. of bits is stored Function The total No. of bits in the 16-bit data of the device designated with S that are set to "1" is stored in D.
SUM Program example Program to obtain the No. of D10 data bits that are set to ON (1) when XB turns ON. Coding XB SUM 10 D10 D20 No. of steps Command 10 LD XB 11 SUM D10 15 Counter data B15 ............................................ B0 D10 1 1 0 0 0 0 1 0 0 0 1 0 0 0 1 1 D20 The total No.
DECO { DECO ... 8 256 bit decoding Usable device Bit device X Y M L SM F Constant Word device T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S D n 5 Decode command DECO DECO S D n Setting data S No. of device where data to be decoded is set. D Head No. of device to store the decoding results.
DECO Program example (1) Program to decode the three bits 0 to 2 of R20, and turn the bits corresponding in D100 ON. Coding No. of steps X0 DECO 10 D100 R20 K3 Command Device 10 LD X0 11 DECO R20 D100 K3 16 B15B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 0 0 R20 0 0 0 1 0 0 0 0 0 0 1 1 1 0 When bit 0 to 2 data is binary and 6.
SEG { SEG ... Decoding to 7-segment display data Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S D 3 Decode command SEG SEG S D Setting data S Decode data or No. of device where decode data is stored. D No. of device to store the decoding results. Function (1) The 0 to F data designated with the low-order 4-bit in S is decoded in the 7-segment display data and stored in D.
SEG 7-segment decode table S Hexadecimal D Configuration of 7-segment Bit pattern B7 B6 B5 B4 B3 B2 B1 B0 0 0000 0 0 1 1 1 1 1 1 1 0001 0 0 0 0 0 1 1 0 2 0010 0 1 0 1 1 0 1 1 3 0011 0 1 0 0 1 1 1 1 4 0100 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 B0 0101 5 6 0110 7 0111 8 1000 B5 B6 B4 B1 B2 B3 9 1001 A 1010 0 1 1 1 0 1 1 1 B 1011 0
S.AVE { S.AVE ... Calculation of average value Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation S D n 5 Average value command S.AVE S D n Setting data Head No. of device where S data to be averaged is stored. Device No. of output D destination n No.
S.AVE Execution conditions The execution conditions for S.AVE are as shown below. ON Average value command OFF S.AVE Executed per scan Executed per scan Program example (1) Program to average the details of D882 to D888 when XB turns ON, and to output the results to D0. Coding XB 10 S.AVE D882 D0 K7 No. of steps Command Device 10 LD XB 11 S.AVE D882 16 D882 123 D883 10 D884 500 7 data items D885 123 D886 20 D887 123 D888 123 Average value D0 Averaging of data with S.
S.STC, S.CLC { S.STC, S.CLC ... Setting/resetting of carry flag Usable device Bit device X Y M L SM F Constant Word device T C D R Z K Pointer Level P N H Digit No. of desigsteps Index nation 1 Input of carry flag set S.STC (Setting of carry flag) S.STC Input of carry flag reset S.CLC (Resetting of carry flag) S.CLC Function S.STC (1) The carry flag contact (SM12) is set (ON). S.CLC (1) The carry flag contact (SM12) is reset (OFF). Execution conditions The execution conditions for S.
S.STC, S.CLC Program example Program to add the D2 data and D0 data, both D0 and D2 are plus data, when M0 turns ON and to turn the carry flag (SM12) ON if the results exceed 32767. If the results are 32767 or less, the carry flag is turned OFF. M0 + 10 D2 D0 D1 M1 15 > D2 D1 > D0 D1 Add the D2 and D0 data, and store the results in D1. Turn M1 ON when (addition data D0) > (addition results D1) or (addition data D2) > (addition results D1). M1 22 S.STC Turn carry flag ON when M1 turns ON. S.
LDBIT, ANDBIT, ORBIT { LDBIT, ANDBIT, ORBIT ... Bit test of "A" contact handling Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 n 2 <= LDBIT n S1 (Note) Setting data <= ANDBIT S1 No.
LDBIT, ANDBIT, ORBIT Program example (1) Program to test bit 3 of D10. Coding 10 <= D10 (LDBIT) Y33 K3 No. of steps Command Device 10 LD<= D10 12 OUT Y33 K3 13 (2) Program to test bit 15 of D10. Coding M3 Y33 <= D10 (ANDBIT) 10 K15 No. of steps Command Device 10 LD M3 11 AND<= D10 13 OUT Y33 K15 14 (3) Program to test bit 15 of D10. Coding M3 (LDBIT) <= 10 Y33 D10 HF M8 No.
LDBII, ANDBII, ORBII { LDBII, ANDBII, ORBII ... Bit test of "B" contact handling Usable device Bit device X Y M Constant Word device L SM F T C D R Z K H Pointer Level P N Digit No. of desigsteps Index nation S1 n 2 <> LDBII n S1 (Note) Setting data ANDBII <> (Note) S1 S1 n n No.
LDBII, ANDBII, ORBII Program example (1) Program to test bit 3 of D10. Coding Y33 10 <> D10 (LDBII) K3 No. of steps Command Device 10 LD<> D10 12 OUT Y33 K3 13 (2) Program to test bit 15 of D10. Coding M3 <> 10 D10 K15 Y33 (ANDBII) No. of steps Command Device 10 LD M3 11 AND<> D10 13 OUT Y33 K15 14 (3) Program to test bit 15 of D10. Coding M3 10 (LDBII) <> Y33 D10 HF M8 No.
9. Exclusive Commands 9. Exclusive Commands Although the basic and functional commands are not used only for specific purposes, some commands may be efficient if command applications such as data transfer between under PLC and controller and controller display screen are limited. Then, the M300 series provides a number of exclusive commands which are explained below.
9. Exclusive Commands 9.1 ATC Exclusive Command 9.1.1 Outline of ATC Control The ATC (Automatic Tool Change) can be controlled in the following two ways: (1) Mechanical random control With the information of magazine position from the machine, and T command, the control system determines the direction of magazine rotation, number of steps required, etc. for index of the magazine, according to the given command. Each tool and magazine tool pot (socket) have a one-on-one corresponding relation.
9. Exclusive Commands 9.1.4 Relationship between Tool Registration Screen and Magazines When the floating pointer system or tool table rotation system is selected on the tool registration screen, correspondence display between the magazines and tools changes each time the magazine rotates; when the fixed pointer system is selected, it does not change.
9. Exclusive Commands 9.1.5 Use of ATC and ROT Commands The use order of the ATC and ROT commands during the T command or tool change command is shown below: T command Tool number search Register number of data searched No. of the same data ATC K1 Pointer or ring counter value Rotary body indexing ROT K1 Error processing Tool number AND search ATC K2 Rotation direction Magazine rotation Number of steps, etc.
9. Exclusive Commands (1) Index tool number 8 in the situation such as the figure (a) In the tool table rotation system, the tool number search command outputs 3. (b) In the floating pointer system, the tool number search command outputs 7. (2) The tool number search command output result is used by the rotary body indexing command to find the rotation direction, the number of steps, etc.
9. Exclusive Commands 9.1.7 Command List Command Description S.ATC K1 Rn Rm Mn Tool No. search S.ATC K2 Rn Rm Mn Tool No. logical product search S.ATC K3 Rn Rm Mn Tool change S.ATC K4 Rn Rm Mn Random position tool change S.ATC K5 Rn Rm Mn Pointer forward rotation S.ATC K6 Rn Rm Mn Pointer reverse rotation S.ATC K7 Rn Rm Mn Tool table forward rotation S.ATC K8 Rn Rm Mn Tool table reverse rotation S.ATC K9 Rn Rm Mn Tool data read S.
9. Exclusive Commands 9.1.9 File Register (R Register) Assignment and Parameters (1) File registers for ATC control The file registers used with the ATC are as shown below. Corresponding file (R) register No. 1 magazine Magazine T4-digit/T8-digit specifications T4digit No. 2 magazine T8digit T4digit Remarks (data type) No. 3 magazine T8digit T4digit T8digit — ATC control parameters R2950 No.
9. Exclusive Commands (2) Control parameter contents R2950 F E D C B A 9 8 7 6 5 4 3 2 Max. number of standby displayed: 4 1 0 0:T 4-digit 1:T 8-digit 0:Magazine starts from "1". 1:Magazine starts from "0". For details on the control parameters, refer to 9.1.12 Examples of Tool Registration Screen.
9. Exclusive Commands 9.1.10 Details of Each Command (1) Tool No. search This command is used to search for tool No. stored in the tool data table. When the command tool No. is found, number of searched data and its location are output. If two or more tool No. are found, the location of tool No. nearest to the pointer is output. ACT S.ATC K1 R500 R2960 M10 R500 530 R501 540 Register No. to store search data Register No. to which data output R530 234 R540 3 Location is "3". Output...
9. Exclusive Commands (2) Tool No. logical product (AND) search Tool number AND search is the same as the tool number search command (ATC K1) in function: search data and in-magazine tool number and AND data are ANDed together for a search. ACT S.ATC K2 R500 R2960 M10 R500 530 R501 540 R502 531 Register No. to store search data Register No. to which data output Register No.
9. Exclusive Commands (3) Tool change When a spindle tool and a magazine index tool are exchanged by the ATC arm, etc., the contents in the memory (R register) must be updated correspondingly. ACT S.ATC K3 R500 R2960 M10 R500 2970 Register No. to specify the position of tool change R501 Tool data (tool to be changed, usually tool in spindle) R2965 2 R2970 1234 R3000 1000 (0) R3001 1001 (1) R3002 1002 (2) : Pointer The content "1234" in the register which was specified by register No.
9. Exclusive Commands (4) Random position tool change In tool change, a spindle tool is usually exchanged with a magazine index tool. It may often occur, however, that tool change must be performed at a station other than the usual tool change position (tool change at auxiliary tool change position, for example). This command is used in such cases. ACT S.ATC K4 R500 R2960 M10 R500 2970 R501 540 Register No.
9. Exclusive Commands (5) Pointer "FWD" rotation In the ATC control with floating pointer, pointer count is controlled so that it coincides with the actually indexed magazine position when the magazine rotates in "FWD" direction for index. ACT S.ATC K5 R2965 R2960 M10 R2965 1 2 Pointer is incremented. When a magazine with 10 tools is used, the control sequence is as follows: 0, 1, 2, 3 ........ 9, 0, 1, 2, ........ 8, 9, 0, 1 ...
9. Exclusive Commands (7) Tool table "FWD" rotation The tool table rotates in "FWD" direction in accordance with the magazine rotation. ACT S.ATC K7 R2960 R2960 M10 R3000 1000 R3001 1001 : : : : R3010 1010 (Note 1) (Note 2) In this control mode, pointer always indicates "0" (tool table head). When this command is executed, the relationship between magazine No. and tool No., appearing on the tool entry display, changes accordingly.
9. Exclusive Commands (9) Tool data read This command is used to call a specific tool No. in the magazine. ACT S.ATC K9 R500 R2960 M10 R500 540 R501 545 R502 ---- R540 3 R545 1004 / 1005 R2965 2 R3000 Register No. to specify magazine No. to be read Register No. to specify position to which read data output Magazine No.
9. Exclusive Commands (10) Tool data write Instead of setting tool No. through the setting and display unit, the tool No. is entered to each magazine No. set through PLC program. ACT S.ATC K10 R500R2960 M10 540 R500 R501 545 R502 ---- R540 3 R545 1234 R2965 2 Register No. having magazine No. to which data is written Register No. where data to be written is stored Magazine No. to which data is written Data to be written Pointer R3000 1000 (0) 9 8 R3001 1001 (1) 10 9 : 1002 (2) MG.
9. Exclusive Commands (11) Automatic tool data write All tool Nos. are written (entered) in batch. This command is used for initialization, etc. The data are written one after another for each tool, starting from the default value. ACT S.ATC K11 R500 R2960 M10 R500 540 Register No.
9. Exclusive Commands 9.1.11 Precautions for Using ATC Exclusive Instructions (1) When tool data is rewritten by ATC or other than ATC command, tool registration screen display is not updated. The following processing is required: · Turn on special relay SM64 by using the SET command. Program example) ACT PLS M10 SET SM64 M10 · SM64 processing is not required for ATC commands ATC K5, K6 (forward rotation, reverse rotation of pointer), ATC K7, K8 (forward rotation, reverse rotation of tool table).
9. Exclusive Commands (1) Comment display part Comment in the comment display part is prepared by the user who uses the comment display function described in the PLC Development Software Manual (IB-1500177). (2) Spindle tool, standby tool display part The number of display items can be changed according to the control parameter value. Control parameter (R2950) F E D C B A 9 8 4 3 2 1 0 00: Only spindle tool is displayed. 01: Spindle tool and standby 1 are displayed.
9. Exclusive Commands 9.1.13 Display of Spindle Tool and Standby Tool The tool mounted on the spindle or the tool to be mounted next on the spindle (standby tool) and tool No. in the magazine are set and displayed on the tool registration screen. However, the spindle and standby tool Nos. can also be displayed on the position display screen and tool length measurement screen that are often used. With this, the changes in the magazine pot and spindle tool No.
9. Exclusive Commands 9.2 S.ROT Commands ROT commands are prepared as functions such as rotary body target position, rotation direction and ring counter. The commands can be used to determine the direction of rotation and number of steps with the data resulting from ATC exclusive command tool No. search processing. 9.2.1 Command List Command Description S.ROT K1 Rn Rm Mn Rotary body indexing S.
9. Exclusive Commands (1) Rotary body indexing Direction of rotation and number of steps of ATC magazine (or turret) are determined automatically. Rp Rn Parameter setting R No. Rn+1 Current position R No. Rn+2 Target position R No. Rn+3 Output R No. Indirect designation ACT S.ROT K1 R n R m Mm 0: Direction of rotation CW 1: Direction of rotation CCW (Note) CW or CCW output is controlled so that it takes a short circuit regardless of parameter specification.
9. Exclusive Commands (a) Example of rotary body index by ROT K1 instruction Conditions: (i) The number of rotary body index cycles is 6. (ii) The target position is specified by a T command. (Note) Normally the target position must be a binary, but in this example, the number of rotary body index cycles is 1 to 6, and there is no difference between the binary and BCD. Thus, the direct T command output file register R36 (B C D) is used.
9. Exclusive Commands ACT S.ROT K1 File register (R) map Rn Rm Mm (Note 5) Top of control data buffer (R500 in this example) 0:CW 1:CCW T command (from CNC) R number to specify rotary body index cycles (R511 in this example) R36 1~6 (BCD) R37 0 M1000 MOV K510 R500 R No. to store the parameter R500 510 MOV K512 R501 R No. to store the current position R501 512 MOV K36 R502 R No. to store the target position R502 36 MOV K513 R503 R No.
9. Exclusive Commands (Note 1) (Note 2) Either M202 or M203 can be used for a stop signal. The devices (X, Y, and R) are used in this example for no special purpose. Use any device within the available range. (Note 3) If a number from 1 to 6 has not been specified for current position data (R512) before the ROT command is activated, an error results. (Note 4) The control parameters (R510) are specified as follows: 1) Rotary body starts from 1 2) Take a short cut. 3) Calculate the number of steps.
9. Exclusive Commands (2) Ring counter (Up/down counter) This command is used to control position of rotary body (or turret). ACT S.ROT K3 R n R m Mm (Pulse coding) Completion ("1" for error) Cycles of index for rotary body are apecified. Ring counter command Control data buffer location is specified. Rn Rp Parameter setting R No. Counter setting R No. (File register No. which is the content in Rn+1 is actual ring counter.
9. Exclusive Commands 9.3 Tool Life Management Exclusive Command (When BASE SPEC parameter #1037 cmdtype is set to 1 or 2.) The following command is provided only for tool life management. (It is used for the machining centers.) 1. Spare tool selection ... TSRH ACT S.TSRH R n R m Mn Data output completion R number of top of spare tool data output buffer (for example, R1900~) R number where command tool number or group number is stored (for example, R36) 9.3.
9. Exclusive Commands 9.3.3 Spare Tool Selection System One of the following two can be selected by using a parameter for the spare tool selection system of the spare tool selection command in tool life management II: (1) Selection in tool registration order (When BASE SPEC parameter #1105 T-Sel2 is set to 0.) Spare tool is selected among the used tools of a single group in the registration number order. If used tools do not exist, spare tool is selected among unused tools in the registration number order.
9. Exclusive Commands 9.3.5 User PLC Processing When the Tool Life Management Function Is Selected A PLC processing example when tool change is made by the T command is given below: START (a) Does T command exist? NO YES Is life management selected? YES The control system varies depending on whether or not life management is selected. NO (b) Read life management tool data based on the R36 contents by using TSRH command.
9. Exclusive Commands (1) Procedure when tool command is executed (a) Tool life management I 1) When tool command (T command) is given, the controller outputs T code data and start signal (TF). (Note) The T code data (BCD) is binary converted and then used. 2) The user PLC checks the tool command. If life management is required, the user PLC executes the spare tool selection command. 3) The spare tool selection command outputs the tool data of the tool corresponding to the specified tool number.
9. Exclusive Commands When tool is changed, the spindle tool number is set in R3720, R3721. (User PLC) Spindle tool number (R3720-R3721) NC Tool data file (Controller internal data) Standby tool number (R3722-R3723) Spindle tool data (R3724-R3735) When the spindle tool number changes, the controller assumes that the spindle tool is changed, and searches the tool data file for the tool data of the new tool.
9.
9. Exclusive Commands (4) Tool data The tool data is tool management data such as the group number, tool number, and tool status. The details are given below: Tool data name Explanation Data range Group number Number to manage tools of the same type 1 - 99999999 (form and dimensions) in a group. The tools assigned the same group number are assumed to be spare tools.
9. Exclusive Commands (5) Tool data flag and tool status The tool data flag and tool status contents are shown below: (a) Correspondence with tool life management data screen Release status For example, this can be used for setting the release status of the final tool to "1" and judging whether the tool is the final tool or not. (b) Tool data flag .....
9. Exclusive Commands 1) Spare tool compensation system Tool compensation corresponding to the spindle tool can be made in tool life management II. One of the following three types of length and compensation can be selected by setting tool data: i) Compensation umber system (0 is set on the tool data registration screen.) Compensation data in tool data is handled as the compensation number. It is replaced with the compensation number given in a work program and compensation is executed.
9. Exclusive Commands (c) Tool status ..... Bits 8~F of file register Rn (such as R3728) bit Explanation bit 8 Tool status (numeric data 0~4) 0: Unused tool 1: Used tool 2: Normal life tool 3: Tool error 1 tool 4: Tool error 2 tool Release status For example, this can be used for setting the release status of the final tool to "1" and judging whether the tool is the final tool or not.
9. Exclusive Commands 9.3.6 Examples of Tool Life Management Screen Tool life management screen examples are given below. For operation, refer to the Operation Manual.
9. Exclusive Commands 9.4 DDB (Direct Data Bus) ... Asynchronous DDB The DDB function is used for PLC to directly read/write various pieces of data that controller has. PLC can read specified data into buffer or write specified data into controller by storing necessary information for read/write and calling the DDB function. Generally, data is read or written for each data piece; data concerning the control axes is processed in batch as many as the specified number of axes. 9.4.
9. Exclusive Commands (1) Control signals (Rn), (Dn) F E D C B A 9 8 7 6 5 4 3 2 1 0 0: Read designation 1: Write designation Warning output 0: Direct input 1: Addition input Error during chopping (not used) Set by PLC during execution of DDB command No option 0: Decimal point invalid 1: Decimal point value Size over No. of axes illegal Set by CNC When DDB command is completed Large section No.
9. Exclusive Commands (6) Read/write data (Rn+6, Rn+7), (Dn+6, Dn+7) (LOW) (HIGH) (LOW) (HIGH) When data is read, the controller outputs data specified by PLC. When data is written, PLC sets the data to be written. 2-byte data 1-byte data Rn+6 (Dn+6) Rn+6 (Dn+6) Rn+7 (Dn+7) Rn+7 (Dn+7) 4-byte data H L Rn+6 (Dn+6) H Rn+7 (Dn+7) L The effective portion of data varies depending on the data size. (Hatched portion) When read is specified the sign of 1-byte or 2-byte is extended to four bytes.
9. Exclusive Commands 9.5 External Search 9.5.1 Function When PLC specifies the program number, sequence number, and block number of a work program for the controller, the external search function searches memory or tape for the program number, sequence number, and block number. 9.5.2 Interface PLC sets data except the status. Rn+0 Two bytes command 1 Two bytes Status 2 Four bytes Program No. Four bytes Sequence No.
9. Exclusive Commands (2) Status The search state is indicated. The status is set by the controller and is used by PLC for completion check, etc. F 8 3 2 1 0 External search No option Data specification error Search processing Search completion Search error completion The status is cleared by the controller when the search start instruction execution condition is off. (3) Program number Specify the program number to be searched in binary form in the range of 1 to 99999999 (eight digits).
9. Exclusive Commands 9.5.3 Search Start Instruction After interface data between the controller and PLC is prepared, search is started by using the following instruction: ACT S.DDBS (Start condition) Rn (Rn is any file register that can be used by the user.) 9.5.
9. Exclusive Commands (3) Search error completion (Data specification error) Search start instruction condition Program number and sequence number are not specified. Program number or sequence number is specified beyond the range.
9. Exclusive Commands 9.5.5 Sequence Program Example Search start memo MOV Rn+1 K4M00 Search start memo M15 External search status is transferred to M00~M15. F15 Data specification error F15 RST Search start M2 memo F2 Search error completion F2 RST Search start button MEM Automatic operation RST Search start memo TAPE Search start memo Search start memo Completion cause Search start pulse Search start pulse MOV Kon Rn+2 O NO. set MOV Knn Rn+4 N NO. set MOV Kbn Rn+6 B NO.
9. Exclusive Commands 9.6 Chopping With this function, the chopping axis constantly moves back and forth independently of the program operation during executing the program. By applying chopping, higher surface accuracy can be achieved than that of abrasive grain. The chopping operation is started/stopped by the "Chopping" signal from the PLC. When the chopping operation is commanded from the machining program, use the auxiliary instruction (M or B) codes.
9. Exclusive Commands 9.6.1 Chopping operation start The chopping mode is entered at the rising edge of the "Chopping" signal (Y1E8), and the chopping operation is started based on the position determined with the program, etc. The chopping control sequence is the following. • When the chopping axis is not moving, chopping is started immediately. • When the chopping axis is moving, chopping is valid from the next block in the automatic mode, and an operation alarm will occur in the manual mode.
9. Exclusive Commands (2) In manual mode In the jog and step mode, when the chopping axis is not moving, the chopping operation is started at the rising edge of the "Chopping" signal. If the "Chopping" signal is turned ON when the chopping axis is moving, the OPERATION ALARM 0154 will occur, and the chopping will not be started. (Rising edge of the "Chopping" signal is ignored.
9. Exclusive Commands 9.6.2 Chopping operation stop The chopping operation is stopped at the falling edge of the "Chopping" signal from the PLC. The chopping axis moves to the basic position with the rapid traverse after executing the chopping operation to the upper dead center point. The chopping axis once moves to the bottom dead center point even while moving from the upper dead center point to the bottom dead center point.
9. Exclusive Commands 9.6.3 Chopping compensation Because this function involves high-speed repetitive motions, the positioning method allowing compensation based on the calculation from the machinery operation (feedback position of the motor end) is adopted, rather than the method using in-position check. Compensation amount used for positioning is calculated every 4 cycles from the start of chopping operation, based on the difference between the commanded position and feedback position.
9. Exclusive Commands (1) Compensation value sequential update method Every chopping command starts with "0" compensation amount. Compensation amount is calculated every 4-cycle chopping operation, and the compensation is carried out. (2) Compensation value fixed method Compensation value fixed method includes the record mode and the playback mode.
9. Exclusive Commands Chopping start Record mode? No (Playback mode) Yes Set the initial compensation amount to "0". Set the compensation data in the record area as the initial compensation amount. Perform chopping operation using the initial compensation amount. Perform chopping operation using the initial compensation amount. Record the compensation amount in the record area.
9. Exclusive Commands 9.6.4 Chopping interface (1) PLC→NC Device No. Abbreviation Y1E8 CHPS Signal name Chopping (2) NC→PLC In chopping start, intervals during chopping and chopping mode are output. Device No.
9. Exclusive Commands 9.6.5 Parameters (DDB function instructions from PLC) Parameters for chopping functions (DDB function instructions from PLC) are as follows.
9. Exclusive Commands (2) Control data Data to be used differs depending on whether the compensation value sequential update method is applied or compensation amount fixed method is applied. Update : Specify with the compensation value sequential update method Fixed : Specify with the compensation value fixed method Rn a Rn+1 b Rn+2 c Rn+4 d Rn+5 e Rn+6 f Rn+8 a: Control status b: bit0 : Set to "1". bit1 : Set to "0".
9. Exclusive Commands Rn bit BITA Error Cause There is no specification for chopping. Option error BITF BITB Compensation BITF method error BITC Illegal BITF axes error BIT9 Chopping error BITF number Compensation method is set to other than 0(Compensation value sequential update type) or 1(Compensation value fixed type). of Multiple chopping axes are specified by the PLC interface. Chopping axis is not specified by either PLC interface or parameter.
9. Exclusive Commands (3) Compensation amount record area (Dedicated for compensation value fixed method) Rm is specified with the parameter (#1324 chop_R). Rm a Rm+1 b Rm+2 c Rm+4 d Rm+5 e Rm+6 f Rm+8 g Rm+10 h a: b: Error status (in playback mode) (Rm) bit0 : This is turned ON when the difference between the commanded stroke and the actual stroke has exceeded the tolerance set with the parameter (#2080 chwid).
9. Exclusive Commands (4) Setting example for the compensation value sequential update method The following parameters are set using R2000 to R2011 as DDB buffer.
9. Exclusive Commands (5) Setting example for the compensation value fixed method The following parameters are set using R2000 to R2013 as DDB buffer. R2100 (#1324 chop_R = 2100) is used for the compensation amount record area.
9. Exclusive Commands 9.6.6 Example of chopping control by program command In the example given below, the upper dead center point (increment from the basic position), bottom dead center point (increment from the upper dead center point), and number of cycles (times/min) are set using G code macro. The above data is set to the local variables by G code macro. The local variable data is read by the ladder upon execution of M code (M10). Then, chopping is started upon DDB function instruction.
9. Exclusive Commands (2) Set the local variables of (1) for chopping parameters by using DDB function, and start the chopping operation. The following is its sequence example.
9. Exclusive Commands Sequence example timing chart M code data (R20):10 :11 :Other Chopping start memo M0 Chopping start pulse M1 Chopping stop memo M2 In chopping M3 (Note) Chopping axis cannot be specified as a synchronous control axis.
10. PLC Help Function 10. PLC Help Function To help the user PLC, an exclusive interface is provided between the user PLC and controller or PLC basic. The function and interface are explained below.
10. PLC Help Function 10.1 Alarm Message Display There are two types of alarm message, which can be selected with a parameter (described later) Format External alarm message Max. No. of messages 256 messages 256 messages Max. data length 32 bytes per message 128 bytes per message Number of Display messages 1 to 4 messages 4 messages (according to data length) F type / R type Interface 10.1.1 Alarm message F type / R type (classification No. designated) (without classification No.
10. PLC Help Function (2) R type interface This interface applies to file registers R158~R161. The numeric value (binary) contained in each of the R registers indicates the position of the message to be displayed in the message table. The message is cleared by setting the R register to 0. Message processing module 1 R158 First message of message table is displayed (dn1). 0 R159 20th message of message table is displayed (dn2). 20 R160 Fifth message of message table is displayed (dn3).
10. PLC Help Function 10.1.2 Screen Display Screen Display depends on the message type as described below. (1) Alarm message type Message length is up to 32 characters. Alarm messages corresponding to four classification Nos. can be displayed. Display example EMG EMERGENCY STOP ALARM / DIAGN 1 PLC Alarm message 1 starts Alarm message 2 starts Alarm message 3 starts Alarm message 4 starts .................. .................. ..................
10. PLC Help Function Note that the number of displayed external alarm messages depends on their number of characters. Number of External alarm message characters 0 to 32 characters 33 to 64 characters 4 messages displayed 2 messages displayed Alarm message 1 starts...............…..... ....................... Alarm message 1 ends Alarm message 1 starts............1 ends Alarm message 2 starts............2 ends Alarm message 3 starts............3 ends Alarm message 2 starts....................... ....
10. PLC Help Function (a) Input with text data format 1) Format of the text file Format of the message text is shown below. JPN01 96-12-01 ↓ (i) Version data 256 * 16,0 ↓ (ii) Number of characters / messages and language designation alarm_message001alarm_message0 (iii) Character string of PLC alarm message 02alarm_message003• • • • • • • • • • • • • Language No.
10. PLC Help Function (Note 1) Always add a return code (CR + LF) in each Even if version data is not necessary, return code is needed. When a message text file without a return code is used, “E86 INPUT DATA ERR” error will occur. (Note 2) Make sure so that the number of all characters designated in (ii) conditions (number of characters for one message ° number of messages = number of all characters) is the same as the total number of message characters set in (iii).
10. PLC Help Function 10.1.4 Parameters (1) PLC alarm message selection parameter [Bit selection parameter screen] # (6450) Data 7 6 5 4 3 2 1 0 (0 1 0 0 0 0 0 0) Bit 0: PLC alarm message display in user PLC 1: External alarm message display Use number 6450. The operation is as the following depending on the bit state of the bit selection #6450. Bit 6 = 0 The PLC alarm message in the user PLC is displayed as usual.
10. PLC Help Function (3) F or R Type Selection Parameter Set the parameter on the bit selection screen of PLC parameter (setup para). [Bit selection parameter screen] # (6450) Data 7 6 5 4 3 2 1 0 (0 0 0 0 0 0 * 1) Bit 0: Alarm message invalid. 1: Alarm message valid. Use number 6450. 0: F type interface 1: R type interface [Reference] #6450 corresponds to the high-order byte of the file register R2924.
10. PLC Help Function 10.2 Operator Message Display When a condition to inform the operator of a message occurs, an operator message can be displayed independently of an alarm message. A maximum of 60 characters can be displayed for the operator message on the alarm diagnosis screen. One operator message can be displayed at a time. 10.2.1 Interface An operator message is displayed by setting the number of the operator message table to be displayed in file register R162.
10. PLC Help Function 10.2.2 Operator Message Preparation Create messages by using PLC development software (GX Developer). (Note1) According to the description format, set the number of characters for one message and the number of messages to be prepared, then prepare message data. The maximum length of an operator message is 60 characters. A maximum of 512 operator messages can be prepared. For details, refer to "PLC Development Software Manual (IB-1500177)".
10. PLC Help Function 10.3 PLC Switches Similar function to machine operation switches can be provided by using the controller setting and display unit. The number of switch points is 32. The switch names can be given as desired. 10.3.1 Explanation of Screen The screen is explained below. PARAMETER SCREEN PLC SWITCH (MENU) Corresponding to X140, SM80 Corresponding to Y160 Switch mark [PLC-SWITCH] PARAM 6.
10. PLC Help Function 10.3.2 Explanation of Operation To turn on or off a switch, set the number of the switch to be turned on or off in the parentheses of INPUT setting part # ( ) and press the CALC key. Depending on the state of the switch, its input device X is turned on (off) and accordingly the switch mark indicates the on (off) state. [PLC-SWITCH] When the optional stop is to be turned on: # 1 Set 4 in # ( ). 2 3 4 5 Press the INPUT key.
10. PLC Help Function The table below shows the message displayed during operation on the PLC switch screen. No. Message Remedy A number outside the allowable setting range from 1 to 32 is specified in # ( ). SETTING E01 ERROR 10.3.3 Explanation Specify a valid number within the range. Signal Processing [PLC-SWITCH] PARAM 6. 1/2 The characters are highlighted.
10. PLC Help Function The following shows an example of operation of special relay SM from the user PLC.
10. PLC Help Function (2) Three-point switch (Example) When three opposite switches 17, 18, and 19 are provided; X150 X151 X152 Y170 SET X150 X151 X152 M3 M3 SM96 X150 X151 X152 RST X150 X151 X152 M3 Y171 SET X150 X151 X152 When SM96 turns on, X150 turns off. M4 M4 SM97 When SM97 turns on, X151 turns off. X150 X151 X152 RST X150 X151 X152 Y172 SET X150 X151 X152 M4 M5 M5 SM98 When SM98 turns on, X152 turns off.
10. PLC Help Function (3) External switch and PLC switch (Example 1) When an external optional stop switch (X14) is provided; X14 X143 SET M8 RST M9 SET M9 RST M8 PLS M6 RST M8 PLS M7 RST M9 X14 X143 X14 X143 M8 X14 X143 M9 M6 SM83 M7 X143 Y163 Under sequence control in the above example, the switch marks on the PLC switch screen can be operated from both external and PLC switches.
10. PLC Help Function 10.3.4 Switch Name Preparation Prepare PLC switch names by using PLC development software (GX Developer). (Note1) According to the description format, set the number of characters for one switch name and the number of switch names to be prepared, then prepare switch name data. The maximum length of a switch name is 14 characters. A maximum of 32 switch names can be prepared. For details, refer to "PLC Development Software Manual (IB-1500177)".
10. PLC Help Function 10.4 Key Operation by User PLC The same operation as if the operator performed key operation can be performed by operating key data by user PLC. 10.4.1 Key Data Flow (a) R16 (b) For monitor User PLC (c) Valid key data processing (CNC) (d) R112 (a) Key data is set in file registers R16 and R112 at the top of the user PLC main. (b) The user PLC refers to the key data and performs necessary processing.
10. PLC Help Function 10.4.3 Key Data Processing Timing Key data is processed at the timing shown below. Set data in R112 only when it is necessary. Normal key operation by the operator is made impossible. 100ms or longer (100 ~ 300ms is adequate.) R112 NULL (00H) NULL (00H) If no data is set for R112, R112 is returned to NULL (00H). Target key data is set. Example) ATC signal MOV H00 R112 ATC signal is turned on only for 100 ~ 300ms.
10. PLC Help Function 10.4.4 Layout of Keys on Setting and Display Unit The layout for the keys on the setting and display unit (display unit + keyboard unit) used with this controller is shown below. Alphabetic character, numerical character, and symbol keys READY LED Function selection keys Setting keys READY MONITOR TOOL PARAM EDIT MDI DIAGN IN/OUT SFG F0 O N G A B C 7 8 9 X Y Z U V W 4 5 6 F D H E L ! P Q R 1 2 3 - 0 I J .
10. PLC Help Function 10.4.5 List of Key Codes The code correspondences for the keys and R16, R112 are shown below.
10. PLC Help Function 10.5 Load Meter Display The load meter can be displayed by setting a value in the designated file register (R) with the ladder program. The spindle load, Z axis load, etc. characters and scale are created with comments in the PLC development software (GX Developer) message function. For details, refer to "PLC Development Software Manual (IB-1500177)". (Note 1) 10.5.1 PLC Onboard does not include the switch name creation function.
10. PLC Help Function File register (R) for load meter display Load meter 1 Load meter 2 Numerical display R152 Bar graph display R153 Numerical display R154 Bar graph display R155 Display example (Note) This screen consists of 80 characters wide x 18 lines long.
10. PLC Help Function 10.6 External Machine Coordinate System Compensation External machine coordinate system compensation is executed by setting compensation data (absolute amount) in the PLC file register (R) for each axis. Thus, the compensation timing is when PLC rewrites file register (R) compensation data. Necessary condition, timing, etc., are set by user PLC. The interface between user PLC and CNC is shown below.
10. PLC Help Function 10.7 User PLC Version Display The user PLC version can be displayed together with the controller software version on the DIAGN/IN/OUT menu changeover configuration (menu) screen of the setting and display unit. (Note) 10.7.1 The user PLC must be controlled by the user. Interface Data corresponding to the characters to be displayed on the corresponding file register (R) is set.
10.
11. PLC Axis Control 11. PLC Axis Control 11.1 Outline This function allows an independent axis to be controlled with commands from the PLC, separately from the NC control axis. 11.2 Specifications 11.2.1 Basic Specifications Item Details No. of control axes Max. 2 axes Simultaneous control axes The PLC control axis is controlled independently of the NC control axis. Simultaneous start of multiple PLC axes is possible. Min. command unit 0.001mm (0.0001 inch) 0.0001mm (0.
11. PLC Axis Control 11.2.2 Other Restrictions (1) There is no mirror image, external deceleration or machine lock function. (2) Rapid feed override, cutting override and dry run control are not possible. (3) Automatic operation start, automatic operation stop, reset and interlock NC controls are invalid for PLC control axes. The same control can be realized using an interface dedicated for PLC control axes. (4) There is no dedicated emergency switch.
11. PLC Axis Control 11.3 PLC Interface The interface between the PLC and NC is carried out by setting the control information data in the R-register (Note 1) with the PLC, and calling the DDBS function. 11.3.1 S.DDBS Function Command (Note 1) ACT S.DDBS Rn When ACT is set to 1, the PLC axis control process is carried out with the control information data contents. Thus, ACT should be set to 1 during PLC axis control. Setting ACT to 0 causes a reset status.
11. PLC Axis Control 11.3.2 Control Information Data Set the control information data in the R-register before calling the DDBS function command. The following is a list of control information data.
11. PLC Axis Control 11.3.3 Control Information Data Details 11.3.3.1 Commands Commands consist of main commands and sub-commands. Rn + 0 F 8 7 0 Sub-commands Main commands Main commands: The types of DBBS main commands are as follows. 1: Search 2: PLC axis control Sub-commands: The PLC axis control sub-command is as follows. 0: Movement data output and control signal output (Note 1) "Input" and "output" are the input/output looking from the PLC side.
11. PLC Axis Control 11.3.3.2 Status The status is set by the NC to indicate the execution status of this function command and the status of the axis being controlled.
11. PLC Axis Control bit 8: oper Option error (not used) bit E: ALM2 Axis in control alarm This bit turns ON when an alarm occurs (such as a servo alarm) during execution of axis control. Axis control cannot be executed while this bit is ON. After the cause of the alarm has been removed, turn the bit OFF by turning a reset signal ON, setting ACT to 0, or turning the power OFF then ON again. (Note) When alarms occur during axis control, the same alarms appear in the screen as for NC control axes.
11. PLC Axis Control Timing chart (1) For rapid traverse and cutting feed mode ACT Start busy den move Speed (2) For jog feed mode ACT Start busy den move Speed (Note) The axis moves by jog feed only during start ON.
11. PLC Axis Control (3) For reference point return feed mode (3-1) Dog-type reference point return ACT Start busy den move ZP (G1 mode) Speed (Note 1) The axis moves by reference point return feed only during start ON. Turn the start OFF after confirming that the reference point has been reached. (Note 2) The first reference point return after the power is turned ON is always dog-type. All returns after that are high-speed reference point returns.
11. PLC Axis Control (4) For handle feed mode ACT Start busy den move Handle Speed (Note) Handle feed is possible only during start ON.
11.
11.
11. PLC Axis Control 11.3.3.3 Alarm No. The alarm Nos. of status ALM1 and ALM2 are set. F 8 7 0 ALM1 Alarm No. ALM2 Alarm No. The details of each alarm No. are shown below. (1) ALM1 (Control information data designation alarm) Alarm No. Details 01 Control signal illegal (A signal other than a registered control signal has been commanded.) 02 Axis No.
11. PLC Axis Control 11.3.3.4 Control Signals (PLC axis control information data) Control signals such as start, interlock, reset, axis removal and axis removal 2 are designated for the PLC axis. F E D C B A 9 8 7 6 5 4 3 2 1 0 Rn + 3 bit 0: Start 1: Interlock 2: Reset 3: Servo OFF 4: Axis removal 5: Axis removal 2 6: 7: bit 8 : Absolute value command 9: A: B: C: D: E: F: bit 0: Start Starting begins at the at the rising edge (OFF -> ON) of the start signal, based on the control information data.
11. PLC Axis Control bit 5: Axis removal 2 The axis will execute a deceleration stop, and a servo OFF/ready OFF status will result, when the axis removal 2 signal turns ON. A servo ON/ready ON status will result for the stopped PLC axis when the axis removal 2 signal turns OFF (is canceled). A restart must be executed to start the movement again. Position control cannot be carried out while the axis removal 2 signal is ON. However, position detection is possible so the position will not be lost.
11. PLC Axis Control 11.3.3.5 Axis Designation The axis No. of the PLC axis is designated. Rn + 4 Axis designation 0: 1st axis 1: 2nd axis 11.3.3.6 Operation Mode The operation mode for the PLC axis is designated. For example, in the handle mode, Rn+5=6 (DATA) is set.
11. PLC Axis Control 11.3.3.7 Feedrate When the operation mode is cutting feed or jog feed (Rn + 5 = 1 to 3), the PLC axis feedrate is designated with a binary code. Rn + 6 7 Feedrate Designation value 1 to 1000000mm/min (0.1inch/min) (Note 1) The feedrate designated in the parameters is used for the rapid traverse mode and reference point return mode. (Note 2) The feedrate can be changed during axis movement. In that case, change using a direct feedrate data (Rn + 6, 7) is possible. 11.3.3.
11. PLC Axis Control 11.3.3.9 Machine Position The machine position output to the machine system is expressed. The machine position becomes the rfp (reference point) when the reference point is reached. Rn + 10 Machine position (input unit) 11 11.3.3.10 Remaining Distance The remaining distance of the movement data output to the machine system is expressed.
11. PLC Axis Control 11.3.4 Reference Point Return Near Point Detection Set the near point dog signal of the PLC axis reference point return for the following devices in the PLC. Device No. Y2E0 *PCD1 Y2E1 *PCD2 Signal name PLC axis PLC axis PLC axis near point detect 1st axis PLC axis near point detect 2nd axis Y2E2 Y2E3 Y2E4 Y2E5 Y2E6 Y2E7 (Note) The responsiveness when the dog signal is set in PLC middle-speed processing is worse than when set in PLC high-speed processing.
11. PLC Axis Control 11.3.5 Handle Feed Axis Selection The axis is designated for the following devices when handle feed is carried out with a PLC axis. Device No. Signal name Y2E0 Y2E1 Y2E2 Y2E3 Y2E4 PCH1 PLC axis 1st handle valid Y2E5 PCH2 PLC axis 2nd handle valid Y2E6 Y2E7 When Y2E4 and Y2E5 are ON, each handle changes to PLC axis dedication. Y248 to Y24C, Y24F, Y250 to Y254 and Y257 usually used in the control device are used for the axis selection of each handle.
12. Appendix 12. Appendix 12.1 Example of Faulty Circuit Wrong configurations of circuits are shown below. Correct the circuitry, if any. Correct circuit Faulty circuit producing errors (1) Circuit containing OR (2) Rounding circuit X1 X2 X3 Y10 X1 Y11 X2 X3 X1 X2 X3 X4 X4 Y10 X4 Necessity Y11 Whether or not the Y10 condition includes X3, X4 and X2 is unknown.
Revision History Date of revision Manual No. April. 2006 IB(NA)1500178-A Revision details First edition created.
Global service network NORTH AMERICA FA Center CHINA FA Center EUROPEAN FA Center KOREAN FA Center ASEAN FA Center HONG KONG FA Center TAIWAN FA Center North America FA Center (MITSUBISHI ELECTRIC AUTOMATION INC.) Illinois CNC Service Center 500 CORPORATE WOODS PARKWAY, VERNON HILLS, IL. 60061, U.S.A. TEL: +1-847-478-2500 (Se FAX: +1-847-478-2650 (Se California CNC Service Center 5665 PLAZA DRIVE, CYPRESS, CA. 90630, U.S.A.
Notice Every effort has been made to keep up with software and hardware revisions in the contents described in this manual. However, please understand that in some unavoidable cases simultaneous revision is not possible. Please contact your Mitsubishi Electric dealer with any questions or comments regarding the use of this product. Duplication Prohibited This manual may not be reproduced in any form, in part or in whole, without written permission from Mitsubishi Electric Corporation.