Data of the S function
When M functions (M03, M04, M05, M19) are programmed in the NC program that refers to a spindle, the technology function data is saved as an S function in the associated axis-specific HLI area.
Data of the S function | |
Description | The parameters of an S function are contained in the SProzess structure. |
Data type | HLI_S_PROZESS |
ST Path | pSProcess : POINTER TO HLI_S_PROZESS;
Axis-specific, default synchronisation: pSProcess := ADR(gpAx[axis_idx]^.techno_unit_std_sync[tech_unit_idx].attribut_r.data[0]); Axis-specific, cross-block synchronisation: pSProcess := ADR(gpAx[axis_idx]^.techno_unit_late_sync[tech_unit_idx].attribut_r.data[0]); |
Access | PLC is reading |
Command position of spindle with M19 | |
Description | Command position for spindle position with M19 |
ST Element | .pos |
Data type | DINT |
Unit | 10-4 ° |
Access | ActivePosition: DINT; ActivePosition := pSProcess^.pos; |
Programmed spindle speed | |
Description | Programmed spindle speed |
ST Element | .rev |
Data type | DINT |
Unit | 10-3°/s |
Access | PrgRevolution: DINT; PrgRevolution: = pSProcess^.rev; |
Probable execution time | |
Description | Time probably required to process an S function. |
ST Element | assigns the definition of the main spindle.time |
Data type | UDINT |
Unit | 1 μs |
Access | ExpectedTime : UDINT; ExpectedTime:= pSProcess^.time; |
Number of the M function of the spindle indexing function | ||
Description | Number of the spindle indexing function (M03, M04, M05) | |
ST Element | .move_cmd | |
Data type | UINT | |
Value range | Value | M function |
3 | M03 | |
4 | M04 | |
5 | M05 | |
Access | MoveCmdNum : UINT; MoveCmdNum := pSProcess^.move_cmd; |
Number of the M function of the spindle positioning function | |
Description | Number of the spindle positioning function (M19) |
ST Element | .pos_cmd |
Data type | UINT |
Value range | 0 no M function specified 19 stands for M19 |
Access | PosCmdNum: UINT; PosCmdNum := pSProcess^.pos_cmd; |
Axis number | |
Description | Unique system-wide number of a logical axis/spindle |
ST Element | .log_achs_nr |
Data type | UINT |
Value range | [1, MAX_UNS16] In TwinCAT normally [1, gNrAX] |
Access | LogAxisNum: UINT; LogAxisNum := pSProcess^.log_achs_nr; |
Number of cross-block synchronised technology functions not acknowledged by the PLC | |
Description | Number of technology functions not yet acknowledged by the PLC but with cross-block synchronisation and waiting at the interface. The number contains all types of technology functions. |
ST Element | .nr_late_sync |
Data type | UINT |
Access | NrLateSync : UINT; NrLateSync := pSProcess^.nr_late_sync |