Yoda needs help sending Data to Hardware! ALL NERDS COME QUICK!!!

I am trying to send ATAPI commands to a cdrom in VB.Net. While researching this it seems to me the VB is not the best at this. I am sure there is a way though. Can anyone steer me in the right direction I read something on calling the Windows API to do some hardware speaking, but it said that that is being Phased out with VB.Net. Is that true

I am able to send these commands through another CDROM test program that we use. The program is a small program that tests cdrom drives. It was written by someone in my company from Korea. I cannot get in touch with him or get the source code. It has a small utility called ATAPI which lets you type in ATAPI codes and click send. It shows the data buffer at the bottom. I can send you a screen shot if you want.

I send a few similar requests to the drive with this other program. For instance, I send an inquiry command - 12 00 00 00 FF 00 00 00 00 00 00 00. I am able to get the device type and model returned with that. I also do a 'Get Configuration' Command and 2 other commands that run a self test and then read the stored results.

The self test is a proprietary built in self test that will run if you send E6 02 00 00 00 00 00 00 0C 00 00 00 to the drive with the parameters 0A 00 00 00 01 01 01 01 01 01 01 00( each '1' enables one of seven different tests) Then I read the results with E6 03 00 00 00 00 00 00 0C 00 00 00.


Hope that helps! I really apreciate if anyone can steer me in the right direction.

Ken


Answer this question

Yoda needs help sending Data to Hardware! ALL NERDS COME QUICK!!!

  • Strider69


    Yes..... I did a google search on ATAPI + VB.NET and there is a group and web page full of dicussions on this. It is a very complicated thing to do. They seemed to be very fond of the Nero 6.0 SDK and do a lot around that. Later version are reported to have broken.

  • Jen Smith

    Renee,
    I wonder if you can see my whole mesage At the top I actually give the commands (ATAPI) that I want to send and their meanings. MCISendString is not the way to go. But thanks anyway.

  • Krystof



    If a problem is not fully stated it's difficult to supply a meaningful response.

    If you want to do more, I really do recommend mcisendstring. I believe that is that engine that runs Windows Media.

    "I just thought if I could learn how to send the code to open the door I could also send the code I needed to get the drive to perform other functions. When I checked out SendMCIstring I see that I was wrong. It brings me further down this rabbit hole "

    I'm really not sure what the problem is. I found  SendMCIString to be very rich yet undemanding.

  • Protium

    Oh is that all you wanted to do I swear I think I acomplished that easily in vb6.

    Checkout this facility:

    SendMCIString

    It's a very rich, powerful music facility. It does open and close CD drawers and I can't figure why more people don't refer to it.

    Please let me know how you fare.

  • Protrack

    Just in case this isnt showing up (two of my messages look like they merged somehow) Here is the original request--------

     kjmorford wrote:
    I am trying to send ATAPI commands to a cdrom in VB.Net. While researching this it seems to me the VB is not the best at this. I am sure there is a way though. Can anyone steer me in the right direction I read something on calling the Windows API to do some hardware speaking, but it said that that is being Phased out with VB.Net. Is that true

    I am able to send these commands through another CDROM test program that we use. The program is a small program that tests cdrom drives. It was written by someone in my company from Korea. I cannot get in touch with him or get the source code. It has a small utility called ATAPI which lets you type in ATAPI codes and click send. It shows the data buffer at the bottom. I can send you a screen shot if you want.

    I send a few similar requests to the drive with this other program. For instance, I send an inquiry command - 12 00 00 00 FF 00 00 00 00 00 00 00. I am able to get the device type and model returned with that. I also do a 'Get Configuration' Command and 2 other commands that run a self test and then read the stored results.

    The self test is a proprietary built in self test that will run if you send E6 02 00 00 00 00 00 00 0C 00 00 00 to the drive with the parameters 0A 00 00 00 01 01 01 01 01 01 01 00( each '1' enables one of seven different tests) Then I read the results with E6 03 00 00 00 00 00 00 0C 00 00 00.


    Hope that helps! I really apreciate if anyone can steer me in the right direction.

    Ken

  • Rahul Patil

    I see where you are sending byte streams and making inquiries.  What you are attemtping to accomplish and the nature of the inquiry remains remains unclear. Without more information, I couldn't tell your what the best facility would be.

    One way I may make myself clearer is to draw an anology.

    You could ask me what I am trying to do and I could tell you I'm trying to send 12 bytes to my CD.

    "Yes, but what does she want to do WHat is she attemtpting to do by sending those twelve bytes."

  • Inamori

    I actually wanted to do more than open the door. I just thought if I could learn how to send the code to open the door I could also send the code I needed to get the drive to perform other functions. When I checked out SendMCIstring I see that I was wrong. It brings me further down this rabbit hole though and I do appreciate your help! Plus I learned something.

    Another person told me it may be possible through interop using deviceiocontrol. I started looking into that and I sure do hope there is a simpler way.
    Thanks again!
    Ken

  • Dmac721

    Ok, Yoda isnt here but I had to think of something to get the smartest help. I am trying to send a string of 12 bytes(an ATAPI Command) to some hardware( A cdrom drive). I have been searching everywhere. Can anyone point me in the right research direction (Or just tell me how to do it, but apparently it's pretty tough in VB). I mean is there anything in vb.net to help with that, or do I need to look into the windows api(no, please no!)  


    Thanks!
    Ken

    ps. When I say Nerd, I mean it in the most admiring way!~

  • Eren

    It looks like interop is the best way to go, but it just seems on. I mean opening or closing a cdrom drives door should not be that difficult.

    Thanks for the reply!

  • Yoda needs help sending Data to Hardware! ALL NERDS COME QUICK!!!