| MIL 10 Board Specific Notes
| Customize Help

Using GigE Vision with MIL



See also

To use your Matrox GigE Vision driver with MIL, you must allocate a MIL GigE Vision system (M_SYSTEM_GIGE_VISION), using MsysAlloc(). This allocation opens general communication with all the GenICam SFNC-compliant cameras found on your subnet (through one or more Gigabit Ethernet network adapters in your computer). Then, allocate a digitizer for each camera (network camera) that you want to use to grab images and/or access directly, using MdigAlloc(). In the case where you have only one network camera, use MdigAlloc() with M_DEV0. If, however, you have multiple network cameras, you should use the M_GC_CAMERA_ID() macro and specify the camera's name; this will make for more portable code. You can use the Matrox Capture Assistant utility to view a list of available GigE Vision-compatible cameras and their user-defined name. For information on this utility, refer to the Matrox GigE Vision tools section later in this chapter. For information regarding working with multiple cameras, refer to the Working with one or more GigE Vision cameras subsection of this section.

Each process (executable) can allocate only one MIL GigE Vision system; an error will occur if you try to allocate more than one. Multiple processes can allocate a MIL GigE Vision system.

To inquire the current value of the required GigE Vision camera feature, use MdigInquireFeature(). If a GigE Vision camera feature is not already set to the required value, use MdigControlFeature() to change the value of the feature. Functionality is also supported with the conventional MIL functions MdigInquire() and MdigControl(). To learn the list of GenICam-standard features available, refer to GenICam's standard feature naming convention (SFNC), available on the GenICam website at: http://www.genicam.org. Additional GenICam SFNC-extension features might be available; check your camera's manual and Matrox Intellicam's Feature Browser for details.

Matrox Intellicam's Feature Browser accesses the GigE Vision-compliant camera's device description file (XML), providing an interface to view and change the camera's information. For more information, refer to the Using MIL with GenICam section of Chapter 23: Grabbing with your digitizer.

GigE Vision information in the MIL Reference can be found in the paragraphs and values marked as being supported by the Matrox GigE Vision driver. Refer to the Matrox GigE Vision driver release notes for any additions/modifications to this chapter.

Non-paged memory usage

With each call to MdigAlloc(), a certain amount of memory is reserved so that MIL can create internal buffers. To calculate the exact amount of memory reserved, inquire the amount of non-paged memory used before and again after you call MdigAlloc(); to perform the inquire, use MappInquire() with M_NON_PAGED_MEMORY_USED. MIL uses this reserved non-paged memory when grabbing and when decoding image data received in "chunk mode".

If your application requires more non-paged memory than is currently available, increase the amount of non-paged memory accessible to MIL using the MILConfig utility.

Working with more than one Gigabit Ethernet network adapter

When your computer has more than one Gigabit Ethernet network adapter installed, you can use each network adapter to access cameras on different subnets. Alternatively, multiple network adapters can simply be used to increase the number of cameras to which you have access. Unless otherwise specified, this documentation uses the model of one network adapter connected to a local subnet on which one or more GigE Vision cameras exist.

When dealing with more than one Gigabit Ethernet network adapter, the list of your GigE Vision cameras in the Matrox Capture Assistant utility is subdivided by the network adapter to which they are visible. Both the network adapters and their associated GigE Vision cameras are listed in the order of their MAC addresses.

For more detailed information regarding network configurations and GigE Vision camera setup, refer to the Matrox Capture Assistant white paper (located in your Matrox Imaging\Tools folder).

Working with one or more GigE Vision cameras

When there is more than one network camera available, the network discovery process (in the Matrox Discovery Service utility and in Microsoft Windows) ranks the GigE Vision cameras according to their MAC address. For example, the camera having the lowest MAC address is ranked as device zero; the rank increments by one for each camera having a subsequently greater MAC address. MIL uses the camera's rank when you allocate a digitizer with a device number (using MdigAlloc() with M_DEVn); so the rank 0 camera becomes M_DEV0. When you replace a GigE Vision camera on your subnet, its rank might not be the same as the camera you are replacing. This means that the rank of all the GigE Vision cameras could shift to allow the new camera into the sequence the next time you stop and restart your application. When you try to allocate the new camera (to replace the old camera), if the rank is different, the allocation might fail or worse, it might succeed, but the images captured by the camera actually allocated will not be of what you expect.

To avoid this problem, assign the camera a user-defined name or IP address, using Matrox Capture Assistant (on the Device information tab), and then use this name when you allocate a digitizer for this camera.

To allocate a camera with a user-defined name, use MdigAlloc() with M_GC_DEVICE_USER_NAME and specify your camera's name. Then, when a camera needs to be replaced, set the user-defined name of the new camera to match the name of the camera that it replaced. Allocating your GigE Vision camera using the camera's name allows your application to work with the new camera without modifying either your application or your application's configuration. Alternatively, if your subnet uses static IP addresses, you can use IP addresses to identify your cameras (using M_GC_DEVICE_IP_ADDRESS).

A new GigE Vision camera (added to the subnet as a new camera or a replacement) is not allocated by default and, although it is present, it is not available to your application until you allocate it using MdigAlloc(). If an allocated camera is removed from your subnet, free it using MdigFree().

To watch for new cameras on your subnet, use MsysHookFunction() with M_CAMERA_PRESENT. Note that verifying the camera's state (through the hooked function) should be done before your application relies on information from the camera.

Use MsysInquire() with M_DIGITIZER_NUM to determine the number of cameras available on your subnet. This number is updated when you allocate your system, and again if called by a function hooked to a M_CAMERA_PRESENT event. Note that this number is not affected by the number of digitizers allocated for the cameras.

Working without a Matrox board as your Gigabit Ethernet network adapter

To successfully allocate a MIL GigE Vision system without a Matrox board as your Gbit Ethernet network adapter, you must already have purchased the Matrox GigE Vision driver license (regardless if you have a license for MIL development, MIL runtime, or MIL-Lite). To determine whether you have a Matrox GigE Vision driver license, use MappInquire() with M_LICENSE_MODULES; it should return M_LICENSE_INTERFACE.