
User Manual of Machine Vision Camera SDK Demo (LabVIEW)
Note: If exception or error occurred during the procedure, the prompt dialog will pop up.
2.3 Programming Guideline
2.3.1 Introduction of LabVIEW VI
To call the SDK of C API in the LabVIEW system conveniently, sub VI files are encapsulated into the LabVIEW
system. There are total 20 sub VI files in the MvCameraLib.lvlib: EnumDevices.vi, CreateHandle.vi,
DestroyHandle.vi, OpenDevice.vi, CloseDevice.vi, StartGrabbing.vi and StopGrabbing.vi are used for camera
operations, SetValue.vi and GetValue.vi are used to set and get camera parameters, SaveImage.vi is used to
save pictures. This VI files are the secondary encapsulation of SDK of C API, so they contain serval DLLs in the
SDK of C API.
Here we take EnumDevices.vi as an example. The input parameters of this API are nLayerType and error input.
nLayerType is a 32-bit integer, and it is used to input the enumerated device types, the value 1 represents
camera with GigE port, while the value 4 represents camera with U3V port. The output parameters contain
function return, DeviceNum, pstGigEDevArray, pstU3VDevArray, and error output. Function return is the
returned value of called API, return 0 for success, and return negative number (corresponds to error code) for
failure. DeviceNum is the number of enumerated cameras. pstGigEDevArray is the cluster array of GigE
camera information, while pstU3VDevArray is the cluster array of USB3 vision camera information. See the
definition of device information structure below:
typedef struct _MV_CC_DEVICE_INFO_
{
// common info
unsigned short
nMajorVer;
unsigned short
nMinorVer;
unsigned int
nMacAddrHigh; // MAC address
unsigned int
nMacAddrLow;
unsigned int
nTLayerType; // Device transport layer protocol type, e.g.,
MV_GIGE_DEVICE
3










