CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 79
Текст из файла (страница 79)
The number of output pulses can be –16,777,215 to16,777,215. Bit 15 of N+1 acts as a sign bit; the number is negative if bit 15 is ON,positive if it is OFF.Positive: 0 to +16,777,215 (0000 0000 to 1677 7215)Negative: –16,777,215 to 0 (9677 7215 to 8000 0000)N+1 contains the leftmost 4 digits and N contains the rightmost 4 digits.Number of MovementPulsesThe number of movement pulses depends upon the number of output pulses(N+1 and N) and the pulse type (C).CoordinatesystemRelativeAbsoluteMovement pulsesNumber of movement pulses = Number of output pulsesPulse type: Relative (C=000)Number of movement pulses = Number of output pulsesPulse type: Absolute (C=001, CPM2A/CPM2C only)Number of movement pulses = Number of output pulses – PVAfter PULS(65) has been executed, the calculated number of movement pulseswill not be changed even if INI(61) is executed to change the pulse output PV.A specification that causes movement outside of the allowed PV range(–16,777,215 to 16,777,215) can be specified without problems.459Section 7-27Pulse Output InstructionsPULS(65) will not be executed and an error will occur (SR 25503 ON) if the calculated number of movement pulses is 0.When the pulse output is operating in independent mode without acceleration ordeceleration and the number of movement pulses is negative, the absolute value of the number of movement pulses will be used.
(For example, if the numberof movement pulses is –500, a value of 500 will be used.)FlagsER:A data area boundary is exceeded.Indirectly addressed DM word is non-existent. (Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)P is not 000 or 010.C is not 000 or 001. (C cannot be set to 001 when relative coordinatesare being used.)The number of output pulses is not between –16,777,215 and16,777,215.PULS(65) is executed in an interrupt subroutine while a pulse I/O orhigh-speed counter instruction (INI(61), PRV(62), CTBL(63),SPED(64), PULS(65), ACC(––), PWM(––), or SYNC(––)) is beingexecuted in the main program.After PULS(65) is executed, the absolute value of the number of movement pulses is not between 1 and 16,777,215.7-27-2 SPEED OUTPUT– SPED(64)Operand Data AreasLadder SymbolsP: Port specifierSPED(64)@SPED(64)PPMMFF001 or 010M: Output mode000 or 001F: Target frequencyIR, SR, AR, DM, HR, LR, #LimitationsThis instruction is supported by the CPM1A and CPM2A/CPM2C PCs withtransistor outputs only.In the CPM1A: F must be BCD, #0000 or #0002 to #0200.In the CPM2A/CPM2C: F must be BCD, #0000 or #0001 to #1000.DM 6144 to DM 6655 cannot be used for F.DescriptionSPED(64) is used to set the output pulse frequency and start the pulse outputfrom the specified output bit.
When the execution condition is OFF, SPED(64) isnot executed. When the execution condition is ON, SPED(64) sets the pulse frequency F for the output bit specified by P. M determines the output mode.In general, SPED(64) should be executed just once each time that the frequencyneeds to be set; use the differentiated variation (@SPED(64)) or an input condition that is ON for just one cycle.Note Refer to 2-5 Pulse Output Functions for more details.460Section 7-27Pulse Output InstructionsPort Specifier (P)The port specifier indicates the output bit where the pulses will be output.PPulse output location(s)000 Single-phase pulse output 0 without acceleration or deceleration (output01000)010 Single-phase pulse output 1 without acceleration or deceleration (output01001)This setting is supported by CPM2A/CPM2C PCs only.Output Mode (M)The value of M determines the output mode.MPulse type000 Independent mode001 Continuous modeOperation in independent mode and continuous mode is described below.Target Frequency (F)The 4-digit BCD value of F sets the pulse frequency in units of 10 Hz, as shownbelow.
Setting F to 0000 will stop the pulse output from the specified output bit.PCPossible values of FCPM1A0000 (stops pulse output) or 0002 to 0200 (20 Hz to 2 kHz)CPM2A/CPM2C0000 (stops pulse output) or 0001 to 1000 (10 Hz to 10 kHz)The pulse output started by SPED(64) will continue until one of the following occurs:General Operation1, 2, 3...Operation in IndependentMode1. The INI(61) instruction is executed with C=003.2. In independent mode, the number of output pulses specified by PULS(65) isreached. (Execute PULS(65) before SPED(64).)3.
SPED(64) is executed again with the target frequency, F, set to #0000.4. The PC is switched to PROGRAM mode.Pulses can be output simultaneously and independently from two output bits.When outputting pulses in independent mode, specify the number of pulses beforehand by executing PULS(65). The number of output pulses must be specified again with PULS(65) each time that the pulse output has been stopped.The frequency cannot be changed with SPED(64) when pulses are already being output from the specified output bit by ACC(––) or PWM(––). An error willoccur and SR 25503 will be turned ON if SPED(64) is executed under these circumstances.In independent mode, just the number of output pulses set by PULS(65) will beoutput.
The number of output pulses must be specified by executing PULS(65)before executing SPED(64). (Pulses won’t be output if the number of outputpulses has not been specified in advance.)When the calculated number of movement pulses is negative, the absolute value of the number of movement pulses will be used. (For example, if the numberof movement pulses is –500, a value of 500 will be used.)Pulse frequencyTime461Section 7-27Pulse Output InstructionsIn continuous mode, pulses will be output indefinitely until stopped by executingINI(61) with C=003, executing SPED(64) again with F=0000, or switching thePC to PROGRAM mode.Operation in ContinuousModePulse frequencyTimeFlagsER:A data area boundary is exceeded.Indirectly addressed DM word is non-existent. (Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)P is not 000 or 010, M is not 000 or 001, or F is not 0000 to 1000.SPED(64) is executed in an interrupt subroutine while a pulse I/O orhigh-speed counter instruction (INI(61), PRV(62), CTBL(63),SPED(64), PULS(65), ACC(––), PWM(––), or SYNC(––)) is beingexecuted in the main program.7-27-3 ACCELERATION CONTROL – ACC(––)Ladder SymbolsOperand Data AreasP: Port specifierACC(––)@ACC(––)PPMMCC000M: Mode specifier000, 002, or 010 to 013C: First control wordIR, SR, AR, DM, HR, LRLimitationsThis instruction is available in the CPM2A/CPM2C only.P must be 001 or 002 and M must be 000 to 003.C to C+3 must be in the same data area.DescriptionACC(––) is used to specify the acceleration/deceleration rate and start the pulseoutput for a pulse output with trapezoidal acceleration and deceleration.In general, ACC(––) should be executed just once each time that the acceleration/deceleration rate needs to be set; use the differentiated variation(@ACC(––)) or an input condition that is ON for just one cycle.Note Refer to 2-5 Pulse Output Functions for more details.Port Specifier (P)Always set the port specifier to 000.
The 000 setting specifies single-phasepulse output 0 with trapezoidal acceleration and deceleration.462Section 7-27Pulse Output InstructionsMode Specifier (M)The value of M determines the output mode.MModeNote000 Independent mode and up/down pulse output mode---002 Independent mode and pulse + direction output mode--CW: Clockwise010011012013CW (continuous mode and up/down pulse output mode)CCW (continuous mode and up/down pulse output mode)CW (continuous mode and pulse + direction output mode)CCW (continuous mode and pulse + direction output mode)CCW: CounterclockwiseIn independent mode, the output direction is set when PULS(65) is executed.Control Words (C, C+1, and C+2)The 3 control words indicate the acceleration rate, target frequency, and deceleration rate.
(Each frequency is set in multiples of 10 Hz.)WordFunctionCThe content of C determines the acceleration rate.During acceleration, the output frequency is increased by the amount set inC every 10 ms. C must be BCD from 0001 to 1000 (10 Hz to 10 kHz).C+1The content of C+1 specifies the target frequency.C+1 must be BCD from 0001 to 1000 (10 Hz to 10 kHz).The content of C+2 determines the deceleration rate.During deceleration, the output frequency is decreased by the amount setin C+2 every 10 ms. C must be BCD from 0001 to 1000 (10 Hz to 10 kHz).C+2Two output bits are required for pulse outputs controlled by ACC(––).General OperationUp/down pulse output modeIR 01000 (CW operation)IR 01001 (CCW operation)Pulse + direction output modeIR 01000 (Pulse output)IR 01001 (Direction specifier)The pulse output will start when ACC(––) is executed and the output frequencywill be increased every 10 ms by amount specified in control word C.
When thetarget frequency (specified in C+1) is reached, acceleration is stopped and thepulse output continues at a constant frequency.When the pulse output is operating with trapezoidal acceleration and deceleration, the pulse output can be stopped by one of the following methods.1, 2, 3...1. Execute the INI(61) instruction with C=003. (Immediate stop)2. In independent mode, the number of output pulses specified by PULS(65) isreached. (Decelerates to a stop.)3. ACC(––) is executed with the target frequency (in C+1) set to 0000.a) When pulses are being output in independent mode, the output will decelerate to a stop at the deceleration rate set when the pulse output wasstarted.b) When pulses are being output in continuous mode, the output will decelerate to a stop at the specified deceleration rate.4.