CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 22
Текст из файла (страница 22)
Either IR 01000 or IR 01001can be selected for pulse output, and the pulse output can be set to either thecontinuous mode, under which the output can be stopped by an instruction, orthe independent mode, under which the output is stopped after a preset numberof pulses (1 to 16,777,215).Refer to the CPM1A Operation Manual for details on hardware connections tooutput points and ports.Pulses are output at the specified frequency until stopped.Continuous modePulse output is stopped automatically when the specifiednumber of pulses has been output.Independent modeSpecified number of pulsesStepping motorStepping motorControl inputMotorcontrollerCW/CCW control outputPulse output(single-phase output)IR 01000 or IR 01001Note1.
The CPM1A uses a single-phase pulse output. The control signal for thedirection of rotation (CW/CCW) for the motor driver must be written in theprogram.2. Be sure to use a CPU Unit with transistor outputs.121SectionCPM1A Pulse Output Functions2-62-6-1 Programming Example in Continuous ModeIn this example program, pulse output begins from IR 01000 when inputIR 00004 turns ON, and is stopped when input IR 00005 turns ON.SPED(64) can be used to stop pulse output. When using SPED(64) for that purpose, specify #0000 (constant or word contents) as the pulse frequency.00004 (pulse output condition)@SPED(64)Begins pulse output.000Output from 01000001Continuous mode#0100Pulse frequency: 1 kHz00005 (pulse output stop condition)@INI(61)Stops pulse output.0000030002-6-2 Programming Example in Independent ModeIn this example program, pulse output begins from IR 01000 when inputIR 00004 turns ON, and is stopped after the specified number of pulses havebeen output.
The pulse amount is set in DM 0100 and DM 0101.00004 (pulse output condition)@PULS(65)Sets the number of pulses.000000DM 0100Pulse number setting@SPED(64)Begins pulse output.00004 (pulse output condition)000000#0100Independent modePulse frequency: 1 kHz2-6-3 Using Pulse Output InstructionsSetting the Number ofPulsesBefore beginning pulse output using the independent mode use PULS(65) asshown below to set the number of pulses to be output. This setting is not requiredfor the continuous mode.@PULS(65)000000NIn N, set the beginning word address of the words where the number of pulses isset.
Store the number of pulses in words N and N+1, in eight digits BCD, with theleftmost four digits in N+1 and the rightmost four digits in N.Make the setting within a range of 00000001 to 16777215 (BCD).122SectionCPM1A Pulse Output FunctionsBeginning Pulse Output2-6With SPED(64), set the bit location for pulse outputs (IR 01000 or IR 01001), theoutput mode (independent, continuous), and the pulse frequency to begin thepulse output.@SPED(64)PMFP (3 digits BCD)M (3 digits BCD)F (4 digits BCD)Note000: Outputs to IR 01000010: Outputs to IR 01001000: Independent mode001 Continuous modeFor the beginning pulse output frequency, specify aconstant or word contents. The specified value and setfrequency are as follows:Specified value:0002 to 0200Set frequency:20 to 2,000 Hz1.
Pulses can be output from only one bit at a time.2. When pulse output is begun in independent mode, the number of pulses isread when SPED(64) is executed. PULS(65) cannot be used to change thenumber of pulses while pulses are being output.2-6-4 Changing the FrequencyTo change the frequency during pulse output, change the frequency setting withSPED(64). At that time, set the operands other than the frequency to the samesettings as at the beginning of pulse output.@SPED(64)PMFP (3 digits BCD)M (3 digits BCD)F (4 digits BCD)Same as at beginning of pulse output.Same as at beginning of pulse output.For the changed pulse output frequency, specify aconstant or word contents.
The specified value and setfrequency are as follows:Specified value:0002 to 0200Set frequency:20 to 2,000 Hz2-6-5 Stopping Pulse OutputWhen pulses are output in the independent mode, the pulse output will automatically stop after the number of pulses specified with PULS(65) has been output.When pulses are output in the continuous mode, either of the following twomethods can be used to stop the pulse output.1. Use SPED(64) to set the frequency to 0.2. Use INI(61) to stop the pulse output.Using SPED(64)The first method is to use SPED(64) to stop the pulse output by setting the frequency to 0.
For details, refer to 2-6-4 Changing the Frequency.Using INI(61)The second method is to use INI(61) to stop the pulse output, as follows:@INI(61)000003000123SectionSynchronized Pulse Control (CPM2A/CPM2C Only)2-72-7Synchronized Pulse Control (CPM2A/CPM2C Only)By combining the CPM2A/CPM2C’s high-speed counter function with the pulseoutput function, the output pulse frequency can be controlled as a specified multiple of the input pulse frequency.Note A CPU Unit with transistor outputs is required in order to use synchronized pulsecontrol, i.e., either a CPM2A-CDT-D or CPM2A-CDT1-D.The following diagram shows the configuration for a CPM2A, but the configuration for a CPM2C is identical.Counter inputPulse input 00000or 00001Main motorRotary encoderMotordriverPulse output 01000 or 01001(single-phase output)Input modeItemInputnumberDifferential phase Pulse + directionUp/down pulseinput modeinput modeinput modePhase-A inputCount inputCW inputPhase-B inputDirection inputCCW inputDifferential phaseSingle-phase input Single-phase inputinput (4X)10 to 500 Hz (accuracy ±1 Hz)20 Hz to 1 kHz (accuracy ±1 Hz)300 Hz to 20 kHz (accuracy ±25 Hz) (See note 2.)0000000001Input methodInput frequency rangeOutputnumber (Seenote 3.)01000Pulse output 001001Pulse output 1Output methodSingle-phase outputOutput frequency range10 Hz to 10 kHz (accuracy 10 Hz)Frequency ratio1% to 1,000% (Can be specified in units of 1%.)Synchronized control cycle10 msNote124Increment modeCount input(See note 1.)Single-phase input1.
Can be used as an ordinary input.2. When 10 kHz or less, then the accuracy is ±10 Hz.3. Either can be selected as the output number, using SYNC(––).SectionSynchronized Pulse Control (CPM2A/CPM2C Only)2-7The directions of pulse inputs are all ignored. The frequency of a pulse that hasbeen input is read, without regard to the direction.The following table shows the relationships between synchronized pulse controland the CPM2A’s other functions.FunctionSynchronized pulse controlSynchronized pulse control---Interrupt inputsCan be used simultaneously.Interval timer interruptsCan be used simultaneously.High-speed countersCannot be used simultaneously.Interrupt inputs (counter mode)Can be used simultaneously.Pulse outputsCannot be used simultaneously.Quick-response inputsCan be used simultaneously.Input time constantSee note.ClockCan be used simultaneously.Note When inputs 00000 and 00001 are set for use as synchronized pulse control inputs, the input time constant settings for the affected inputs are disabled.
Theinput time constants remain in effect, however, for the values for refreshing therelevant input data area.The relationship between the pulse input frequency and the pulse output frequency is shown below.Pulse input frequencyXFrequency ratio=Rough pulse output frequencyValues are rounded off in units of 10 Hz.10 to 500 HzA value less than 10 Hz is regarded as 0 Hz.20 Hz to 1 kHzA value greater than 10 kHz is regarded as 10 kHz.300 Hz to 20 kHzPulse output frequency(10 Hz to 10 kHz)The scaling factor control cycle is 10 ms, and the pulse output frequency ischanged at intervals of 10 ms with respect to the pulse input frequency.FrequencyTime125SectionSynchronized Pulse Control (CPM2A/CPM2C Only)2-7Using Synchronized Pulse ControlDifferential phase pulse input mode, pulse + direction inputmode, up/down pulse input mode, increment modeSelect the input mode.Select the pulse synchronizationinput frequency.Input frequency: 10 Hz to 500 Hz; 20 Hz to 1 kHz; 300 Hz to 20 kHzInput numbers: 00000, 00001, and 0002Output numbers: 01000 and 01001Wire the inputs and outputs.Settings for synchronized pulse control: Input mode, input frequencyPC Setup (DM 6642)SYNC(––): For beginning synchronized pulse control and changing the scaling factor.Create a ladder diagram program.INI(61): For stopping synchronized pulse control.PRV(62): For reading the high-speed counter frequency and the synchronized pulsecontrol status.PC SetupSynchronizedpulse controlDM 6642, bits 08 to 1510 Hz to 500 Hz20 Hz to 1 kHz300 Hz to 20 kHzEitherEncoderinputsInput modeCountDifferential phase inputPulse + direction inputLadder diagram programUp/down inputIncrement inputSYNC(––)PC SetupDM 6642, bits00 to 03INI(61)SYNCHRONIZEDPULSE CONTROLinstructionStart synchronizedpulse controlChange scalingfactorMODE CONTROLinstructionStop synchronizedpulse controlEvery scanCounter frequency PVSR 249SR 248ImmediatelyEvery scanHIGH-SPEEDCOUNTER PVSynchronized pulsePRV(62) READ instructioncontrol statusRead high-speed counterfrequencyRead synchronized pulsecontrol statusThe pulse output frequency cannot be read.126AR 1100 to AR 1107Pulse output 0Pulse output 1SectionSynchronized Pulse Control (CPM2A/CPM2C Only)2-7Selecting the Input ModeSelect the differential phase input mode, the pulse + direction input mode, theup/down pulse input mode, or the increment mode.
These modes are explainedbelow.Selecting the PulseSynchronization InputFrequencySelect one of the following as the input frequency range: 10 Hz to 500 Hz, 20 Hzto 1 kHz, or 300 Hz to 20 kHz. For more information on input frequencies, refer tothe following diagrams.Differential Phase Input ModeIn the differential phase input mode, the count is incremented or decrementedaccording to two differential phase signals (phase A and phase B) with a multiplication factor of 4.ONPhase AOFFONPhase BOFFNms → Frequency =1,000NPulse + Direction Input ModeIn the pulse + direction input mode, pulse signals and direction signals are input,and the count is incremented or decremented according to the direction signalstatus.Pulse inputsONOFFDirectioninputsONOFFNms → Frequency =1,000NUp/Down Pulse Input ModeIn the up/down pulse input mode, CW signals (up pulses) and CCW signals(down pulses) are input, and the count is incremented or decremented accordingly.ONCW inputsOFFONCWW inputsOFFIncrementedNms → Frequency =Decremented1,000N127SectionSynchronized Pulse Control (CPM2A/CPM2C Only)2-7Increment ModeIn the increment mode, pulse signals are input and the count is incremented witheach pulse.