FB_TpDistanceControl - General Information
Type: |
Function block |
Available as of: |
V1.0.3.0 |
Inherits from: |
- |
Implements: |
- |
Recording and saving product distances
The function block can be used in applications such as "Flying Saw" or "Infeed". The function block is used to implement an absolute correction.
The products are recorded via a measured input (Touchprobe function). The distance between the products (front edge to front edge) are measured and are stored in a FIFO buffer.
Input |
Data type |
Description |
---|---|---|
i_xEnable |
BOOL |
Value range: TRUE / FALSE A rising edge FALSE -> TRUE activates the POU, a falling edge TRUE -> FALSE deactivates the POU. A deactivated POU does not execute any actions. |
i_ifDrive |
IF_Drive |
Value range: Drive object Input for the axis that shall be connected to the LE at iq_lencEncoder. |
i_ifTouchProbe |
IF_TouchProbe |
Value range: Touch probe object Measured input over which the products are recorded. The input measures the rising edge of the Touchprobe. |
i_xReset |
BOOL |
Value range: TRUE / FALSE Deletes the FIFO buffer. With the next valid Touchprobe signal, the output q_xFirstTp is set. In contrast to enabling by means of i_xEnable, the Touchprobe function is not reset. Thus, no edge is lost. |
i_lrDefaultDistance |
LREAL |
Value range: >= 0 Normal distance of the parts to be measured in units, value range >= 0. If i_lrDefaultDistance > 0, then upon completion of the distance i_lrDefaultDistance + i_lrMinDistance a product will be simulated. That means the i_ lrDefaultDistance is written into the FIFO buffer and the output q_diNumberOfMissingTps is increased by one. With the next valid Touchprobe signal, q_diNumberOfMissingTps is set to zero. If i_lrDefaultDistance = 0, the Touchprobe signal is always waited for. |
i_lrMinDistance |
LREAL |
Value range: >= 0 Is used as a window for recording the Touchprobe signals. No new Touchprobe signal will be accepted within this distance. Values in units, value range >= 0. If i_lrDefaultDistance = 0, i_lrMinDistance should be > 0. Keep in mind products / parts will be simulated if no Touchprobe occurs within i_lrDefaultDistance + i_lrMinDistance. This can lead to conflicts with occured Touchprobe signals. |
i_lrMaxWaitDistance |
LREAL |
Value range: >= 0 Maximum distance for searching the first Touchprobe signal in units, value range >= 0. If 0, the maximum value is not checked. |
i_lrMaxCorrection |
LREAL |
Value range: > 0 With this value the distance, which is read from the FiFo via the method GetValue(), can be restricted. The remaining measurement is considered during the following reading. This parameter is only taken into consideration if i_lrDefaultDistance > 0 and q_diNoOfElementsInFiFo > 0. Value range > 0. |
Output |
Data type |
Description |
---|---|---|
q_xActive |
BOOL |
TRUE: The POU is active and has to be executed further. FALSE: The POU is inactive. |
q_xReady |
BOOL |
TRUE = The POU is ready to take measurements. FALSE: The POU is not ready. |
q_etDiag |
General library-independent statement on the diagnostic. A value not equal to ET_Diag.Ok corresponds to an diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
|
q_sMsg |
STRING[80] |
Event-triggered message which gives more detailed information on the diagnostic state. |
q_xFirstTp |
BOOL |
Indicates that the first product has been detected by the Touchprobe function. This signal is used to synchronize the application by means of the function block. |
q_diNumberOfMissingTps |
DINT |
This indicates that no product has been seen within the distance i_lrDefaultDistance + i_lrMinDistance. This signal is only triggered when i_lrDefaultDistance > 0. The output is set to 0 as soon as a new valid Touchprobe signal is detected. |
q_diNoOfElementsInFiFo |
DINT |
Indicates how many values are stored in the FIFO buffer. The FIFO buffer has been designed for a maximum of Gc_diMaxNumberOfElementsInFiFo values. If Gc_diMaxNumberOfElementsInFiFo values are exceeded, an error is released. With the method GetValue(), values can be read from the FiFo. |
q_lrTpCaptureDiff |
LREAL |
The difference between the position of the iq_lencEncoder to the period of the scanning with which the signal q_xFirstTP is set and the measurement at the Touchprobe signal. This value can be used to increase the accuracy in the application with the first synchronization. See registration mark control with absolute correction. |
q_lrTpCaptureValue |
LREAL |
Position when the last Touchprobe signal occurred. |
Input/Output |
Data type |
Description |
---|---|---|
iq_lencEncoder |
L_ENC |
Logical encoder for measuring the distance. The logical encoder has to be connected to the master axis. An individual logical encoder must be created for each instance of the function block. |
Following examples provide a detailed explanation of the recording and saving of product distances via FB_TpDistanceControl:
oIndexed application with absolute correction
oSynchronous application with absolute correction
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
9 |
The POU is disabled. |
|
OK |
4 |
The POU is being initialized. |
|
OK |
168 |
Waiting for first Touchprobe signal. |
|
OK |
169 |
Waiting for the next Touchprobe signal. |
|
ExecutionAborted |
103 |
The FiFo is full. |
|
InputParameterInvalid |
3 |
The connected drive is invalid. |
|
InputParameterInvalid |
162 |
The connected logical encoder is invalid. |
|
InputParameterInvalid |
163 |
The connected Touchprobe is invalid. |
|
InputParameterInvalid |
166 |
The Touchprobe is not active. |
|
InputParameterInvalid |
165 |
The connected Touchprobe is virtual. |
|
LimitReached |
170 |
MaxWaitDistance has been reached. |
|
SercosConditionInvalid |
19 |
The Sercos bus is not in phase 4. |
|
UnexpectedProgramBehavior |
1 |
An unintended detected error occurred during execution. |
Enumeration name: |
Disabled |
Enumeration value: |
9 |
Description: |
The POU is disabled. |
The function block is disabled and executes no actions whatsoever. i_xEnable and q_xActive are set to FALSE
Enumeration name: |
DriveInvalid |
Enumeration value: |
3 |
Description: |
The connected drive is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
At the input i_ifDrive, no drive was applied. |
At the input i_ifDrive, a valid drive must be transferred. |
- |
The connected drive does not support all required functionalities. |
Establish which functionalities are not supported by the drive by means of output q_sMsg. Use a drive which supports all required functionalities. |
Enumeration name: |
FiFoFull |
Enumeration value: |
103 |
Description: |
The FiFo is full. |
Issue |
Cause |
Solution |
---|---|---|
- |
Too many values have been entered into the FiFo. |
Ensure that no more than Gc_diMaxNumberOfElementsInFiFo values are entered into the FiFo. |
Enumeration name: |
Initializing |
Enumeration value: |
4 |
Description: |
The POU is being initialized. |
The function block is being initialized and thus is not yet ready to receive commands at its inputs.
The function block will signalize that it is ready for operation with the signal q_xReady = TRUE.
Enumeration name: |
LencInvalid |
Enumeration value: |
162 |
Description: |
The connected logical encoder is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
At the input iq_lencEncoder, no encoder has been applied. |
At the input iq_lencEncoder, a separate logical encoder must be transferred. |
Enumeration name: |
MaxWaitDistanceReached |
Enumeration value: |
170 |
Description: |
MaxWaitDistance has been reached. |
Issue |
Cause |
Solution |
---|---|---|
- |
The encoder has covered a distance of more than i_lrMaxWaitDistance without receiving a Touchprobe signal. |
Verify the Touchprobe sensor Verify whether the correct touchprobe has been connected to the i_ifTouchProbe connection. Disable the monitoring by setting the input i_lrMaxWaitDistance to 0. |
Enumeration name: |
SercosNotInPhaseFour |
Enumeration value: |
19 |
Description: |
The Sercos bus is not in phase 4. |
Issue |
Cause |
Solution |
---|---|---|
- |
The parameter State of the SERCOS bus is not 4. |
Set the SERCOS bus parameter PhaseSet to 4. Verify the SERCOS bus for errors. |
Enumeration name: |
TouchProbeInvalid |
Enumeration value: |
163 |
Description: |
The connected Touchprobe is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
The input i_ifTouchProbe is not connected with a valid Touchprobe. |
Ensure that a valid Touchprobe has been transferred at the input i_ifTouchProbe. |
Enumeration name: |
TouchProbeNotActive |
Enumeration value: |
166 |
Description: |
The Touchprobe is not active. |
Issue |
Cause |
Solution |
---|---|---|
- |
The Touchprobe functionality of the input on a Lexium62 is not enabled. |
Ensure that the parameter IOx_Mode of the input group (LXM62IO_InOutTP) has been set to Touchprobe / 1. |
Enumeration name: |
TouchProbeVirtual |
Enumeration value: |
165 |
Description: |
The connected Touchprobe is virtual. |
Issue |
Cause |
Solution |
---|---|---|
- |
The used touchprobe is not real. |
Ensure that the Touchprobe does not belong to a virtual device. (e.g. virtual Lexium62) |
Enumeration name: |
UnexpectedFeedback |
Enumeration value: |
1 |
Description: |
An unintended detected error occurred during execution. |
Issue |
Cause |
Solution |
---|---|---|
- |
An error occurred in the internal execution. |
Please inform the support team about this error. |
Enumeration name: |
WaitForFirstTouchProbeSignal |
Enumeration value: |
168 |
Description: |
Waiting for first Touchprobe signal. |
The function block is waiting for the first Touchprobe signal.
Enumeration name: |
WaitForNextTouchProbeSignal |
Enumeration value: |
169 |
Description: |
Waiting for the next Touchprobe signal. |
The Touchprobe signals are being searched for and evaluated.
Name |
Description |
---|---|
Read value from the FiFo. |