The Festo_PartDetector.lib library
13
1.7 Interfaces – Outputs
Output Type Description
Connected BOOL This output is TRUE if there is a Telnet connection to the
camera.
PictureDone BOOL This output is TRUE for a cycle if a new picture has been taken
and processed. If the module is accessed a further time, it is
FALSE again.
NewPartsCount INT This output shows how many new parts were found in the last
picture.
• Evaluate this output if PictureDone is TRUE.
Example
myPartDetector();
IF myPartDetector.PictureDone THEN
FOR i:=0 TO (myPartDetector.NewPartsCount-1) DO
myID := myPartDetector.NewPartsList[i].ID;
myX :=
myPartDetector.NewPartsList[i].vector[PD_X];
END_FOR
END_IF
NewPartsCumulated
DINT Total of all newly detected parts since the last program reset.
NewPartsList ARRAY[0..15]
OF
PD_PART
Output of the newly found parts.
( PD_Part structure)
LastFrameTime DWORD Time between the taking of the last and the penultimate picture
(unit: ms).
PictureDistance LREAL Movement of the conveyor between the last and the penultimate
picture in the unit of the Compact Vision System.
If this value is greater than ½ x camera field of vision, the
module no longer operates reliably.
• Increase the frame rate or
• reduce the speed of the conveyor.
Error BOOL Displays an internal error.
This error is reset when the Compact Vision System is
connected to the PLC again.
ErrorID WORD Number of the error.
For the meaning of the error numbers, refer to the
documentation for the "Festo_CameraControl.lib"
library(additional errors  Error list table).
PD_PART structure
Component Data type Description
EntireVectorValid BOOL TRUE if none of the vector scales have an invalid value.
ID DINT ID of the new part.
EncoderValue DINT Value of the encoder, which was buffered when taking the picture.
Vector ARRAY[0..7]
OF LREAL
Vector with received values.
Default values: (representation in CoDeSys)
– Scales not used: 3.4e+38
– Scales not allocated in the data output: 1.#INF (+∞)