imgInterfaceOpen

NI IMAQ Function

imgInterfaceOpen

Usage

rval imgInterfaceOpen(const char* interfaceName, INTERFACE_ID* pifid);

Purpose

Opens an interface by name as specified in Measurement & Automation Explorer (MAX). If it is successful, this function returns an INTERFACE_ID.

Parameters

Name Type Direction
interfaceName const char* input
pifid INTERFACE_ID* output
rval Int32 output

Parameter Discussion

interfaceName: name of the interface to open, such as img0, img1, and so on.

Note  The interface name always identifies a single port of an image acquisition device. A port identifies a single independent data stream from a camera. All NI image acquisition devices support at least one port. Devices that support multiple ports can sustain independent and asynchronous acquisitions from the cameras on each port.

The port number may be explicitly identified by using the :: operator to append the port number suffix to the interface name. Port numbers are zero-based. For example, img0::1 opens port number 1 of the image acquisition device identified by img0. Interface names that do not have a port number suffix default to port 0. img0::0 and img0 are equivalent in meaning.

pifid: pointer to an INTERFACE_ID variable. If the function succeeds, the variable is populated with a valid INTERFACE_ID that you can use in subsequent functions.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.

Note  You can use imgInterfaceQueryNames to retrieve a valid list of interface names.