Touchprobe
This library is used to measure lengths and / or distances with the help of the fast digital converter input.
TB_One_Mark_Register
The functionblock calculates the position difference between a reference position and a latch posoition. The first detected latch position after the FB-enabling will be the reference position. All register distance calculations are related to this reference position. It is possible to consider the gear factor between load (latch side) and motor.
The functionblock calculates the position difference between a reference position and a latch posoition. The first detected latch position after the FB-enabling will be the reference position. All register distance calculations are related to this reference position. It is possible to consider the gear factor between load (latch side) and motor. The load register distance is multiplied by the gear factor and the result is the neccessary motor register distance. The dead time input considers the position shifting depent of the speed. Additional to the dead time compensation related to the speed, there is a ACC dead time compensation possible. This functionality is switched on and off via the input x_ACC_PRECONTROL_ON.
ATTENTION: It is not allowed to change the following inputs during the register correction process! ud_LATCH_POS_BIT_FILTER, x_INV_REG_DIST, x_ACC_PRECONTROL_ON, ud_ABS_DIST_LIMIT_LOAD, ud_MARK_WINDOW_LOAD, ui_ROUND_MOTOR, ui_ROUND_LOAD, u_SYS_DEAD_TIME, u_INTERRUPT_TIME All this values are initialization values!
Empfohlene Task: EVENT
Verwendete Bibliotheken: POSPROCESS_30bdxx or greater ARITHMETIC_PLC02_30bdxx or greaterBM_TYPES_30bdxx or greaterSYSTEM_C_PLC02_30bdxx or greater
Eingänge
| Marking: | Data type: | Default: | Data range: | Description: |
|---|---|---|---|---|
| x_Enable | BOOL | ... | ... | TRUE: Enabling of the module. |
| x_New_Mark_Detect | BOOL | ... | ... | LH-edge oder HL-edge: new mark detected and start a new calculation of register distance |
| x_Invert_Register_Dist | BOOL | ... | ... | TRUE: dead time compensation depending on acceleration and deceleration is active |
| x_Acc_PreControl_ON | BOOL | ... | ... | activate dead time compensation for acceleration and deceleration |
| u_Round_Motor | UINT | ... | ... | |
| u_Round_Load | UINT | ... | ... | factor of motor-load-gearbox |
| u_DeadTime_System | UINT | ... | ... | dead time of the whole system (dead_time_sensor + dead_time_touchprobe) [µs] |
| u_Time_Interrupt | UINT | ... | ... | Cycle of Event-Task, in which the function block is instantiated [µs] |
| di_RefPos_Offset_Load | DINT | ... | ... | Offset which is added to the Reference Position |
| ud_Pos_Mot | UDINT | ... | ... | Actual Position of the motor (32-bit value, 360° = 4294967295 Inc), it is essential to use the same encoder as for ud_Latch_Pos_Mot |
| ud_Latch_Pos_Mot | UDINT | ... | ... | Latched Position of the motor (32-bit value, 360° = 4294967295 Inc), use the touchprobefunction of a Baumüller drive, it is essential to use the same encoder as for ud_Pos_Mot. |
| ud_Abs_DistLoad | UDINT | ... | ... | set a maximum for the calculated register distance which depends on the load side, ABS(di_RegDist_Load) > ud_Abs_Dist_Load --> di_RegDist_Load = +/- ud_Abs_Dist_Load. |
| ud_Window_Load_Mark | UDINT | ... | ... | set a window of tolerance over the referenceposition, this means when the calculated register distance depending on the load-side is within this the window the result is 0, (0 <= ABS(di_RegDist_Load) <= ud_Window_Load_Mark). |
| us_Latch_Pos_Filter | USINT | ... | ... | filters the last x Bits of the latch position, maximum range: 0 <= ud_Latch_Pos_Filter <= 25 (Example: ud_Latch_Pos_Mot = 11100101_11111111 / ud_Latch_Pos_Filter = 5 --> used latchposition ud_Latch_Pos_Mot = 11100101_11100000). |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_NewDist_Value | BOOL | LH-edge: New register distance is calculated |
| x_Register_OK | BOOL | FALSE: calculated register distance depending on the load-side is out of ud_Window_Load_Mark tolerances range TRUE: calculated register distance depending on the load-side is within ud_Window_Load_Mark tolerances range --> di_RegDist_Load = 0 |
| x_DistLimit_Load_Active | BOOL | FALSE: calculated registerdistance depending on the load-side is not limited TRUE: calculated registerdistance depending on the load-side is limited (x_Register_OK = TRUE: register distance depending on the load-side is within ud_Window_Load_Mark, x_Register_OK = FALSE: maximum limitation by ud_Abs_Dist_Load) |
| x_Error | BOOL | TRUE: the function block has one or more errors, for further information see w_Error_Info |
| di_RegDist_Load | DINT | calculated registerdistance depending on the load-side, motor-load-gearbox is considerated [ 1 turn of the load = 360° = 4294967295 Inc] |
| di_RegDist_Motor | DINT | calculated registerdistance depending on the motor-side, motor-load-gearbox is considerated [ 1 turn of the motor = 360° = 4294967295 Inc] |
| ud_RefPos_Load | UDINT | calculated registerdistance depending on the motor-side, motor-load-gearbox is considerated [ 1 turn of the motor = 360° = 4294967295 Inc] |
| ud_Latch_Pos_Load | UDINT | shows the last latched position depending on the load, motor-load-gearbox is considerated [ 1 turn of the load = 360° = 4294967295 Inc] |
| w_Error_Info | WORD | see below |
Ein-/Ausgänge
| none |
TB_TPmeasure
Distances and/or lengths can be measured with this module. This requires a touch probe function in the controller used. The touch probe function saves the current encoder position with a digital signal. Saving can occur with the positive and/or negative edge of the signal.
The module calculates the distance and length from the measured position. Windows can be specified in which a valid measurement is awaited so that interfering edges can be hidden.
Note:Before the module can be executed, all relevant parameters must be initialized with the TB_TPmeasure_Init technology block. Allowed drives are bmaXX 4400 and 5000.
Empfohlene Task: Event
Verwendete Bibliotheken: ARITHMETIC_xxbd00 or higher TECH_TYPES_xxbd05 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Enable | BOOL | When the input x_Enable = TRUE, the module is initialized. If the initialization was successful, the module is enabled. This is indicated when output x_Active = TRUE. After enabling, the first edge/mark is sought. When x_Enable = FALSE, x_1stEdge and x_Active are reset. |
| x_Ack | BOOL | Acceptance acknowledgment of the measured data. When x_Ack = TRUE, then x_Valid = FALSE and the measured distance (and length) is set to -1. |
| x_Counterclockwise | BOOL | Before enabling the FB with x_Enable, it must be set with this input, in which direction the measurement of lenght will be done. With direction is meant, if the connected encoder on d_EncPos, counting positive in clockwise direction, or is running in counterclockwise direction. TRUE: Counterclockwise FALSE: Clockwise If changing this variable in continous process, the FB needs on LH edge on x_Enable for reinit all values. |
| di_DefDist | DINT | Specification value of the expected edge distance of the LH edges (or the HL edges) in user units (e.g. printing mark spacing). |
| di_DefSize | DINT | Specification value of expected edge length of LH to HL edge (or HL to LH edge) in user units (e.g. printing mark length). |
| di_WinDist | DINT | Permissible deviation (window width) of the edge distance of the LH edges (or the HL edges) in user units. Distances with di_DefDist ± di_WinDist are accepted. If nothing is connected, the interfering mark detection is deactivated and all found edges are detected. |
| di_WinSize | DINT | Permissible deviation (window width) of the edge distance of LH to HL edge or HL to LH edge in user units. Widths with di_DefSize ± di_WinSize are accepted. If nothing is connected, the interfering mark detection is deactivated and all found edges are detected. |
| ud_Units | UDINT | Number of user units for the corresponding encoder revolutions (u_Revolution). |
| u_Revolution | UINT | Number of encoder revolutions for the corresponding user units (ud_Units). |
| d_EncPos | DWORD | Encoder actual value of touch probe encoder. Format is 32-bit angle. |
| d_TP_PosLH | DWORD | Measured position of LH edge. Format: 16-bit revolution, 16-bit angle. |
| d_TP_PosHL | DWORD | Measured position of HL edge. Format: 16-bit revolution, 16-bit angle. |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Active | BOOL | TRUE: Module is active; initialization occurred without incident. |
| x_1stEdge | BOOL | First valid edge detected. x_1stEdge remains TRUE until x_Enable = FALSE. |
| x_Valid | BOOL | TRUE: Valid values at di_ActDist (and di_ActSize). Reset with x_Ack = TRUE. |
| di_ActDist | DINT | Depending on mode and measurement: Measured OR last valid OR maximum distance of LH edges or HL edges in user units. |
| di_ActSize | DINT | Depending on mode and measurement: Measured OR last valid OR minimum length of the LH to HL edge (or the HL to LH edge) in user units. |
| x_TP_Err | BOOL | TRUE: Faulty measurement, i.e. no edge found within window. Remains TRUE until valid measurement occurs or x_Enable = FALSE. |
| u_TP_ErrCnt | UINT | Number of faulty measurements in succession. Reset upon the first valid measurement. |
| x_Error | BOOL | TRUE: Error detected. See error table. |
| i_Error | INT | Error number. See error table. |
| s_ErrTxt | STRING | Error text. See error table. |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| _PMdata | PM_Type | Data from the TB_TPmeasure_Init initialization module. |

TB_TPmeasure
Distances and/or lengths can be measured with this module. This requires a touch probe function in the controller used. The touch probe function saves the current encoder position with a digital signal. Saving can occur with the positive and/or negative edge of the signal.
The module calculates the distance and length from the measured position. Windows can be specified in which a valid measurement is awaited so that interfering edges can be hidden.
Note:Before the module can be executed, all relevant parameters must be initialized with the TB_TPmeasure_Init technology block. Allowed drives are bmaXX 4400 and 5000.
Empfohlene Task: Event
Verwendete Bibliotheken: ARITHMETIC_xxbd00 or higher TECH_TYPES_xxbd05 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Enable | BOOL | When the input x_Enable = TRUE, the module is initialized. If the initialization was successful, the module is enabled. This is indicated when output x_Active = TRUE. After enabling, the first edge/mark is sought. When x_Enable = FALSE, x_1stEdge and x_Active are reset. |
| x_Ack | BOOL | Acceptance acknowledgment of the measured data. When x_Ack = TRUE, then x_Valid = FALSE and the measured distance (and length) is set to -1. |
| x_Counterclockwise | BOOL | Before enabling the FB with x_Enable, it must be set with this input, in which direction the measurement of lenght will be done. With direction is meant, if the connected encoder on d_EncPos, counting positive in clockwise direction, or is running in counterclockwise direction. TRUE: Counterclockwise FALSE: Clockwise If changing this variable in continous process, the FB needs on LH edge on x_Enable for reinit all values. |
| di_DefDist | DINT | Specification value of the expected edge distance of the LH edges (or the HL edges) in user units (e.g. printing mark spacing). |
| di_DefSize | DINT | Specification value of expected edge length of LH to HL edge (or HL to LH edge) in user units (e.g. printing mark length). |
| di_WinDist | DINT | Permissible deviation (window width) of the edge distance of the LH edges (or the HL edges) in user units. Distances with di_DefDist ± di_WinDist are accepted. If nothing is connected, the interfering mark detection is deactivated and all found edges are detected. |
| di_WinSize | DINT | Permissible deviation (window width) of the edge distance of LH to HL edge or HL to LH edge in user units. Widths with di_DefSize ± di_WinSize are accepted. If nothing is connected, the interfering mark detection is deactivated and all found edges are detected. |
| ud_Units | UDINT | Number of user units for the corresponding encoder revolutions (u_Revolution). |
| u_Revolution | UINT | Number of encoder revolutions for the corresponding user units (ud_Units). |
| d_EncPos | DWORD | Encoder actual value of touch probe encoder. Format is 32-bit angle. |
| d_TP_PosLH | DWORD | Measured position of LH edge. Format: 16-bit revolution, 16-bit angle. |
| d_TP_PosHL | DWORD | Measured position of HL edge. Format: 16-bit revolution, 16-bit angle. |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Active | BOOL | TRUE: Module is active; initialization occurred without incident. |
| x_1stEdge | BOOL | First valid edge detected. x_1stEdge remains TRUE until x_Enable = FALSE. |
| x_Valid | BOOL | TRUE: Valid values at di_ActDist (and di_ActSize). Reset with x_Ack = TRUE. |
| di_ActDist | DINT | Depending on mode and measurement: Measured OR last valid OR maximum distance of LH edges or HL edges in user units. |
| di_ActSize | DINT | Depending on mode and measurement: Measured OR last valid OR minimum length of the LH to HL edge (or the HL to LH edge) in user units. |
| x_TP_Err | BOOL | TRUE: Faulty measurement, i.e. no edge found within window. Remains TRUE until valid measurement occurs or x_Enable = FALSE. |
| u_TP_ErrCnt | UINT | Number of faulty measurements in succession. Reset upon the first valid measurement. |
| x_Error | BOOL | TRUE: Error detected. See error table. |
| i_Error | INT | Error number. See error table. |
| s_ErrTxt | STRING | Error text. See error table. |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| _PMdata | PM_Type | Data from the TB_TPmeasure_Init initialization module. |

TB_TPmeasure_Init
This module initializes the required parameters for the TB_TPmeasure measurement module. The operating mode, encoder input and touch probe input are specified for this purpose.
The touch probe function in the controller is initialized using the specified parameters.
i_OpMode=0: Measurement of the distances between LH edges.
i_OpMode=1: Measurement of the distances between HL edges.
i_OpMode=2: Measurement of the distances between LH edges
and the distances between LH and HL edges.
i_OpMode=3: Measurement of the distances between HL edges
and the distances between HL and LH edges.
Input 1 or 2 can be used as the input for the touch probe. If using the BM4400, an FIO module must be plugged in slot D.
Either Encoder 1 or Encoder 2 can be used.
Note:This Technology block is just possible to use for the BM4400 or BM5000 Series.
Empfohlene Task: Cyclic
Verwendete Bibliotheken: MOTION_CONTROL_xxbd00 or higher TECH_TYPES_xxbd05 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Execute | BOOL | TRUE = Edge-sensitive execution, initialisation of the input parameters. FALSE = Not executed or reset of the FB outputs. |
| i_Mode | INT | Operating mode |
| i_DigIn | INT | Digital input used for the sensor. An FIO module must be used in slot D (bmaXX 4000) If the FB is executed when i_DigIn = 0, then the configuration of the probe inputs is reset. |
| i_Encoder | INT | Encoder used. The corresponding encoder must have been previously activated via Winbass! |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Ok | BOOL | TRUE: Initialization was successful. |
| x_Error | BOOL | TRUE: Error detected. See error table. |
| i_Error | INT | Error number. See error table. |
| s_ErrTxt | STRING | Error number. See error table. |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| _PMdata | PM_Type | Data for the TB_TPmeasure measurement module. |
| _Axis | AXIS_REF | Motion Control axis used. |

TB_TPmeasure_Init
This module initializes the required parameters for the TB_TPmeasure measurement module. The operating mode, encoder input and touch probe input are specified for this purpose.
The touch probe function in the controller is initialized using the specified parameters.
i_OpMode=0: Measurement of the distances between LH edges.
i_OpMode=1: Measurement of the distances between HL edges.
i_OpMode=2: Measurement of the distances between LH edges
and the distances between LH and HL edges.
i_OpMode=3: Measurement of the distances between HL edges
and the distances between HL and LH edges.
Input 1 or 2 can be used as the input for the touch probe. If using the BM4400, an FIO module must be plugged in slot D.
Either Encoder 1 or Encoder 2 can be used.
Note:This Technology block is just possible to use for the BM4400 or BM5000 Series.
Empfohlene Task: Cyclic
Verwendete Bibliotheken: MOTION_CONTROL_xxbd00 or higher TECH_TYPES_xxbd05 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Execute | BOOL | TRUE = Edge-sensitive execution, initialisation of the input parameters. FALSE = Not executed or reset of the FB outputs. |
| i_Mode | INT | Operating mode |
| i_DigIn | INT | Digital input used for the sensor. An FIO module must be used in slot D (bmaXX 4000) If the FB is executed when i_DigIn = 0, then the configuration of the probe inputs is reset. |
| i_Encoder | INT | Encoder used. The corresponding encoder must have been previously activated via Winbass! |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_Ok | BOOL | TRUE: Initialization was successful. |
| x_Error | BOOL | TRUE: Error detected. See error table. |
| i_Error | INT | Error number. See error table. |
| s_ErrTxt | STRING | Error number. See error table. |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| _PMdata | PM_Type | Data for the TB_TPmeasure measurement module. |
| _Axis | AXIS_REF | Motion Control axis used. |

TF_TPmeasure
This function block is doing the 16:16 Bit-shifting of the 32Bit LH/HL MT revolutions and 32Bit LH/HL MT angle values, which is needed for the connection to the TB_TPmeasure.
Empfohlene Task: Cyclic
Verwendete Bibliotheken: MOTION_CONTROL_xxbd00 or higher TECH_TYPES_xxbd05 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| ud_EncoderActualValue | UDINT | 32 Bit Position actual angle |
| ud_PosEdgeRevolutions | UDINT | 32 Bit positive edge revolutions |
| ud_PosEdgeAngle | UDINT | 32 Bit positive edge angle |
| ud_NegEdgeRevolutions | UDINT | 32 Bit negative edge revolutions |
| ud_NegEdgeAngle | UDINT | 32 Bit negative edge angle |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| d_EncPos | DWORD | Position actual angle (type converted to DWORD for connection to TB_TPmeasure input d_EncPos) |
| d_TP_PosLH | DWORD | 16:16 Rev/Angle value LH-edge shifted value of positive edge (for connection to TB_TPmeasure input d_TP_PosLH) |
| d_TP_PosHL | DWORD | 16:16 Rev/Angle value HL-edge shifted value of negative edge (for connection to TB_TPmeasure input d_TP_PosHL) |
Ein-/Ausgänge
| none |

TF_TPmeasure
This function block is doing the 16:16 Bit-shifting of the 32Bit LH/HL MT revolutions and 32Bit LH/HL MT angle values, which is needed for the connection to the TB_TPmeasure.
Empfohlene Task: Cyclic
Verwendete Bibliotheken: MOTION_CONTROL_xxbd00 or higher TECH_TYPES_xxbd05 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| ud_EncoderActualValue | UDINT | 32 Bit Position actual angle |
| ud_PosEdgeRevolutions | UDINT | 32 Bit positive edge revolutions |
| ud_PosEdgeAngle | UDINT | 32 Bit positive edge angle |
| ud_NegEdgeRevolutions | UDINT | 32 Bit negative edge revolutions |
| ud_NegEdgeAngle | UDINT | 32 Bit negative edge angle |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| d_EncPos | DWORD | Position actual angle (type converted to DWORD for connection to TB_TPmeasure input d_EncPos) |
| d_TP_PosLH | DWORD | 16:16 Rev/Angle value LH-edge shifted value of positive edge (for connection to TB_TPmeasure input d_TP_PosLH) |
| d_TP_PosHL | DWORD | 16:16 Rev/Angle value HL-edge shifted value of negative edge (for connection to TB_TPmeasure input d_TP_PosHL) |
Ein-/Ausgänge
| none |
