Results 1 to 24 of 24

Thread: connecting hardware to software?

  1. #1

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Unhappy connecting hardware to software?

    i am just new to this hardware-software thing... i really have no idea on how to make a hardware work thru a visual basic program... can anybody give me an overview on this? or can anybody give me websites on this?

    i also heard of SDK... what does this actually mean? how does this work?

    anybody?
    thanks in advance... =)
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  2. #2

  3. #3

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    Quote Originally Posted by BillGeek
    What kind of hardware is it? How is it connected to the computer? Is it internal hardware, or do you connect it using USB / COM?
    serialport i think... i will be using some devices for gsm here...
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  4. #4
    Hyperactive Member BillGeek's Avatar
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    440

    Re: connecting hardware to software?

    If it's serial port, then you'll need to use the Microsoft Comm Control in your project.
    Do a search on the forum for the MSComm control. You'll be sure to find a few examples.

    GSM devices? I remember doing interesting things with SonyEricsson phones. The one thing I can distinctly remember was that the phones connected with USB will create a COM interface with a seperate COM port on your machine... If you'd like I can go scratch the old code out and post it here somewhere.

  5. #5
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: connecting hardware to software?

    You'll probably need to use the MSComm control then.

    It's actually quite simple. It uses a Protocol called RS232 which defines the characteristics of the Hardware in terms of the voltages on the pins and the way the plugs / sockets are wired up (of little interest to the Programmer normally). A hardware Handshaking methodology is also included in the RS232 Protocol which I wont go into here, but if you're interested a Google search looking for "RS232 Protocol" will return umpteen hits that will go into the detail.

    RS232 also defines how data is sent and received in terms of bits and is quite flexible. As we all know a byte is (normally, these days) a collection of 7 or 8 bits. When using RS232 there are additional bits tacked on the front and end of a byte when it is transmitted.

    At the front is a Start Bit, which, as the name implies, is used by the receiver Hardware to identify when a byte is being received.

    Following the Start Bit is the Byte itself which can be 7 or 8 bits long.

    After that comes the Parity Bit, this is for simple error reporting. There are 3 types of parity "Even" , "Odd" and "None" and you tell the hardware which type to use. Even Parity means that the Parity Bit will be set to a 1 if the number of bits in the byte having a value of 1 is even. Odd Parity is similar except the Parity Bit is set to 1 if the number of 1 bits is odd. "None" is as it implies, no Parity checking is performed. The hardware keeps count of the 1 bits and will raise a Parity Error, which your program can trap, if it's incorrect.

    Finally, after the Parity Bit comes one or two Stop Bits which tells the hardware that all the bits should have been received.

    Also, the serial interface can work at a number of different (set) speeds.

    Using the MSComm control it's very easy to tell the Hardware how to configure itself. eg
    Code:
    MSComm1.Settings = "9600,N,8,1"
    This configures the serial port to:
    Speed = 9600 bits per second
    Parity = "N" = None (ie ignore parity)
    Number of data bits = 8
    Number of Stop bits = 1

    Of course, your Port configuration must be the same as the device you're connecting to. For example, if the device you're connecting to can only operate at a maximum of 4800 bits per second then you have to adjust your speed to match. Once you've configured the port you can get down to the interesting stuff like programming.
    Last edited by Doogle; Jan 3rd, 2008 at 04:52 AM.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: connecting hardware to software?

    Quote Originally Posted by jeanette_db
    i also heard of SDK... what does this actually mean? how does this work?
    There was a discussion on this in General Developer not long ago. SDK Stands For...

  7. #7

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    Quote Originally Posted by BillGeek
    GSM devices? I remember doing interesting things with SonyEricsson phones. The one thing I can distinctly remember was that the phones connected with USB will create a COM interface with a seperate COM port on your machine... If you'd like I can go scratch the old code out and post it here somewhere.
    that would be great! please do.. thanks a lot billgeek... =)
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  8. #8

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    can anybody give me just a simple program on this?
    Last edited by jeanette_db; Jan 7th, 2008 at 11:01 PM.
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  9. #9
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: connecting hardware to software?

    I have an example of using MSComm to send SMS messages if that would be of any use

  10. #10
    Hyperactive Member BillGeek's Avatar
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    440

    Re: connecting hardware to software?

    Hi Jeanette

    I'm still scratching around for my old code. I don't know where I put it...

    Have a look at this. They show you how to use COM instructions to send an SMS with a cellphone.

    EDIT: Darn, beat to it.

  11. #11

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Talking Re: connecting hardware to software?

    Quote Originally Posted by Doogle
    I have an example of using MSComm to send SMS messages if that would be of any use
    please do post it here.. thanks! =)
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  12. #12

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    Quote Originally Posted by BillGeek
    Hi Jeanette

    I'm still scratching around for my old code. I don't know where I put it...

    Have a look at this. They show you how to use COM instructions to send an SMS with a cellphone.

    EDIT: Darn, beat to it.
    thanks.... =) ill go check this...
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  13. #13
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: connecting hardware to software?

    Quote Originally Posted by jeanette_db
    please do post it here.. thanks! =)
    Project attached in Zip format. (E&OE)

    You'll probably have to change the MSComm Port Number if you are going to run it.
    It's currently set to 4 in the Form_Load event, most likely you'll need to set it to 1 or maybe 2 depending upon how many Serial Ports you've got and which one the 'phone is connecting to.

    Have fun.
    Attached Files Attached Files
    Last edited by Doogle; Jan 4th, 2008 at 07:40 AM.

  14. #14
    Junior Member
    Join Date
    Dec 2007
    Posts
    21

    Re: connecting hardware to software?

    So is it possible to control my TOMTOM one through USB using MSComm?

  15. #15

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    Quote Originally Posted by BillGeek
    What kind of hardware is it? How is it connected to the computer? Is it internal hardware, or do you connect it using USB / COM?
    how about gsm modem?
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  16. #16

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    Quote Originally Posted by BillGeek
    GSM devices? I remember doing interesting things with SonyEricsson phones. The one thing I can distinctly remember was that the phones connected with USB will create a COM interface with a seperate COM port on your machine... If you'd like I can go scratch the old code out and post it here somewhere.
    can i have your sample code billgeek?
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  17. #17
    Hyperactive Member BillGeek's Avatar
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    440

    Re: connecting hardware to software?

    Hi Jeanette

    I seem to have misplaced it somewhere. I'm busy working on a bit of code that I will attach here when I'm done. (It's not working at the moment, so I'm trying to check why)

    May I suggest that you try to get hold of the whitepapers for the devices that you wish to use. I had to download the Sony Ericsson whitepapers in order to find out what the AT codes were to communicate to it, and it helped me quite a bit.

  18. #18

    Thread Starter
    Addicted Member jeanette_db's Avatar
    Join Date
    Oct 2005
    Location
    DC, Phil
    Posts
    215

    Re: connecting hardware to software?

    i still dont have the devices for that project.... =(
    I learnt to plant my own garden instead of
    waiting for someone to bring me flowers
    visit my blog...

  19. #19
    Addicted Member arunb's Avatar
    Join Date
    Jul 2005
    Posts
    131

    Re: connecting hardware to software?

    Actually RS 232 is not a protocol, it is just a hardware communication standard.

    thanks
    aa

  20. #20
    New Member
    Join Date
    Jul 2014
    Posts
    12

    Re: connecting hardware to software?

    Quote Originally Posted by Doogle View Post
    Project attached in Zip format. (E&OE)

    You'll probably have to change the MSComm Port Number if you are going to run it.
    It's currently set to 4 in the Form_Load event, most likely you'll need to set it to 1 or maybe 2 depending upon how many Serial Ports you've got and which one the 'phone is connecting to.

    Have fun.
    please i want your help in AT commands with usb 3g modem
    hosm.hasan38@gmail.com

    i used your code to send AT+GMM to get usb model bun seem no response... and there is delay in response sending SMS .....

    but here there 3 com for the usb modem not one port

  21. #21
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: connecting hardware to software?

    I would be surprised if Doogle still has that code from 4.5 years ago .....

  22. #22
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: connecting hardware to software?

    He might. I keep my code forever.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  23. #23
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: connecting hardware to software?

    It's attached in Post 13.

    I no longer have a 'phone to test with

  24. #24
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: connecting hardware to software?

    Arion Programmer, may I suggest that you create a new thread to ask your question since this is 6.5 years old. Thread closed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width