Seam Detection Logic
From ATTWiki
CNC Bender Seam Detect Logic uses a secondary process list that runs in parallel to the main process list in order to detect a seam.
The diagram on the right shows the main process in the orange box on the left. This is the actual bend program process.
The box on the right is the secondary process called SEAM_DETECT. It causes the rotate axes to spin until the seam is located and the seam detect input is ACTIVE. (This process can be modified for your application.)
When the seam is detected, then the SEAM_DETECT process STOPS RUNNING, causing the ROTATION JOG to also STOP.
Then the main process detects that the seam detect input is ACTIVE and moves to the next step (See "3" in the orange box).