LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ejecting CD programmatically

How can I open and close CD drives programmatically from Labview 7.0?

Thanks
0 Kudos
Message 1 of 6
(3,040 Views)
If you're using windows you can use a windows API function for this. I'm attaching an example (7.0). I suggest you look up this function in the MSDN, so you can learn from this.

___________________
Try to take over the world!
Message 2 of 6
(3,029 Views)
Thanks. It works good. But if I try to open it while it is open i do not get any error or warning. Same is true when it closed. Is there any other dll call that you are aware of that will communicate the state of CD drive (open or close)...Thanks in advance.
0 Kudos
Message 3 of 6
(2,993 Views)
I wasn't even aware of this function. I just made a quick google search. I'm not at all convinced that windows even knows whether the CD is open or not, but I suggest you search the MSDN to find out.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(2,985 Views)
The CD drive is considered to be part of the MCI (Media Control Interface) devices. These devices work with the Windows MCI API. Currently there are two functions only that control the MCI devices:
mciGetErrorString
mciSendString

The mciSendString function sends data to the media control interface (in this case, the CD ROM). Currently, I don't believe there is a function that tells you the state the state of the CD ROM drive (open or closed).

Please see the following link for Windows API functions:

http://pietschsoft.com/programming/vbapi/ref/funcc.html#mci

Thank you

Nandini Subramniam
Applications Engineering
National Instruments
0 Kudos
Message 5 of 6
(2,949 Views)
Actually I just found a way to check the state of the CD Rom drive. I am assuming here that you have Windows XP as your operating system.

http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_mciwndgetmode.asp?frame=true

Thank you

Nandini Subramaniam
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(2,944 Views)