Your browser does not allow scripts
Please click here to view a static table of contents without scripts
DS1M12_OpenSpecifiedDevice
Return to Introduction  Previous page  Next page
This function opens a specific DS1M12 using its serial number.

DS_STATUS
DS1M12_OpenSpecifiedDevice
(LPSTR lpSerialNumber, DS_HANDLE *pdsHandle)




Parameters
lpSerialNumber
Pointer to a NULL terminated string that contains the serial number of the specified DS1M12 to be opened. The serial nunmber of the device is returned from DS1M12_GetDeviceSerialNumber.
pdsHandle
Pointer to a variable of type DS_HANDLE where the handle to the open device will be returned. This handle must then be used in all subsequent calls to access this device.




Return Value
Returns DS_SUCCESS if successful, otherwise the return value will be one of the following error codes:

   DS_NULL_SERIAL_NUMBER_BUFFER_POINTER
   DS_INVALID_SERIAL_NUMBER
   DS_DEVICE_NOT_FOUND
   DS_DEVICE_IN_USE
   DS_DEVICE_IN_USE_DEVICE_NOT_FOUND
   DS_FAILED_TO_SYNCHRONIZE_DEVICE
   DS_
FAILED_TO_COMPLETE_COMMAND
   DS_IO_ERROR
   DS_INSUFFICIENT_RESOURCES



Remarks
This function first determines which attached application is invoking this function. If an attached application invokes this function again and it's assigned handle is still open then it's assigned handle will be returned again. If another application attempts to open this device, which is already in use, an error code is returned. This function first determines if the specified DS1M12 is present then checks that an application is not already using the specified DS1M12. If another application is not using the specified DS1M12 then an attempt is made to open it. If the open was not successful an error code will be returned. If the open is successful, the specified DS1M12 is initialized to its default state. If the initialization was successful the handle is passed back to the application. If the initialization was not successful an error code will be returned.