Beginner guide (986746), страница 20
Текст из файла (страница 20)
Defines the end of step execution when usedwithout a control bit.Starts the execution of the step when used with a control bit.Step InstructionsInstructionSTEP DEFINEMnemonicSTEPSTEP STARTSNXT09Peripheral Device Control InstructionsInstructionBCD TOBINARYBINARY TOBCD4 to 16DECODER16 to 4DECODERMnemonic(@)BINCode23FunctionConverts 4-digit BCD data to 4-digit binary data.(@)BCD24Converts 4-digit binary data to 4-digit BCD data.(@)MLPX76(@)DPMX77(@)ASC86Takes the hexadecimal value of the specified digit(s) in a word andturn ON the corresponding bit in a word(s).Identifies the highest ON bit in the specified word(s) and moves thehexadecimal value(s) corresponding to its location to the specifieddigit(s) in a word.Converts the designated digit(s) of a word into the equivalent 8-bitASCII code.ASCII CODECONVERTC-510.Appendix C- Programming InstructionsI/O Units InstructionsInstruction7-SEGMENTDECODERI/O REFRESHMnemonic(@)SDEC(@)IORFCode7897FunctionConverts the designated digit(s)of a word into an 8-bit, 7-segment display code.Refreshes the specified I/O word.Display InstructionsInstructionMEASSAGEMnemonic(@)MSGCode46FunctionReads up to 8 words of ASCII code (16 characters) from memory and displaysthe message on the Programming Console or other Peripheral Device.High Speed Counter Control InstructionsInstructionMODECONTROLPV READCOMPARETABLE LOADMnemonic(@)INI(@)PRV(@)CTBLCode616263FunctionStarts and stops counter operation, compares and changes counter PVs, andstops pulse output.Reads counter PVs and status data.Compares counter PVs and generates a direct table or starts operation.Damage Diagnosis InstructionsInstructionFAILUREALARMSEVEREFAILUREALARMMnemonic(@)FALFALCode0607FunctionGenerates a non-fatal error when executed.
The Error/Alarm indicator flashesand the CPU continues operating.Generates a fatal error when executed. The Error/Alarm indicator lights andthe CPU stops operating.Special System InstructionsInstructionSET CARRYCLEAR CARRYMnemonic(@)STC(@)CLCCode4041FunctionSets Carry Flag 25504 to 1.Sets Carry Flag 25504 to 0.C-610.Appendix C- Programming InstructionsInstruction available in CPM2A onlyData ConversionInstructionDOUBLE BCDTO DOUBLEBINARYDOUBLEBINARY TODOUBLE BCDMnemonic(@)BINLCode58FunctionConverts BCD value in two consecutive source words into binaryand outputs converted data to two consecutive result words(@)BCDL59Converts binary values in two consecutive source words into BCDand outputs converted data two consecutive result words..Expansion InstructionSerial Communication InstructionInstructionRECEIVETRANSMITMnemonic(@)RXD(@)TXDCode4748FunctionReceives data via a communication port.Sends data via a communication port.Scaling Conversion InstructionInstructionSCALESIGNED BINARYTO BCDMnemonic(@)SCL(@)SCL2Code66--BCD TO SIGNEDBINARY(@)SCL3--ASCII-TOHEXADECIMAL2'SCOMPLEMENT(@)HEX--(@)NEG--FunctionPerforms a scaling conversion on the calculated value.Linearly converts a 4-digit signed hexadecimal value to a 4 digitBCD value.Linearly converts a 4-digit BCD value to a 4 digit signedhexadecimal valueConverts ACSII data to hexadecimal data.Converts the four digit hexadecimal content of the source wordto its 2's complement and outputs the result to R.Data Search/Finds InstructionInstructionDATA SEARCHMnemonic(@)SRCHCode--FINDMAXIMUMFIND MINIMUM(@)MAX--(@)MIN--FunctionSearches the specified range of memory for the specified data.Outputs the word address(es) of words in the range that contain thedata.Finds the maximum value in the specified data area and outputsthat value to another word.Finds the minimum value in the specified data area and outputsthat value to another word.C-710.Appendix C- Programming InstructionsCalculation InstructionInstructionSUMCALCULATEFCSCALCUTLATEAVERAGECALCULATEMnemonic(@)SUMCode--(@)FCS--AVG--FunctionComputes the sum if the contents of the words in the specifiedrange of memory.Check for errors in data transmitted by a Host Link command.Adds the specified number if hexadecimal words and computes themean value.
Rounds off to 4 digits past decimal point.Instruction available in CPM2A onlyExpansion Instruction (continue)Data Compare InstructionInstructionAREA RANGECOMPAREMnemonicZCPDOUBLE AREARANGECOMPAREZCPLCode--FunctionCompare a word to a range defined by lower and upper limits andoutputs the result to the GR,EQ and LE flags.--Compares an 8-digit value to a range defined by lower and upperlimits and outputs the result to the GR, EQ and LE flags.Control InstructionInstructionPULSE WIDTHVARIABLEDUTY RATIOPID CONTROLACCELERATIONCONTROLMnemonic(@)PWMPID(@)ACCCode-----FunctionOutputs pulses with the specified duty ratio (0% to 99%)Performs PID control based on the specified parameters.Together with PULS(-), ACC(-) controls the acceleration and/ordeceleration of pulses output.Special Instruction on Timing ControlInstructionVERY HIGHSPEED TIMERMnemonicTMHHCode--FunctionA high speed, decrementing ON-delay timer that times in 1-msunitsLONG TIMERSTARTSYNHRONIZEDCONTROLTIML(@)SYNC---A decrementing ON-Delay timer with SV of up to 99,990.Multiples an input pulse frequency by fixed scaling factor andoutputs pulses from the specified output at the resulting frequency.C-810.Appendix E- PC SetupCPM1A PC Setup SettingsThe PLC Setup is broadly divided into four categories: 1) Settings related to basic PLC operationand I/O processes, 2) Settings related to the cycle time, 3) Setting related to interrupts, and 4)Settings related to communications.
This section will explain the settings according to theseclassifications.The following table shows the settings for CPMlA PLCs in order.Word(s)Bit(s)FunctionStartup Processing (DM 6600 to DM 6614)The following settings are effective after transfer to the PLC only after the PLC is restarted.DM 660000 to 0708 to 15DM 660100 to 0708 to 1112 to 15DM 660200 to 0304 to 07DM 6603DM 6604DM 6605 toDM661408 to 1100 to 1500 to 0708 to 1500 to 15Startup mode (effective when bits 08 to 15 are set to 02).00: PROGRAM; 01: MONITOR 02: RUNStartup mode designation00: Programming Console switch01: Continue operating mode last used before power was turned off02: Setting in 00 to 07Not Used.
(Set 0 00.)IOM Hold Bit (SR 25212) Status0: Reset; 1: MaintainForced Status Hold Bit (SR 25211) Status0: Reset; 1: MaintainProgram memory write-protection0: Program memory unprotected1: Program memory write-protected (except DM 6602 itself)Programming Console display language0: English; 1: JapaneseNot Used.Not Used.00: A memory error will not be generated if data could not be retained by the battery.01: A memory error will be generated if data could not be retained by the battery.Not Used.Not Used.Cycle Time Settings (DM 6615 to DM 6619)The following settings are effective after transfer to the PC the next time operation is started.DM 6615,00 to 15Not Used.DM6616DM 661700 to 07Servicing time for peripheral port (effective when bits 08 to 15 are set to 01)00 to 99 (BCD): Percentage of cycle time used to service peripheral.08 to 15Peripheral port servicing setting enable00:5% of the cycle time01: Use time in 00 to 07Cycle monitor time (effective when bits 08 to 15 are set to 01, 02, or 03)DM 661800 to 0700 to 99 (BCD): Setting (see 08 to 15)08 to 15Cycle monitor enable (Setting in 00 to 07 x unit; 99 5 max.)00:120 ms (setting in bits 00 to 07 disabled)01: Setting unit: 10 ms02: Setting unit: 100 ms03: Setting unit: 1 sE-110.Appendix E- PC SetupWord(s)DM6619Bit(s)00 to 15FunctionCycle Time0000: Variable (no minimum)0001 to 9999 (BCD): Minimum time in ms.Interrupt Processing (DM 6620 to DM 6639)The following settings are effective after transfer to the PLC the next time operation is started.DM 662000 to 03DM 662104 to 0708 to 1112 to 1500 to 07DM 6622DM 6623DM 6624DM 6625DM6626 toDM6627DM662808 to 1500 to 0708 to 1500 to 0708 to 1500 to 0700 to 0708 to 1500 to 15Input constant for IR 00000 to IR 000020:0.8 ms; 1:1 ms; 2: 2 ms; 3: 4 ms; 4: 8 ms; 5:16 ms; 6: 32 ms; 7: 64 ms; 8:128 msInput constant for IR 00003 and IR 00004 (Setting same as bits 00 to 03)Input constant for IR 00005 and IR 00006 (Setting same as bits 00 to 03)Input constant for IR 00007 and IR 00011 (Setting same as bits 00 to 03)Input constant for IR 0010: 8 ms; 1:1 ms; 2: 2 ms; 3: 4 ms; 4: 8 ms; 5:16 ms; 6: 32 ms; 7: 64 ms; 8:128 msInput constant for IR 002 (Setting same as for IR 001).Input constant for IR 003 (Setting same as for IR 001).Input constant for IR 004 (Setting same as for IR 001).Input constant for IR 005 (Setting same as for IR 001).Input constant for IR 006 (Setting same as for IR 001).Input constant for IR 007 (Setting same as for IR 001).Input constant for IR 008 (Setting same as for IR 001).Input constant for IR 008 (Setting same as for IR 001).Input constant for IR 009 (Setting same as for IR 001).Not Used.00 to 03Interrupt enable for IR 00000 (0: Normal input; 1: Interrupt input; 2: Quick-response)04 to 07Interrupt enable for IR 00001(0: Normal input; 1: Interrupt input; 2: Quick-response)08 to 11Interrupt enable for IR 00002 (0: Normal input; 1: Interrupt input; 2: Quick-response)12 to 15Interrupt enable for IR 00003 (0: Normal input; 1: Interrupt input; 2: Quick-response)High-speed Counter Settings (DM 6640 to DM 6644)The following settings are effective after transfer to the PC the next time operation is started.DM6640 to00 to 15Not Used.DM6641DM664200 to 03High-speed counter mode0: Up/down counter mode; 4: Incrementing counter mode04 to 07High-speed counter reset mode0: Z phase and software reset; 1: Software reset only08 to 15High-speed counter enable00: Don't use high-speed counter; 01: Use high-speed counter with settings in 00 to 07DM6643,00 to 15Not Used.DM6644E-210.Appendix E- PC SetupWord(s)Bit(s)FunctionPeripheral Port SettingsThe following settings are effective after transfer to the PLC.DM 6645 toDM6649DM665000 to 15Not Used.00 to 07Port settings00: Standard (1 start bit, 7-bit data, even parity, 2 stop bits, 9, 6000 bps)01: Settings in DM 6651(Other settings will cause a non-fatal error and AR 1302 will turn ON.)08 to 11Link area for one-to-one PC link via peripheral port:0: LR00toLR 1512 to 15Communications mode0: Host link; 2: One-to-one PC link (slave) 3: One-to-one PC link (master); 4: NT link(Other settings will cause a non-fatal error and AR 1302 will turn ON.)DM 665100 to 07Baud rate00:1.2K, 01: 2.4K, 02: 4.8K, 03: 9.6K, 04:19.2K08 to 15Frame formatStartDataStopParity00:1 bit7 bits1 bitEven01:1 bit7 bits1 bitOdd02:1 bit7 bits1 bitNone03:1 bit7 bits2 bitEven04:1 bit7 bits2 bitOdd05:1 bit7 bits2 bitNone06:1 bit8 bits1 bitEven07:1 bit8 bits1 bitOdd08:1 bit8 bits1 bitNone09:1 bit8 bits2 bitEven10:1 bit8 bits2 bitOdd11:1 bit8 bits2bitNone(Other settings will cause a non-fatal error and AR 1302 will turn ON.)DM 665200 to 15Transmission delay (Host Link)0000 to 9999: in ms.(Other settings will cause a non-fatal error and AR 1302 will turn ON.)DM 665300 to 07Node number (Host Link)00to31 (BCD)(Other settings will cause a non-fatal error and AR 1302 will turn ON.)08 to 15Not Used.DM 665400 to 15Not Used.Error Log Settings (DM 6655)The following settings are effective after transfer to the PLC.DM 665500 to 03Style0: Shift after 7 records have been stored1: Store only first 7 records (no shifting)2 to F: Do not store records04 to 07Not Used.08 to 11Cycle Time monitor enable.0: Detect long cycles as non-fatal errors1: Do not detect long cycles12 to 15Not Used.E-310.Appendix E- PC SetupCPM2A PC Setup SettingsThe PLC Setup is broadly divided into four categories: 1) Settings related to basic PLC operationand I/O processes, 2) Settings related to the cycle time, 3) Setting related to interrupts, and 4)Settings related to communications.