Opens a device for acquisition.


int miraacq_OpenDevice(makernelpma, int deviceInd);


Parameters:


Return value:

MIRA_OK (0) or an error code.


Description:

miraacq_OpenDevice will open the specified device for acquisition, it requires that the devices have been scanned using miraacq_ScanDevices.


Example:

Note the MIRAACQ_CHECK macro, which will check if the return value was MIRA_OK (0) or an error code. In case of an error code, it will jump to a label called Error.


  1. MIRAACQ_CHECK(miraacq_ScanDevices(pma));

  2. int deviceInd = 0;
  3. MIRAACQ_CHECK(miraacq_OpenDevice(pma, deviceInd));
  4. printf("Device opened: %d '%s'\n", deviceInd, miraacq_GetDeviceName(pma, deviceInd));

  5. Error:
  6. if (res != MIRA_OK) {
  7.     printf("Error %d: %s", miraacq_GetErrorCode(pma), miraacq_GetErrorMsg(pma));
  8. }


Output:

Device opened: 0 'MC023MG-SY-UB'