Allocate a digitizer.
MIL_ID MdigAlloc(SystemId, DigNum, DataFormat, InitFlag, DigIdPtr)
|MIL_ID SystemId;||System identifier|
|long DigNum;||Digitizer number|
|char *DataFormat;||Data format name or file name|
|long InitFlag;||Initialization flag|
|MIL_ID *DigIdPtr;||Storage location for digitizer identifier|
This function allocates a digitizer on the specified system so that it can be used by subsequent MIL digitizer functions.
A digitizer on the target system must be allocated in order to acquire data from an input device.
Upon execution of this command, MIL ensures that the digitizer is present before allocating it and generates an error if it is not.
The default input channel is determined by the selected input device data format (generally, M_CH0). Some digitizers have multiple input channels. You can switch to another channel by using MdigChannel.
When you have completely finished using a digitizer, you should free it, using MdigFree.
The SystemId parameter specifies the identifier of the system on which the digitizer will be allocated. This parameter must be given a valid system identifier.
The DigNum parameter specifies the number (or rank) of the digitizer that is required. This parameter can be set to one of the following:
|M_DEFAULT||Default digitizer (the same as M_DEV0).|
|M_DEV0||The first digitizer on the specified system.|
|…||The nth digitizer on the specified system.|
|M_DEV15||The sixteenth digitizer on the specified system.|
The DataFormat parameter specifies the name of the data format or the name of the file in which the data format of the input device can be found. Depending on the target system, different data formats can be supported. See the appendix in this manual that applies to your specific board, the read.me file of the MIL drivers, or the user guide of your specific board for the valid values. This parameter can also be set to M_CAMERA_SETUP, which indicates to MIL to use the camera format specified in the milsetup.h file.
The InitFlag parameter specifies the type of initialization you want to perform on the digitizer. This parameter should be set to M_DEFAULT.
The DigIdPtr parameter specifies the address of the variable in which the digitizer identifier is to be written. Since the MdigAlloc function also returns the digitizer identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.
The returned value is the digitizer identifier. If allocation fails, M_NULL is returned.