Getting Started with PLDA's PXI Express XpressLite CY2: A Case Study of Assembly Line Vision-Based Quality Assurance The PXI Express XpressLite CY2, a PXIe x1 Endpoint add-in board based on Altera's Cyclone II FPGA, is designed for immediate product implementation, as described in the following case study. 1) Identify a Need Sandcastle Security Systems (SSS) produces home-protection appliances such as video surveillance systems and alarms. One of their more specialized products, the TreMor530, relies on a precision- crafted motion detector to thwart the would-be tunneling thief. "The technological details of the system are confidential," explains Mr. Castle, CFO of SSS. "But I can say that even the slightest discrepancies in the manufacturing process dramatically skew the TreMor's results. Our solution—visual quality assurance on the assembly line to ensure that each and every part meets our high standards." 2) Define Requirements The system requires real-time image processing of many machine manufactured parts at a time. One of the best-suited cameras for such a task is the Basler A202K, a high-resolution scan camera with a frame rate of up to 48 fps. The Basler A202K has a resolution of up to 1004 X 1004, is highly sensitive and programmable, and includes electronic exposure time control. More importantly, the Basler includes a Base CameraLink Output, which requires 40 LVCMOS I/Os @ 40 MHz. 3) Assess Resources The PXI Express XpressLite CY2 Dev Kit offers the resources necessary to capture an image from the Basler, perform any necessary brute treatment of the image, and pass it on to a PC where software handles the fine comparison of pattern matching and makes an accept / reject decision. The PXIe Dev Kit includes 80 I/Os @ 125 MHz, which means it easily covers the requirements of the Basler A202K and supports the potential for integrating additional resources. 4) Develop of a daughter card The PXIe CY2 is designed for a multitude of tasks, including applications in such fields as high-speed imaging, streaming communication, real-time signal processing, data acquisition, and module instruments. In order to adapt the board to the current project, it's necessary to build a daughter card that extends the CY2 with a KLINK Base connector. (PLDA sells a range of daughter cards, including the KLINK_Base. Please visit www.plda.com for details). 5) Establish System Architecture With the addition of a CameraLink cable, the raw building blocks of the Sandcastle system are established, and include: the Basler A202K camera, a CameraLink cable that connects the camera to the daughter card, and the PXIe Dev Kit that connects to the PC. A fifth block, the PXIe IP Controller, is delivered pre-installed in the FPGA on the PXIe CY2, and handles PXIe bus communication. The IP Controller is completely configurable and implements a PCI- like backend, offering the strengths of the PCIe technology while hiding the complexity of the protocol. 6) Develop a design The IP Controller is delivered with a Reference Design and simulation scripts used to illustrate how the IP functions. The Reference Design also serves as a simple stepping stone for building an application- specific design. It can be modified to initialize and configure the camera, dialogue with the camera, and establish a link with the PC. In most cases, the Reference Design need only be changed within the Application-specific part of the code, but how PCIe communications are handled can also be modified using the included IP Wizard. The IP Controller includes a complete and ready-to-use simulation environment (testbench and simulation scripts) and is compatible with the most common simulation tools, such as NCSim, Modelsim, and VCS. 7) Create LabVIEW environment LabVIEW is a software application that permits the creation of virtual instruments (VI) used to manipulate and display user input, in this case images passed from the Basler camera. VIs are built in a visual drag-and-drop environment a simple (and powerful) way to develop an image-processing application. The Sandcastle VI dialogues with the IP Controller and, given a particular image, defines the proper action using processing functions. 8) Build LabVIEW Processing Functions LabVIEW comes with a library of established processing functions that can run routine tasks, such as serial code detection, measurement of specified features in an image, and pattern matching. For the Sandcastle VI, a combination of processing functions are adapted to verify both the serial number of each part as well as the part's pattern. The serial number of malformed parts are noted and the part removed from assembly, helping to ensure the safety of homes everywhere. ### For more information about the PXIe XpressLite CY2, please visit www.plda.com/products/board_pxie_cy2.php. To learn more about PLDA and browse the company's complete product line, please visit www.plda.com.