1. Multi segment pulse control of relative position PTO(32位)

1. Multi segment pulse control of relative position PTO(32位)

1.1. Instruction description

  1. The PTO (32-bit) instruction for relative position multi segment pulse control can be used to achieve multi segment pulse output at a preset frequency and number of pulses. When the input terminal is turned on, immediately start outputting pulses from the preset starting frequency of the first segment, uniformly accelerate and decelerate to reach the preset ending frequency of the first segment, and at the same time, output the number of pulses to reach the preset output pulse number of the first segment; Starting from the preset starting frequency of the second segment, output pulses with uniform acceleration and deceleration to reach the preset ending frequency of the second segment. At the same time, output pulses to reach the preset number of output pulses for the second segment; Repeat the process until the number of segment pulses is set to 0, indicating the end of the segment, the pulse output stops, or the input terminal of the pulse command is disconnected.

  2. The set values for multi segment frequency and pulse number are set at the beginning of the pulse parameter address. A region starting from Dn.

Taking D0 (double letter) as the starting address as an example: D0 (D1) sets the total number of pulse segments, D2 (D3) sets the direction flag of the pulse, D4 (D5) sets the starting frequency of the first segment pulse, D6 (D7) sets the ending frequency of the first segment pulse, D8 (D9) sets the number of pulses in the first segment pulse, D10 (D11) sets the starting frequency of the second segment pulse,..., Dn+4 (Dn+5) sets the highest frequency of the (n+6)/6th segment pulse, Dn+6 (Dn+7) sets the ending frequency of the (n+6)/6th segment pulse, Dn+8 (Dn+9) sets the (n+6/6) th segment pulse. Number;

  1. The output frequency range is 0Hz~200KHz, and the pulse quantity range is K0~K2147483647. Acceleration and deceleration time refers to the acceleration and deceleration time from the starting frequency to the stable frequency, and the output stops when the frequency is 0. During the output process of each pulse segment, there is no acceleration time set, and the frequency accelerates from the starting frequency to the ending frequency. The step size of the entire acceleration process is the number of pulses in that segment, as shown in the timing diagram.

  2. For 16 point transistor type PLCs, Y0~Y1 are high-speed pulse output ports, and for 32/50/66 point transistor type PLCs, Y0~Y3 are high-speed pulse output ports; Relay type PLCs do not have high-speed pulse function, and the maximum output frequency of the output port is determined by the closing time of the relay. For multi pulse series PLCs, their high-speed pulse output ports are Y0~Y7 and Y10~Y11.

Pulse is outputting flag (read-only):
register Pulse port
M8134 Y000
M8135 Y001
M8136 Y002
M8137 Y003
For multi pulse series PLCs, the following registers are also available:
register Pulse port
M8138 Y004
M8139 Y005
M8140 Y006
M8141 Y007
M8142 Y010
M8143 Y011
Pulse direction, positive direction is 1 (read-only):
register Pulse port
M8102 Y000
M8103 Y001
M8104 Y002
M8105 Y003
For multi pulse series PLCs, the following registers are also available:
register Pulse port
M8106 Y004
M8107 Y005
M8108 Y006
M8109 Y007
M8110 Y010
M8111 Y011
Pulse accumulation counting (read-write):
register Pulse port
D8140(D8141) Y000
D8142(D8143) Y001
D8144(D8145) Y002
D8146(D8147) Y003
For multi pulse series PLCs, the following registers are also available:
register Pulse port
D8148(D8149) Y004
D8150(D8151) Y005
D8152(D8153) Y006
D8154(D8155) Y007
D8156(D8157) Y010
D8158(D8159) Y011
Current pulse segment (read-only):
register Pulse port
D8124 Y000
D8125 Y001
D8126 Y002
D8127 Y003
For multi pulse series PLCs, the following registers are also available:
register Pulse port
D8128 Y004
D8129 Y005
D8130 Y006
D8131 Y007
D8132 Y010
D8133 Y011
Error pulse segment position, 0 indicates no error (read-only):
register Pulse port
D8108 Y000
D8109 Y001
D8110 Y002
D8111 Y003
For multi pulse series PLCs, the following registers are also available:
register Pulse port
D8112 Y004
D8113 Y005
D8114 Y006
D8115 Y007
D8116 Y010
D8117 Y011

1.1.1. Attention:

  1. When it is an n-segment pulse, the addresses of the pulse frequency and number of pulses for each segment of the first segment, second segment, third segment, etc. must be consecutive in sequence;

  2. The OFF time of transistors has the characteristic of being prolonged under light loads. So, when responsiveness is required, please design a load resistor to increase the load current when the load is lighter;

  3. For the pulse output Y0, the number of pulses is accumulated in register D8140 (D8141), where D8141 stores the high 16 bits and D8140 stores the low 16 bits;

  4. The pulse accumulation count registers (D8140~D8158) are important registers that can be read and written. When a new value is written, the count will be added or subtracted based on the new value;

  5. Due to the directional output of the pulse in this instruction, the pulse accumulation counting registers (D8140~D8158) count according to the direction;

  6. When outputting high-speed pulses, the values in the pulse accumulation count registers (D8140~D8158) are discontinuous and constantly changing. When used for judgment, please use size comparison instead of equal judgment;

  7. The starting frequency of the first section is set to 100Hz by default. When outputting high-speed pulses, the stable frequency of the first section should not be lower than this value;

  8. The current pulse segment (D8124-D8133) is only recorded during the pulse transmission process and automatically resets to zero when the command fails;

  9. The PTO command cannot switch to the next pulse segment using the PLSNNEXT command.

  10. When the pulse command is used to output port Y, the Y port cannot be used for other purposes, that is, ordinary commands cannot perform ON or OFF operations on the Y port anymore.

  11. If the frequency of multiple pulse pulses exceeds 200K, a pull-up resistor needs to be added to the pulse output port to ensure that the pulse waveform is not distorted. The pull-up voltage is 24V, and the recommended pull-up resistor is 1K.

1.2. The valid operands of the instruction

Input/Output Data Type operand Description
D 32-bit integer D Address
OUT ON/OFF Y Pulse
DIR ON/OFF Y Direction

1.3. Example

Command table:

NETWORK 000

LD M8151

MOVD K7 D0//The total number of pulse segments is 7, where n corresponds to the number of pulse segments below

MOVD K1 D2//Direction flag, 0 or 1, set the status of Y3 in this program

MOVD K200 D4//First pulse starting frequency 200HZ

MOVD K400 D6//First pulse end frequency 400Hz

MOVD K1000 D8//The number of pulses in the first segment is 1000PLS

MOVD K400 D10//Second pulse starting frequency 400Hz

MOVD K650 D12//Second pulse end frequency 650HZ

MOVD K2000 D14//Number of pulses in the second segment 2000PLS

MOVD K650 D16//The starting frequency of the third pulse is 650Hz

MOVD K900 D18//The end frequency of the third pulse is 900Hz

MOVD K5000 D20//Number of pulses in the third segment 5000PLS

MOVD K900 D22//Fourth pulse starting frequency 900HZ

MOVD K900 D24//Fourth pulse end frequency 900HZ

MOVD K4000 D26//Number of pulses in the fourth segment 4000PLS

MOVD K900 D28//Fifth pulse starting frequency 900HZ

MOVD K650 D30//Fifth pulse end frequency 650HZ

MOVD K3000 D32//Number of pulses in the fifth segment 3000PLS

MOVD K650 D34//The starting frequency of the sixth pulse is 650Hz

MOVD K500 D36//The end frequency of the sixth pulse is 500HZ

MOVD K2500 D38//Number of pulses in the sixth segment 2500PLS

MOVD K500 D40//Seventh pulse starting frequency 500HZ

MOVD K0 D42//Seventh pulse end frequency 0HZ

MOVD K1500 D44//Number of pulses in the seventh segment 1500PLS

NETWORK 001

LD M0

PTO D0 Y0 Y3 //Data start D0, pulse output Y0, direction Y3

1.3.1. 时序图:

时序图

图1 时序图