AVAL APX-3302 User Manual

Frame grabber camera link
Table of Contents

Advertisement

Quick Links

APX-3302
User's Manual

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the APX-3302 and is the answer not in the manual?

Questions and answers

Summary of Contents for AVAL APX-3302

  • Page 1 APX-3302 User's Manual...
  • Page 2 3. We made assurance doubly sure on the contents of this manual. However, if you find something questionable, incorrect, or omitted, please contact the shop of purchase. 4. Please note that AVAL DATA assumes no responsibility for any effects resulting from the application notwithstanding the article 3 above.
  • Page 3 APX-3302 User's Manual (OM110000019A) Before Reading User's Manual Following symbols and signal words are used in this manual to ensure that our customer can use this product safely and to prevent the harm to persons or property. Fully understand the meanings of these symbols before reading the body of the manual.
  • Page 4 APX-3302 User's Manual (OM110000019A) CAUTION: ◆♦Do not use this product in a watery or humid place. Otherwise it can cause electric shock. ◆ Do not hold the plug of equipment’s power cord with wet hand when connecting it to AC outlet. Otherwise it can cause electric shock.
  • Page 5: Table Of Contents

    3.1.2 SW2 setting ........................... 15 3.1.3 SW3 setting ........................... 15 3.1.4 CN7, CN8 setting .......................... 15 3.1.5 Mount APX-3302 into PCI Express slot ..................16 3.1.6 Cable connection .......................... 17 Software initial setting ......................... 18 3.2.1 What is SDK-AcapLib2 ......................... 18 3.2.2 SDK-AcapLib2 installation procedure ...................
  • Page 6 APX-3302 User's Manual (OM110000019A) 3.2.5 Firmware update tool ........................25 3.2.6 Uninstallation of each software ..................... 26 3.2.7 Installation trouble shooting ......................27 Chapter 4 AcapLib2Viewer Image acquisition ..................28 What is AcapLib2Viewer ......................28 What is ini file ..........................28 Image acquisition using AcapLib2Viewer ...................
  • Page 7 APX-3302 User's Manual (OM110000019A) 6.14 Notes for interrupt event, callback function................. 94 Chapter 7 Error codes ..........................96 Common error codes ........................96 Board error code ......................... 99 Extended error code (Windows) ....................101 7.3.1 Extended error codes returned by driver ..................102 7.3.2 Extended error codes related to buffer ..................
  • Page 8: Chapter 1 Precautions

    Chapter 1 Precautions Thank you for purchasing「APX-3302」 Please read this user's manual thoroughly to ensure the proper use of this product. Cautions: If you insert our products to x 16-lane port that is specified for the graphics card on the PC or motherboard, it may not work correctly.
  • Page 9: Cautions For Use Of Product

    APX-3302 User's Manual (OM110000019A) ■ Be careful not to get your hand injured by the front or rear surface of the module when handling the product. 1.1.2 Cautions for use of product Cautions Be sure to unplug the power code and turn off the power of the system before installing or removing this product.
  • Page 10: After-Sales Service

    Select one of the following methods for registration. Registration on the Website : A maintenance service registration page is in the support homepage of our homepage. A page for maintenance service registration in the support page on AVAL DATA’s homepage. http://www.avaldata.co.jp/support/regist_user.html Registration by FAX : Fill out a FAX registration form for maintenance service that is included with shipment.
  • Page 11: Customer Support

    * Membership registration is required. http://www.avaldata.co.jp/support/manual.html In addition, request a Support Line when it is difficult to download of the manual from the Website. AVAL DATA will send you it in electronic media, such as CD-R. (The customer is responsible for the shipping cost of the items.)
  • Page 12: Serial Number

    APX-3302 User's Manual (OM110000019A) 1.2.4 Serial number The serial number of the product is printed on the label on the main unit, the warranty certificate, the box, given each. Location of the serial number label of the product is shown below.
  • Page 13: Before Connect Us

    APX-3302 User's Manual (OM110000019A) 1.2.6 Before connect us Check the followings in advance when consulting with us for the failure or abnormality of the product A) Check the following in advance when consulting with us for the failure or abnormality of the product B) Have the Warranty certificate of the module at hand C) Prepare a simple note on the state of failure or abnormality.
  • Page 14: In The Case Of Transferring The Product To A Third Party

    APX-3302 User's Manual (OM110000019A) 1.2.8 In the case of transferring the product to a third party A) User who transfers the product Following conditions shall be satisfied when the product is transferred to a third party. ・All attachments to the module (instruction manual, warranty certificate, accessories, etc.) shall be transferred.
  • Page 15: Chapter 2 General Description

    General description of APX-3302 Product Summary APX-3302 is a LowProfile type PCI-Express frame grabber which supports CameraLink interface. On-board mini SDR26 pin connector allows connecting up to two independent CameraLink Base Configuration cameras for each. It has an I/O interface circuit compatible with APX-3312 that provides image acquisition control in conjunction with external devises.
  • Page 16: Specifications

    APX-3302 User's Manual (OM110000019A) Specifications The specifications of APX-3302 are described as follows. Item Specification Image Input Two independent Camera Link Base Configuration CameraLink Clock 20MHz to 85MHz Camera Control CC output Shaft Encoder Interface On-board UART (communications to camera)
  • Page 17: Block Diagram

    APX-3302 User's Manual (OM110000019A) Block Diagram The block diagram of APX-3302 Ch.6 AVAL IP I/O Connecor CrossPoint BusSwitch Ch.1 Capture AVAL IP SDR 26Pin Controller FIFO AVAL IP Controller 256MB Memory DDR2-SDRAM Camera Controller AVAL IP Controller Controller Flash 16MB...
  • Page 18: Front Panel

    APX-3302 User's Manual (OM110000019A) Front Panel The front panel view of APX-3302 is shown below. SDR26 pin CameraLink connector HDR-EC26LFDT1-SLD+ (FROM:HONDA TSUSHIN KOGYO) Ch.1 Ch.2 Figure2-2:Front panel An optional PCI standard front panel is provided, replace a front panel according to the type of PC.
  • Page 19: Connector Pin Assignment

    APX-3302 User's Manual (OM110000019A) Connector Pin Assignment This chapter describes connector on APX-3302. Heat Sink Figure2-4: Connector layout drawing 2.6.1 CameraLink connector CN1-CN2 CameraLink connector specifications are shown below. Compliant with CameraLink standard Manufacturer : HONDA TSUSHIN KOGYO Model : HDR-EC26LFDT1-SLD+...
  • Page 20: Expansion Connector Cn6

    The synchronizing-signal input (TTL) frame-grabbers IN_RES1 Inputs (TTL) in general OUT_RES1 Outputs (TTL/OC) in general Table2-3: Expansion connector is assignment AVAL DATA prepares from expansion connector to expansion panel cable ”CBL-Z091A” wired PCI standard panel. OUT_RES1 cannot be used by APX-3302. -13 -...
  • Page 21: Chapter 3 Settings And Interface

    APX-3302 User's Manual (OM110000019A) Chapter 3 Settings and Interface This chapter describes initial settings for Hardware and software of APX-3302. Hardware initial setting Set up the jumper and switch correctly before installing this product to the PC or devices. Figure3-1: jumper, switch layout drawing Be sure to turn OFF the power of the system before change jumper or switch settings.
  • Page 22: Sw1 Setting

    APX-3302 User's Manual (OM110000019A) 3.1.1 SW1 setting SW1 should be used in OFF anytime. 3.1.2 SW2 setting SW2 sets up Pull-Up as a general-purpose output. Cut Pull-Up resistor off by OFF then connect Pull up by ON Pull-Up resistor: 330Ω...
  • Page 23: Mount Apx-3302 Into Pci Express Slot

    If it is getting stuck with the input/output terminals assigned on the panel when removing it, do not remove by force, it can cause of failure. After insert APX-3302 into PCI slot, fix between a panel and case with fixation screw tightly. APX-3302 PCI Express slot(x4 and over)...
  • Page 24: Cable Connection

    - Connect between APX-3302 to camera using the cable which is compliant with CameraLink standard. - In the case of connecting between APX-3302 to an external device, use expansion cable CBL-Z091A. Refer to the cable pamphlet for the detail specification of CBL-Z091A.
  • Page 25: Software Initial Setting

    AcapLib2 is a library which enables control of various models of frame-grabbers with a common interface. ■ Drivers for various models of frame-grabbers The driver for various models of frame-grabbers including APX-3302 ■ Sample source Capture sample (VC++ / VC# / VB.NET) which supports any languages Sample for connecting various types of image-processing library ■...
  • Page 26: Sdk-Acaplib2 Installation Procedure

    ■ It does not support about for using 3G option in 32bit OS. AVAL DATA recommends using it by removing 3G option. ■ It is not supporting Windows XP Mode and Windows XP compatibility mode of Windwos7. ■ If the another version is installed already, be sure to install SDK-AcapLib2 after uninstalling it.
  • Page 27 APX-3302 User's Manual (OM110000019A) [Method 2] Click [install] at the side of [SDK-AcapLib2]. Figure3-7: Software [Method 3] Select [run] on [File download] is displayed. Figure3-8: Download of a file [Method 4] Click [Install]. *NOTE: If another version is already installed, [Uninstall] becomes effective.
  • Page 28 APX-3302 User's Manual (OM110000019A) [Method 5] Select [Browse] and chose other folder if you change the installation folder. Select [OK] if you do not need to change any settings. Figure3-10: Installation item [Method 6] When you check [Library] at installation selection, "Device Driver Installation Wizard" starts automatically.
  • Page 29 APX-3302 User's Manual (OM110000019A) [Method 8] When you check [TransFlyer (For_CoaXPress)] at installation selection, "AVALDATA TransFlyer" starts automatically. Follow instruction s and continue installing. * It is not necessary to install this software other than CoaXPress frame-grabber. Figure3-13: TransFlyer installation [Method 9] Finish application by clicking "...
  • Page 30: Serial Communication Driver (Virtual Com Driver)

    APX-3302 User's Manual (OM110000019A) [Method 10] Click Quit then the installation is finished. Figure3-15: Menu Press [Quit] to finish the installation. 3.2.3 Serial communication driver (virtual COM driver) Virtual COM is a software which has the function to assign each camera link port of AVALDATA’s frame-grabber as a virtual COM port on Windows.
  • Page 31: Registration Tool

    APX-3302 User's Manual (OM110000019A) 3.2.4 Registration Tool When you using a library, it is necessary to perform registration to PC using "Registration Tool." There is no case that the function takes restriction when it is used without registration. However the message, which...
  • Page 32: Firmware Update Tool

    Registration is completed if this message is appears. Figure3-19: Registration success 3.2.5 Firmware update tool Firmware update tool is the application for updating local FPGA firmware of APX-3302. It has the firmware update function as well as software switch setting function. Execute Start [AVALDATA]=>[SDK-AcapLib2] =>[Tool]=>[FirmwareUpdateTool]=>[FirmwareUpdateTool]...
  • Page 33: Uninstallation Of Each Software

    APX-3302 User's Manual (OM110000019A) 3.2.6 Uninstallation of each software ■ Uninstalling Virtual COM Driver [Method 1] Execute [Start] =>[AVALDATA]=>[SDK-AcapLib2] =>[Tool]=>[VirtualCOM]=>[avdCOMmng] [Method 2] Cancel all assignment of COM. Refer to Virtual COM tool user's manual (SDK-AcapLib2 VirtualComTool Manual (J2OM10016*)) for the details.
  • Page 34: Installation Trouble Shooting

    3.2.7 Installation trouble shooting Check following points, if any problem occurs during installation. ・ Check whether the hardware is connected correctly again. ・ Check whether the same problem occurs when you mount APX-3302 into other PCI Express slot ・ Refer to [Precautions befor...
  • Page 35: Chapter 4 Acaplib2Viewer Image Acquisition

    APX-3302 User's Manual (OM110000019A) Chapter 4 AcapLib2Viewer Image acquisition This chapter describes the procedure until acquire images using APX-3302 and AcapLib2Viewer. What is AcapLib2Viewer AcapLib2Viewer is the software for acquiring images using the many models of frame-grabbers including APX-3302. Main functions of AcapLib2Viewer are shown below.
  • Page 36: Image Acquisition Using Acaplib2Viewer

    APX-3302 User's Manual (OM110000019A) Image acquisition using AcapLib2Viewer Procedures until acquire images using AcapLib2Viewer. Refer to [SDK-AcapLib2 Viewer Manual (J2OM08014*)] for the detailed setting method. [Method 1] Select [All programs] from the start menu of Windows. Figure4-1: Start menu [Method 2] Select AcapLib2Viewer in [AVALDATA]->...
  • Page 37 ■ Board ID number Board ID number is a number which can be identified a solid when two or more APX-3302 are mounted into one PC. It is set as 0 at in the default. It can be changed into any value by using [Firmware Update Tool].
  • Page 38 APX-3302 User's Manual (OM110000019A) [Method 5] Select ini file of the camera be used from ini file by some camera manufactures in the folder. [SDK-AcapLib2 install folder] ->[AVALDATA]->[SDK-AcapLib2] ->[Sample]->[IniFile] Figure4-7: Ini file selection dialog [Method 6] Click [OK] after choosing ini file.
  • Page 39 APX-3302 User's Manual (OM110000019A) [Method 7] The main window will be displayed when the initialization is successful. Click a camera icon in the red frame, one shot snap will be performed. * A camera shall be set as a factory-shipments state, free run, and the power source shall be ON.
  • Page 40 APX-3302 User's Manual (OM110000019A) [Method 8] The acquired image, image acquisition time, frame rate will appear when the image acquisition succeeded. Figure4-10: Acquired image Error code with error dialog as below will appear when the image acquisition failed. Mis-setting of the frame-grabber or the camera, mis-connecting of the cable, input omission of external triggers or encoders, etc can cause of failure.
  • Page 41: Chapter 5 Programming Guide

    APX-3302 User's Manual (OM110000019A) Chapter 5 Programming guide This chapter describes the programming procedure using AcapLib2 is shown below. AcapLib2 flow chart Processing procedure using AcapLib2 // Get the board information AcapGetBoardInfo function // Open device AcapOpen function Initialization // Reading ini file AcapSelectFile - Open frame-grabber, get information and initialize using ini file.
  • Page 42: Programming Example

    GUI, such as a screen display or a dialog is not used. Moreover, error processing is not be performed here either. The program is premised on being the following conditions. Board : AVAL DATAs frame-grabber which found first by Windows, if two or more frame-grabbers are mounted Ini file : Default.ini (*) Ini file path: Hierarchy with a project file or an executable file (*) The main settings of Default.ini is as follows.
  • Page 43 APX-3302 User's Manual (OM110000019A) // Check camera type AcapGetInfo (hDev, INPUT_CH, ACL_SCAN_SYSTEM, 0, &nCamera);) if(nCamera == CAM_LINE){ // If the camera is Line sensor, confirm that exposure setting is performed. AcapGetInfo (hDev, INPUT_CH, ACL_EXP_CYCLE, 0, &nCycle);) AcapGetInfo (hDev, INPUT_CH, ACL_EXPOSURE, 0, &nScan);)
  • Page 44: Grab (Streaming)

    APX-3302 User's Manual (OM110000019A) 5.2.2 Grab (Streaming) The programming example of Grab (Streaming) is shown as below. <Sample code> #include <stdio.h> #include <conio.h> #include "AcapLib2.h" #pragma comment(lib, "AcapLib2.lib") #define INPUT_CH 1 #define CAM_LINE 1 void CALLBACK GrabCallbackFunc(int nChannel, DWORD dwEvent, nParam1, nParam2);...
  • Page 45 APX-3302 User's Manual (OM110000019A) // ch1: Setting for performing DMA to the buffer. AcapGetInfo (hDev, INPUT_CH, ACL_X_SIZE, 0, &nXSize);) AcapGetInfo (hDev, INPUT_CH, ACL_Y_SIZE, 0, &nYSize);) AcapGetInfo (hDev, INPUT_CH, ACL_BOARD_BIT, 0, &nBoardBit);) for(nCount= 0; nCount < 4; nCount++){ pUserBuffer[nCount] = (PUCHAR)_aligned_malloc(nXSize * nYSize * (nBoardBit / 8), 16);...
  • Page 46: Sample Capture Application

    APX-3302 User's Manual (OM110000019A) Sample capture application The capture sample applications for each programming languages, the samples for connecting various types of image-processing library are prepared within AcapLib2. 5.3.1 SimpleApplication The capture sample applications for each programming languages using AcapLib2 It is stored in the folder as below.
  • Page 47: Othersample

    APX-3302 User's Manual (OM110000019A) 5.3.2 OtherSample The samples for connecting AcapLib2 with various types of image-processing library It is stored in the folder as below. [Connecting samples using various types of image-processing library] - [SDK-AcapLib2 install destination] =>[AVALDATA] =>[SDK-AcapLib2] =>[Sample]=>[OtherSample]...
  • Page 48 APX-3302 User's Manual (OM110000019A) Following samples are contained in folder Refer to a manual of each sample for capturing samples when using other manufacture’s library. [SDK-AcapLib2 install destination] =>[AVALDATA] =>[SDK-AcapLib2] =>[Doc] =>[6_Technical] [OtherSample] Sample contents Folder AcapLib2Bayer VC++ sample which captures the image by AcapLib2 then performs bayer conversion.
  • Page 49: Chapter 6 Function

    - 10-12bit x2tap Monochrome - 24bitRGB x1tap Color APX-3302 has pix rearrangement function for the cameras that have two or more tap outputs camera image. APX-3302 corresponds to 20 MHz - 85 MHz clock. (Receiver is DS90CR288 manufactured by N.S Company.)
  • Page 50: How To Configure For 2Tap Output Cameras

    APX-3302 User's Manual (OM110000019A) 6.1.1 How to configure for 2TAP output cameras ■ The setting example for software The sample code for 2TAP output cameras is as follows. In this example, the data from camera is outputted in following order.
  • Page 51: How To Configure For 3Tap Output Cameras

    APX-3302 User's Manual (OM110000019A) 6.1.2 How to configure for 3TAP output cameras ■ The setting example for software The sample code for 3TAP output cameras is as follows. In this example, the data from camera is outputted in following order.
  • Page 52: Power Over Cameralink

    In the following case APX-3302 notifies invalid status and stop supplying power automatically. *APX-3302 cannot detect CameraLink clock from the camera after supplying power within the set time. *Camera stops CameraLink clock for any causes, and cannot begin to start CameraLink clock with in the set time.
  • Page 53 The sample code which performs to supply 1ch side camera and to configure the set time as 3000ms is as follows. Note: Supplying control is possible only when setting of the jumper (CN7/CN8) of APX-3302 is ON. For more information of the jumper setting, refer to [3.1.4 CN7, CN8...
  • Page 54: Camera Exposure Control Signal Cc

    APX-3302 User's Manual (OM110000019A) Camera exposure control signal CC APX-3302 can output camera exposure control signal CC (Camera Control). One of the external generation systems which operates as a factor can choose external signal inputs, such as exposure time, an internal generation system which sets up and operates an exposure cycle by software, or external triggering, an encoder.
  • Page 55 APX-3302 User's Manual (OM110000019A) ■ The setting example for software The sample code in the case of setting CC output cycle as 100 micro sec, and below, setting CC output width as 30 micro sec is described. * The output width of a CC signal should set up a value smaller than an output cycle.
  • Page 56: Serial Interface

    Serial interface APX-3302 carries the serial interface for camera communication for 2ch. - SerTC : The signal from APX-3302 to camera direction (transmit data) - SerTFG: The signal from camera to APX-3302 direction (receive data) Serial interface is connected to UART independent every channel of APX-3302.
  • Page 57 APX-3302 User's Manual (OM110000019A) ■ The setting example for software The sample code for sending command "AVAL" is as follows. In this code, an alphabetic code, a baud rate, and a final character carry out the following. Communication speed: 9600 bps Final character : CR (¥r)
  • Page 58: External Signal Input

    APX-3302 User's Manual (OM110000019A) External signal input APX-3302 can interface with peripheral device by using expansion connector (CN6). The signal names and the interfaces are shown below. Signal name Function ExTrg_1 TTL level: External trigger input terminal for Ch.1. It is below available for three kinds of uses.
  • Page 59 APX-3302 User's Manual (OM110000019A) SYNCLT_OUT TTL level, synchronizing-signal output terminal between frame-grabbers. Connect with the SYNCLT_IN terminal of a slave frame-grabber (synchronizing-signal report destination). OUT_RES1 It cannot be used in APX-3302. Table6-2: I/F of an external signal input -52 -...
  • Page 60 APX-3302 User's Manual (OM110000019A) The input circuit of an external signal is shown below. 1. TTL Level Input Terminal 4.7KΩ Extension connector CN6 ExTrg_1 ExTrg_2 Internal GP_IN1 circuit IN_RES1 74LCX14 equivalent Figure6-12: TTL input terminal Don't apply the voltage beyond +5V to a TTL terminal.
  • Page 61 APX-3302 User's Manual (OM110000019A) 2. RS422 Level Input Terminal Extension connector CN6 Enc.A+ Enc.B+ Enc.Z+ Internal circuit Diff+ 100Ω Extension connector CN6 Enc.A- Enc.B- Enc.Z- Diff- 26LS32 Figure6-13: RS422 input terminal When you use external trigger Input the "L" level stabilized more than the period of at least 25 uS(s).
  • Page 62 APX-3302 User's Manual (OM110000019A) 3. TTL / Open Collector Output Terminal 330Ω 1/8W SW2-1,2-2 Extension connector CN6 Internal circuit GP_OUT1 ALS641A GP_OUT2 Figure6-14: Open collector output terminal Don't apply the voltage beyond +5V to TTL / open collector output terminal.
  • Page 63: The Noise Rejection Function Of External Input Signal

    The noise rejection function of external input signal APX-3302 carries the noise rejection circuit of external trigger in each channel. It is possible to cover a digital filter over the selected external trigger, and to remove a single noise and the noise at the time of level variation.
  • Page 64: Strobe Output

    APX-3302 User's Manual (OM110000019A) Strobe output APX-3302 can output strobe signal that need to connect with external illuminating equipment. Strobe output is the output signal for adjusting camera exposure timing with external illuminating equipment and it is outputted from GPOUT terminal.
  • Page 65 APX-3302 User's Manual (OM110000019A) You can configure the illumination and exposure timing like the timing below by configuring delay time and output time. 1. Output strobe during camera exposure. CC Output Strobe Output Delay Strobe Delay>CC Delay Figure6-17: Strobe output pattern 1 ■...
  • Page 66 APX-3302 User's Manual (OM110000019A) 2. Exposure camera during output strobe. CC Output Strobe Output Delay CC Delay>Strobe Delay Figure6-18: Strobe output pattern 2 ■ The setting example for software The sample code to configure timing of CC output and strobe output is as follows.
  • Page 67: Synchronizing Signal Between Frame-Grabbers (Synclt)

    APX-3302 User's Manual (OM110000019A) Synchronizing signal between frame-grabbers (SYNCLT) APX-3302 has SYNCLT function that can synchronize camera exposure timing between multiple frame-grabbers. The connection diagram using SYNCLT to synchronize is as follows. Master SYNCLT_OUT Ch.1 CC Generating Circuit Ch.2 CC Generating Circuit ※Ch1 and Ch2 output CC at the same time...
  • Page 68: Configuration Steps Using Synclt (Area Sensor)

    APX-3302 User's Manual (OM110000019A) 6.9.1 Configuration steps using SYNCLT (Area sensor) Configuration steps for using Area sensor are as follows. Open master board and slave board. 1. Open and Initialization Initialize master board and slave board. Configure slave board to output CC by SYNCLT_IN.
  • Page 69 The sample code to capture image with 4ch synchronization by SYNCLT function is as follows. <Sample code> ///////////////////////////////////////////////////////////////////////////////////// Open and initialization ///////////////////////////////////////////////////////////////////////////////////// // The sample code capture image with 4ch synchronization of two APX-3302. #define MASTER_BID 0 #define SLAVE_BID 1 // Not to use hDev_Master [0] and hDev_Slave [0] HANDLE hDev_Master[3] = {INVALID_HANDLE_VALUE};...
  • Page 70 APX-3302 User's Manual (OM110000019A) Configure outputting CC as a following timing. Output width 20 [ms] Output cycle 100 [ms] Master board (ch1) Synchronous output Synchronous output Synchronous output Master board (ch2) Figure6-22: Output CC cycle and output CC width of the master frame-grabber...
  • Page 71 APX-3302 User's Manual (OM110000019A) SYNCLT_OUT that master board outputs is the same wave as CC output of master board. Since master board is combined with CC output and SYNCLT_OUT is also outputted, it is not necessary to configure SyncLT. The slave board needs to recognize the wave inputted into SYNCLT_IN as external triggering, and needs to set it up to output same CC.
  • Page 72 APX-3302 User's Manual (OM110000019A) Master board Output width 20 [ms] Output cycle 100 [ms] (ch1) SYNCLT_OUT Slave board (ch1) SYNCLT_IN CC1 [slave board (ch1)] Synchronous Synchronous Synchronous Synchronous output output output output CC1 [slave board (ch2)] Figure6-24: Output CC cycle and output CC width of slave frame-grabber...
  • Page 73 // when you use SYNC_LT with Line sensor. // This processing is not supported in AcapLib2 standard function, // you have to configure the register of APX-3302 directly. // The contents of processing // In the case of CH1: Set Bit0 of the register 1060h address to 0.
  • Page 74 APX-3302 User's Manual (OM110000019A) ///////////////////////////////////////////////////////////////////////////////// Start capturing ///////////////////////////////////////////////////////////////////////////////// // Register event (For description) AcapSetEvent(hDev_Master[ch_1], ch_1, ACL_INT_GRABEND, TRUE); AcapSetEvent(hDev_Master[ch_2], ch_2, ACL_INT_GRABEND, TRUE); AcapSetEvent(hDev_Slave[ch_1], ch_1, ACL_INT_GRABEND, TRUE); AcapSetEvent(hDev_Slave[ch_2], ch_2, ACL_INT_GRABEND, TRUE); // Master ch1 must start capturing in last. AcapGrabStart(hDev_Slave[ch_2], ch_2, 5);...
  • Page 75 APX-3302 User's Manual (OM110000019A) ///////////////////////////////////////////////////////////////////////////////////// Stop capturing ///////////////////////////////////////////////////////////////////////////////////// // After GRABEND event notified, order of stop is free AcapGrabStop(hDev_Master[ch_1], ch_1); AcapGrabStop(hDev_Master[ch_2], ch_2); AcapGrabStop(hDev_Slave[ch_1], ch_1); AcapGrabStop(hDev_Slave[ch_2], ch_2); // Cancel parent setting and Disable SYNCLT for quitting synchronization capture // Cancel parent setting of slave ch2 AcapSetInfo(hDev_Slave[ch_2], ch_2, ACL_SYNC_CH, 0, 0);...
  • Page 76: Encoder Input

    APX-3302 has encoder input interface. 6.10.1 Encoder input circuit APX-3302 has the incremental type encoder input circuit of RS422 interface. It can control exposure and image input timing interlocked with external devices (shaft encoder etc.). For the count of encoder signal, quad edge evaluation that using encoder A,B phase and double edge evaluation that using only encoder A phase are available.
  • Page 77: Encoder Count Timing

    APX-3302 User's Manual (OM110000019A) 6.10.2 Encoder count timing Double edge evaluation count of using A phase only is as follows. A Phase Figure6-27: Double edge evaluation counts of using A phase only The encoder count of using A phase only performs only addition.
  • Page 78: Encoder Operation Method

    APX-3302 User's Manual (OM110000019A) 6.11 Encoder operation method APX-3302 has three kinds of encoder operation methods. Each method is explained. 6.11.1 Relative position encoder Relative position encoder is the mode suitable for the Web inspection using Line camera, etc. It performs 1 line-scan every time the encoder proceed fixed distance.
  • Page 79 APX-3302 User's Manual (OM110000019A) ■ The setting example for software The sample code for capturing by Relative position encoder and Encoder scan mode is as follows. The setting of encoder is shown below. Select Encoder : Relative position encoder Encoder starting method...
  • Page 80: Absolute Position Encoder Single Point

    APX-3302 User's Manual (OM110000019A) 6.11.2 Absolute position encoder single point Absolute position encoder single point is the mode that is suitable for capturing using stage. For Relative position encoder mode, it resets counter every time pulse coincidence. For this mode, it always keeps moving distance (counter value) from starting point, so it can be certain start position on the stage that performs proceeding and returning repeatedly.
  • Page 81 APX-3302 User's Manual (OM110000019A) ■ The setting example for software The sample code for capturing 50 lines at round-trip each by Absolute position encoder single point and Encoder scan mode is as follows. The setting of encoder and the coordinate of each point that is shown at “Figure6-30: Absolute position encoder single point”...
  • Page 82 APX-3302 User's Manual (OM110000019A) ///////////////////////////////////////////////////////////////////////////////////// Point B: Finish capturing of outward trip ///////////////////////////////////////////////////////////////////////////////////// // Outward trip : Finish "50" line acquiring. Then stop capturing and configure return trip setting // Start capturing at absolute encoder count "9900". Configure as "CCW".
  • Page 83: Absolute Position Encoder Multi Point

    APX-3302 User's Manual (OM110000019A) 6.11.3 Absolute position encoder multi point Absolute position encoder single point is the expanded mode of Absolute position encoder multi point. It can generate coincidence pulse at any points you choose up to 256 during counting absolute count.
  • Page 84 APX-3302 User's Manual (OM110000019A) [Coordinates of every point] Point 1: 1000 count Point 2: 2000 count Point 3: 3000 count Point 4: 4000 count Point 5: 5000 count Point 6: 4000 count Point 7: 3000 count Point 8: 2000 count...
  • Page 85 // Outward trip: Configure comparison memory // Standard functions of AcapLib2 do not support this processing, // so you have to configure register of APX-3302 directly. // CH1: Configure comparison memory from register address 5000h // CH2: Configure comparison memory from register address 6000h for(i = 0;...
  • Page 86 APX-3302 User's Manual (OM110000019A) // Outward trip: Specify comparison memory starting position and finish position nStartPos = 0; nEndPos = 4; dwRegVal = (0x000000FF & nStartPos) << 8; dwRegVal | = 0x000000FF & nEndPos; // Configure the comparison memory starting position and finish position AcapSetInfo(ghDev, INPUT_CH, ACL_ENC_COMPARE_2, 0, dwRegVal);...
  • Page 87 // Configure encoder control register AcapSetReg(ghDev, INPUT_CH, 0, dwRegOffset, dwRegVal); Change absolute position encoder type to multi point. Configure bit30 of APX-3302 encoder control register as 1 by using AcapSetReg function. Do not change other bit. The address of encoder control register is 1028h for ch1 and 2028h for ch2.
  • Page 88 // Outward trip: Start frame number specifying capturing (Capture 5 frames) AcapGrabStart(ghDev, INPUT_CH, 5); Start counting of absolute position encoder multi point. Configure bit17 of APX-3302 encoder control register as 1 by using AcapSetReg function. Do not change other bit.
  • Page 89 APX-3302 User's Manual (OM110000019A) ///////////////////////////////////////////////////////////////////////////////////// point 5: Outward trip, finish capturing ///////////////////////////////////////////////////////////////////////////////////// // Outward trip: Finish 5 times capturing, then stop capturing and configure return trip. // Return trip: Specify comparison memory starting position and finish position. // Stop capturing AcapGrabStop(ghDev, INPUT_CH);...
  • Page 90 APX-3302 User's Manual (OM110000019A) ///////////////////////////////////////////////////////////////////////////////////// // point 6 - point 8: Return trip, start capturing // ///////////////////////////////////////////////////////////////////////////////////// // When absolute count reaches "4000", coincidence pulse is generated and capture 1 time. // After that, capture when counting reaches "3000","2000" or "1000".
  • Page 91: Mega-Fifo

    APX-3302 User's Manual (OM110000019A) 6.12 MEGA-FIFO APX-3302 can extract part from effective pixels of the camera, and input it into the image buffer. The image transfer function of APX-3302 performs that stores the image from the camera to large capacity image input buffer temporarily, and executes DMA transfer to PC host memory via buffer.
  • Page 92 AcapSetInfo(hDev, INPUT_CH, ACL_X_SIZE, -1, 640); // Configure ACL_X_SIZE // (2)X_DELAY // For APX-3302, use not ACL_X_DELAY but ACL_LVAL_DELAY for configure ID. // For 1TAP camera, configure LVAL_DELAY as same value of X_DELAY. // For 2TAP camera, configure LVAL_DELAY as one-half value of X_DELAY.
  • Page 93 APX-3302 User's Manual (OM110000019A) ■ Setting range and Restriction ACL_X_SIZE, ACL_Y_SIZE, ACL_Y_TOTAL, ACL_LVAL_DELAY, and ACL_Y_DELAY have the following restrictions, respectively. Therefore, Be aware to use each configuration ID. Configuration ID Setting range and Restriction ACL_X_SIZE 8bit/1tap 16-8192 (multiple of 16)
  • Page 94: Interruption

    APX-3302 User's Manual (OM110000019A) 6.13 Interruption APX-3302 can output one level interruption to PCI Express. You can choose multiple interrupts as a followings. - DMA end interrupt - Image input start interruption - Input (GPIN) interruption in general These interrupts is notified by the event or callback function.
  • Page 95: Event Usage

    // Open APX-3302 rtn; HANDLE hDevice; channel = 1; hDevice = AcapOpen("APX-3302", 0, channel); // Initialize by ini file. rtn = AcapSelectFile(hDevice, channel, "camera.ini", 0); // Set "Input start interrupt" and "1 frame input completion interrupt" rtn = AcapSetEvent(hDevice, channel, ACL_INT_GRABSTART, TRUE);...
  • Page 96 APX-3302 User's Manual (OM110000019A) ■ Cancel standby (abort) In AcapWaitEvent, process does not return until it receives interrupt or timeout occurs. When AcapSetEvent is performed by using ACL_INT_ABORT flag from other thread, standby process of AcapWaitEvent can be abort. ■ The setting example for software The sample code to abort the thread (Thread_WaitFrameEnd) that is waiting to be notified under ACL_INT_FRAMEEND is as follows.
  • Page 97: Callback Function Usage

    APX-3302 User's Manual (OM110000019A) 6.13.2 Callback function usage This section describes standby method of interrupt by callback function. Registration function has 2 kinds; AcapRegistCallback and AcapRegistCallbackEx. You can use either AcapRegistCallback or AcapRegistCallbackEx. You cannot use both at same time.
  • Page 98 APX-3302 User's Manual (OM110000019A) ■ Register callback function It registers callback function for notice of interrupt by AcapRegistCallback/AcapRegistCallbackEx. Only 1 callback function can be registered, but it can specify multiple interrupts. ■ The setting example for software The sample code to register callback function that occurs at "1 frame input completion interrupt" for ch1 is as follows.
  • Page 99 APX-3302 User's Manual (OM110000019A) ■ The setting example for software The sample code to register extended callback function that occurs at "input start interrupt" or "1 frame input completion interrupt" or "input end interrupt" for ch2 is as follows. <Sample code>...
  • Page 100 APX-3302 User's Manual (OM110000019A) ■ Registration cancellation of callback function Registered callback function is able to be canceled if performs 4 argument of AcapRegistCallback/AcapRegistCallbackEx as “NULL”. ■ The setting example for software The sample code to re-register callback function by different interrupt is as follows.
  • Page 101: Notes For Interrupt Event, Callback Function

    APX-3302 User's Manual (OM110000019A) 6.14 Notes for interrupt event, callback function ■ About delayed event and lost an event The thread in Acap library performs notifying interrupt event and calling callback function. So if delay occurs in performance of thread in state where CPU load are high, calling registered callback function and response of function AcapWaitEvent might be delayed.
  • Page 102 APX-3302 User's Manual (OM110000019A) Since “frame number which input completed (nFrameNo)”, the argument for callback function, counts up in real time at DMA transfer, it skips “frame number which input completed” if call of callback is delayed and executed after count-up.
  • Page 103: Chapter 7 Error Codes

    - Common error code (dwCommonErrorCode): The error code about AcapLib2 library function - Board error code (dwBoardErrorCode) : The error code peculiar to frame-grabber (APX-3302) - Extended error code (dwExtendErrorCode) : The error code of the driver factor and others Common error codes These codes are stored in "dwCommonErrorCode"...
  • Page 104 APX-3302 User's Manual (OM110000019A) ACL_REGIST_CALLBACK_ERROR 0xF118 Failed to register a callback function ACL_SET_ENCODER_ERROR 0xF119 Failed to set up an encoder ACL_GET_ENCODER_ERROR 0xF11A Failed to get an encoder ACL_SET_SHUTTER_TRIGGER_ERROR 0xF11B Failed to set up the trigger ACL_SET_LINE_TRIGGER_ERROR 0xF11C Failed to set up the line trigger...
  • Page 105 APX-3302 User's Manual (OM110000019A) ACL_GET_GPOUT_ERROR 0xF13D Failed to get GPOUT status ACL_PARAM_1_ERROR 0xF201 Parameter error (1st argument) ACL_PARAM_2_ERROR 0xF202 Parameter error (2nd argument) ACL_PARAM_3_ERROR 0xF203 Parameter error (3rd argument) ACL_PARAM_4_ERROR 0xF204 Parameter error (4th argument) ACL_PARAM_5_ERROR 0xF205 Parameter error (5th argument)
  • Page 106: Board Error Code

    APX-3302 User's Manual (OM110000019A) Board error code These codes are stored in "dwBoardErrorCode" of ACAPERRORINFO structure. Define value Hexadecimal Denotation ACL_3302_NO_ERROR No error ACL_3302_DRIVER_ERROR 0xF901 Driver error ACL_3302_INVALID_PARAM 0xF902 Invalid parameter ACL_3302_NO_DEVICE 0xF903 Cannot find a device ACL_3302_EVENT_ERROR 0xF904 Error for registering event...
  • Page 107 APX-3302 User's Manual (OM110000019A) ACL_3302_INVALID_BUFFER 0xF92B Invalid buffer ACL_3302_INVALID_XDELAY 0xF92C Invalid X Delay ACL_3302_INVALID_YDELAY 0xF92D Invalid Y Delay ACL_3302_INVALID_POWER_STATE 0xF92E Invalid camera power state ACL_3302_POWER_STATE_ERROR 0xF92F Camera power state error 0xF930 Cannot detect camera clock in designated time ACL_3302_POWER_ON_TIMEOUT although camera power was turned on...
  • Page 108: Extended Error Code (Windows)

    APX-3302 User's Manual (OM110000019A) Extended error code (Windows) These codes are stored in "dwExtendErrorCode" of ACAPERRORINFO structure. The meaning of inputting value is different by situation that error happens. Occurring Status Details Meaning of extended error code Internal Library Error...
  • Page 109: Extended Error Codes Returned By Driver

    APX-3302 User's Manual (OM110000019A) 7.3.1 Extended error codes returned by driver If error is stored at APX-3302, camera channel is stored at bottom. Since it becomes as “0 : CAM1 / 1:CAM2”, if “0x001E0001” is stored, → Value of XSize at CAM2 is invalid is shown.
  • Page 110 APX-3302 User's Manual (OM110000019A) Do not set “0”. Check Cause X size is not 8-byte alignment. 0x002A0000 Check Need to set this as 8-byte alignment (multiple by 8-byte). Cause Value of Y size is invalid. 0x002B0000 Do not set “0”.
  • Page 111: Extended Error Codes Related To Buffer

    APX-3302 User's Manual (OM110000019A) 7.3.2 Extended error codes related to buffer These are error codes that are stored when problem occurs at buffer registration process. It is mainly occurred when function like AcapSelectFile or AcapReflectParam is executed or setting is reflected (initialized) by function like AcapSetBufferAddress or AcapSetInfo.
  • Page 112: Firmware Update History

    APX-3302 User's Manual (OM110000019A) Firmware Update History Version Revised Date Revised Contents Ver.A(0x10) 2012.4.30 First edition -105 -...
  • Page 113: Revision History

    APX-3302 User's Manual (OM110000019A) Revision History Version Revised Date Revised Contents 2012.7.31 First edition -106 -...
  • Page 114: Inquiry

    APX-3302 User's Manual (OM110000019A) Inquiry APX-3302 user's manual July 31, 2012 first edition Edited and published by AVAL DATA CORPORATION © 2012 AVALDATA CORPORATION OM110000019A Head Quarters Machida office Sales department 1-25-10, Asahimachi, Machida-shi, Tokyo, 194-0023 TEL 042-732-1030 FAX 042-732-1032 :http://www.avaldata.co.jp/...

Table of Contents