Name :Positioning control pulse output

Symbol:PTO_POSITION_CTRL

Illustrate:

        When the function block is enabled, the positioning control will be executed by trapezoidal acceleration/deceleration, and when the target frequency cannot be reached, the target frequency will be automatically lowered to perform triangular control.

Image:

Parameter:

Parameter | Statement | IN/OUT | Parameter role | Illustrate | Default value
--- | --- | --- | --- | --- | ---
OUTPORT | UDINT | IN | Pulse output port | 0-7 |
    not
EXECUTE | BOOL | IN | The function block is enabled | Rising edge trigger (after triggering, it cannot be triggered again if it is not completed) |
    not
DESFREQ | UDINT | IN | Target frequency: UnitsHz | 1-200KHz；0：Use default values (automatically reduce frequency when target frequency is unreachable, perform triangle control) (load on EXECUTE rising edge) |
    Yes/100
STARTFREQ | UDINT | IN | Start Frequency: UnitsHz | 1-200KHz(not up to target frequency) 0: Use default value (load on EXECUTE rising edge) |
    Yes/100
ACC | UDINT | IN | Acceleration rate：Hz/ms | Positive: less than maximum acceleration (1000Hz/ms), 0: Use default acceleration rate (loaded on EXECUTE rising edge) |
    Yes/100
DEC | UDINT | IN | Deceleration rate：Hz/ms | Positive: less than maximum acceleration (1000Hz/ms), 0: Use default acceleration rate (loaded on EXECUTE rising edge) |
    Yes/100
PULSENUM | DINT | IN | Number of pulses + direction | Non-0: Positive - Forward Motion, Negative - Backward Motion (Loaded on EXECUTE Rising Edge) |
    无
ABORT | BOOL | IN | Emergency stop triggering | TRUE：Emergency stop enabled (irrevocable after enabled, and cannot be re-enabled until the processing is completed) |
    Yes/FALSE
STOPTIME | UDINT | IN | Emergency stop time: Unitsms | Stop the pulse output within the set time. NON-0;0: RUNS BY DEFAULT (LOADED ON EXECUTE RISING EDGE) |
    Yes/5
DONE | BOOL | OUT | Positioning control completion signs | TRUE：All pulse outputs are complete, positioning control is performed (status is maintained for only one cycle) |
    Yes/FALSE
BUSY | BOOL | OUT | Positioning controls the operating state | TRUE：Positioning control is executing normally, FALSE: Positioning control is not executed, execution is complete, or emergency stop is being made |
    Yes/FALSE
CMDSTOP | BOOL | OUT | Emergency stop status | TRUE：In the emergency stop, the pulse frequency has not been reduced to 0 (at this time, it cannot respond to the new axis start control)) |
    Yes/FALSE
ERROR | BOOL | OUT | Error flags | TRUE：There was an error with the function block call |
    Yes/FALSE
ERRORID | DINT | OUT | Error codes | 0：Normal, Other: Error code value |
    Yes/0

Error codes:

Error codes | Illustrate
--- | ---
0 |
    Inerrancy
1 |
    Invalid pulse port
2 |
    The pulse port is busy/pre>
3 |
    The pulse port is performing a stop action
7 |
    The frequency exceeds the maximum allowable range
10 |
    Acceleration exceeds the maximum allowable value
11 |
    The deceleration exceeds the maximum allowable value

Example:

LD:

ST:

PTO_POSITION_CTRL_inst1(OUTPORT := 0, EXECUTE := TRUE, DESTFREQ := 10000, STARTFREQ := 100, ACC := 100, DEC := 100, PULSENUM := 100000, ABORT := FALSE; STOPTIME := 10, DONE => DoneOut, BUSY => BusyOut, CMDSTOP => CmdStopOut, ERROR => ErrorOut, ERRORID => ErrorIDOut);

Interpretation:

       A pulse of 0 for OUTPORT means that the operation port has 0 pulse output;
       EXECUTE is the rising edge, which means that this function block is executed;
       DESTFREQ is 10000, which means that the maximum target pulse frequency in the positioning control process is 10000Hz, and the port outputs the pulse at a maximum rate of 10000Hz (if the target frequency is unreachable, the frequency will be automatically reduced);
       A STARTFREQ of 100 indicates that the function block outputs 100Hz at the initial pulse frequency;
       ACC is 100, which means that the pulse output frequency will change with an acceleration of 100Hz/ms, and finally accelerate to the maximum target frequency of 10000Hz (if the target frequency is not reached, the frequency will be automatically reduced);
       A DEC of 200 indicates that the pulse output frequency will change with an acceleration of 200Hz/ms, and finally decelerate to 0, and the pulse output will be completed
       PULSENUM is 100000, a positive number, indicating forward movement, and the number of output pulses in the whole positioning control process is 100000;
       If ABORT is FALSE, it means that the function block is operating normally and does not perform emergency stop.
       STOPTIME is 10, which means that after the emergency stop starts, it will decelerate to 0 within 10ms.
       If DoneOut is TRUE, the positioning control is executed.
       If BusyOut is TRUE, it means that port 0 is executing the positioning control pulse output, if it is FALSE, the positioning control pulse output cannot be executed, and bError will be set to TRUE.
       If CmdStopOut is TRUE, the emergency stop is in progress and the pulse output frequency has not been decelerated to 0, and if it is FALSE, the emergency stop has not been executed or has been completed.
       If ErrorOut is TURE, it means that there is an error in the function block and the positioning control pulse output cannot be executed, and the error code is ErrorIDOut.