Custom objects
This example makes use of additional position trigger objects defined outside of FB_XTS in a reusable, object-oriented solution. Understanding the use of the XTS Parameters is necessary for understanding this example.
The Application
A basic assembly and inspection station consists of the following processes in order:
- Load part A to mover
- Inspect part A at a line scan camera
- Load part B into part A on mover
- Inspect part A and B at a line scan camera
- Unload completed part
Stations 1, 3 and 5 are basic stop-wait-release stations. The line scan cameras in steps 2 and 4 require the movers to move at a defined speed and trigger the camera at the appropriate point. This example will use custom position triggers defined inside a reusable line scan camera FB to create these stations.
Solution discussion
While this application can be solved using only the built in XTS.Station[] and XTS.PositionTrigger[] objects, care will need to be taken to keep track of which station indexes and position trigger indexes are grouped together and in which order. In this very small example this is not difficult to manage, but in larger applications these types of mappings can become cumbersome.
Here is one way this could be implemented using only FB_XTS objects
XTS.Station[1]feeds the line scan camera surrounded byXTS.PositionTrigger[1]andXTS.PositionTrigger[2]XTS.PositionTrigger[2]feedsXTS.Station[2]XTS.Station[2]feeds the line scan camera surrounded byXTS.PositionTrigger[3]andXTS.PositionTrigger[4]XTS.PositionTrigger[4]feedsXTS.Station[3]- Movers return to station 1
From the above sequence you can see that it very quickly becomes difficult to trace the flow through these processes.
By createing a new line scan camera object to contain the position triggers and skipping some unneeded station indices we can make this much more readable
- XTS.Station[1] feeds LineScan2
- LineScan2 feeds XTS.Station[3]
- XTS.Station[3] feeds LineScan4
- LineScan4 feeds XTS.Station[5]
The line scan station
Because of the need for speed changes two position triggers will be used before and after the line scan camera to adjust the mover's speed. The first position trigger will also start the camera's scanning.
The FB LineScanCamera will be created to implement this solution.
Declarations
We start by declaring two position triggers inside the LineScanCamera.
1 2 | |
We'll also need an interface to a camera and a few other intermediate variables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Initialization
Position triggers need to be registered with the XTS system. This accomplishes two things:
- The PositionTrigger.Cyclic() routine is called automatically for us by the Mediator
- The position trigger will automatically be populated with all movers on the system.
We also need to set the locations of the position triggers.
1 2 3 4 5 6 7 8 9 10 11 12 | |
Start position trigger
The start position trigger slows down the mover and triggers the camera.
Position Trigger and the Mover's Payload are used by this code. Details of their use can be found in the links.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
End Position Trigger
The end position trigger checks the camera result and speeds up the mover. It does not directly send the mover to the next station, as the station destination was already set by the preceding load station.
Position Trigger and the Mover's Payload are used by this code. Details of their use can be found in the links.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
MAIN Implementation
First declarations on MAIN need to be added for the two position triggers
1 2 3 4 5 6 7 | |
Then within the MAIN.StationLogic we'll add code to implement the load, scan, load, scan and unload sequence defined above. More complete examples and discussion of Station-to-Station motion is available.
Pay careful attention to the sequence of how movers are sent from one station to the next.
- XTS.Station[1] sends its mover to XTS.Station[3]
- XTS.Station[3] sends its mover to XTS.Station[5]
Since we do not stop at the line-scan camera, we can send the movers directly to the next stop position. The line scan code will adjust the mover's speed accordingly, but will not change the destination.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |