pdv_open and pdv_open_channel differ only in the channel argument. Since many applications are written for single channel boards (for example, the VisionLink F1) pdv_open will often suffice for opening a handle to the device. However it is just as easy to use pdv_open_channel with zero-assigned variable in the channel argument, providing for future possible expansion to multiple channel boards.
Functions | |
int | pdv_close (PdvDev *pdv_p) |
Closes the specified device and frees the device struct and image memory. | |
PdvDev * | pdv_open (char *dev_name, int unit) |
Opens channel 0 of an EDT Framegrabber for application access. | |
PdvDev * | pdv_open_channel (const char *dev_name, int unit, int channel) |
Opens an EDT Framegrabber channel for application access. |
int pdv_close | ( | PdvDev * | pdv_p | ) |
PdvDev* pdv_open | ( | char * | dev_name, | |
int | unit | |||
) |
Opens channel 0 of an EDT Framegrabber for application access.
Opens the device, which is the first step in accessing the hardware. Allocates the memory for the device struct, as defined in libpdv.h (included through edtinc.h), and host memory required to store a captured image.
To open a specific channel on multi-channel device, see pdv_open_channel.
dev_name | The name of the device, which for all EDT Digital Imaging boards is "pdv" . If dev_name is NULL, "pdv" will be assumed. EDT_INTERFACE can also be used (recommended); it's defined as "pdv" in edtdef.h. | |
unit | Unit number of the device (board). The first device is 0. |
PdvDev* pdv_open_channel | ( | const char * | dev_name, | |
int | unit, | |||
int | channel | |||
) |
Opens an EDT Framegrabber channel for application access.
Opens the device, which is the first step in accessing the hardware. Allocates the memory for the device struct, as defined in libpdv.h (included through edtinc.h), and host memory required to store a captured image.
If you only want to use channel 0 on a multi-channel board, you can use pdv_open, but using pdv_open_channel with 0 in the channel argument is preferred.
pdv_open_channel provides for multiple cameras on separate channels, on boards that have multiple channels. Calling pdv_open_channel with using a specified board and channel returns a pointer to a software structure representing the connection to a specific camera -- channel 0 for the camera on the connector closest to the PCI bus, channel 1 for the next connector up, and so on. Each call to pdv_open_channel with a unique channel number returns a discrete pointer, which is handled separately from any others, just as if each camera were connected to separate boards.
Example
// Example of opening and acquiring images from two cameras connected // to separate channels 0 and 1 of a single VisionLink F4, PCIe8 DVa C-Link, // or other multi-channel EDT Digital Imaging board PdvDev *pdv_p0 = pdv_open_channel(EDT_INTERFACE, 0, 0); PdvDev *pdv_p1 = pdv_open_channel(EDT_INTERFACE, 0, 1); unsigned char *image_p0 = pdv_image(pdv_p0); unsigned char *image_p1 = pdv_image(pdv_p1);
dev_name | The name of the device, which for all EDT Digital Imaging boards is "pdv" . If dev_name is NULL, "pdv" will be assumed. EDT_INTERFACE can also be used (recommended); it's defined as "pdv" in edtdef.h. | |
unit | Unit number of the device (board). The first device is 0. | |
channel | The channel of the specified unit to open. The first channel is 0. |