Before a camera can be used by a LabVIEW application, it has to be initialized.


A simple VI that does nothing but initialize and uninitialize the camera is shown below.




This simple VI uses the Initialize and Uninitialize VIs. 


If more than one camera is connected to the system, the serial number of the desired camera can be passed to the Initialize.vi function. The GetNumberCameras.vi can be used to determine the number of devices that are connected to the computer and the serial number of each device. The vi returns an array of serial numbers and the number of elements in the array. This array and a loop can be used to initialize all the cameras connected to the computer as shown below.





To set or check camera features, use the GetFeature.vi or SetFeature.vi


To grab a single frame to memory, use the GetNextFrame.vi. This function returns a data array or it can copy data to a buffer if provided a pointer to the buffer.


The following VI example initializes the camera, grabs a single frame and then uninitializes the camera. The output is an array with the image data.  This is similar to the IMAQ Snap.vi.



If you want to see the image on the screen, use the SetPreviewState.vi to open a preview window once the stream has been started.


More complex camera operation is possible using callback functions to perform image processing or descriptors to change camera features on a frame-by-frame basis.