APX-3302 User's Manual (OM110000019A)
-35 -
5.2
Programming example
The programming examples for Snap (one shot snap) and Grab (streaming) for each are shown as below.
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.
Input size
: 640x480
XY delay
: (x, y) = (0, 0)
Processing bit : 8 bits
External trigger, random shutter: Invalid
5.2.1 Snap (one shot snap)
The programming example of Snap (one shot snap) 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
int
main(
int
argc,
char
*argv[])
{
HANDLE hDev;
int
nXSize, nYSize, nBoardBit;
int
nLoop = 1, nData = 0;
int
nCycle = 0, nScan = 0;
int
nCamera = 0;
PUCHAR pUserBuffer = NULL;
ACAPBOARDINFO abi;
// Get board information
AcapGetBoardInfo (&abi);)
// Open device
hDev = AcapOpen(abi.BOARDINDEX[0].pBoardName,
abi.BOARDINDEX[0].nBoardID, INPUT_CH);
// Initialize by ini file.
AcapSelectFile(hDev, INPUT_CH,
"Default.ini"
, 0);
Содержание APX-3302
Страница 1: ...APX 3302 User s Manual ...