Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Serial port on Pockets PC with .NET

leriksleriks Posts: 2Member
Had any one got a way of replacing the fatures of MSComm control in embedded Visual Basic in the new .NET platform?

I am converting from emdedded to .NET bur can't find any good way for this.

Regards

Lennart

Comments

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : Had any one got a way of replacing the fatures of MSComm control in embedded Visual Basic in the new .NET platform?
    :
    : I am converting from emdedded to .NET bur can't find any good way for this.
    :
    : Regards
    :
    : Lennart
    :

    How much functionality do you need? If all you need to do is send output, you can do that in VB alone (assuming .Net will still handle the code).

    This is pretty much how I dial the modem without MSComm, other code would be similar:

    [code]Open "com1:" For Binary As 1
    Put 1, , "ATS11=50DT5555555" & vbCrLf
    Close 1
    [/code]

    Plain text printing (lpt is similar to com) can be achieved in a similar method:

    [code]Open "lpt1:" For Binary As 1
    Put 1, , "Hi!"
    Close
    [/code]

    I hope this helps,
    KDL
  • leriksleriks Posts: 2Member
    : : Had any one got a way of replacing the fatures of MSComm control in embedded Visual Basic in the new .NET platform?
    : :
    : : I am converting from emdedded to .NET bur can't find any good way for this.
    : :
    : : Regards
    : :
    : : Lennart
    : :
    :
    : How much functionality do you need? If all you need to do is send output, you can do that in VB alone (assuming .Net will still handle the code).
    :
    : This is pretty much how I dial the modem without MSComm, other code would be similar:
    :
    : [code]Open "com1:" For Binary As 1
    : Put 1, , "ATS11=50DT5555555" & vbCrLf
    : Close 1
    : [/code]
    :
    : Plain text printing (lpt is similar to com) can be achieved in a similar method:
    :
    : [code]Open "lpt1:" For Binary As 1
    : Put 1, , "Hi!"
    : Close
    : [/code]
    :
    : I hope this helps,
    : KDL
    :
    OK

    I only needs to read the COM port for NMEA strings so probably this would work via Get instead of put?
    Have you seen any nice class based librarys?

    Regards

    Lennart
  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : I only needs to read the COM port for NMEA strings so probably this would work via Get instead of put?
    : Have you seen any nice class based librarys?
    :
    : Regards
    :
    : Lennart
    :

    In theory (I've never tried it), you can use Get to read the comport. Unfortunately, you will have to use polling (a loop) and constantly recheck the port for new data because opening it as a file won't give you an event when data is recieved.

    .Net probably has a class of some kind for this, but I have very little knowledge of .Net so I don't know if there is one. Maybe a post asking about a .Net equivalent of MSComm on the VB.Net msgbrd would help?...

    Good luck!
    KDL
Sign In or Register to comment.