Serial port communication in asp.net

Last post 07-09-2009 4:49 PM by freewill78. 17 replies.

Sort Posts:

  • Serial port communication in asp.net

    06-22-2009, 3:58 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31
    Hi friends, now i am developing serial port communication in asp.net and c#. i need to read incoming data and evaluate that datas like incoming data : PNR 1234565. i got this string and evaluate it... can i get incoming data in char wise or read whole buffer ata a time... which one is good.
    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-22-2009, 4:14 AM
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    Hello Suthakar ... no offense meant:  yours is a bit of a strange question.  Let me explain:

    ASP.NET (MVC or WebForms) is for Internet and Intranet applications.

    serial port communications are generally for talking to attached devices:  modems, various hardware that can interface to a computer (example, a gasoline fuel pump's computer captures quantity and fuel card information that can be input and sent to an accounting package).

    So, I'm curious as to the nature of your application.

    In answer to your question, it depends on the capabilities the device with which you happen to be communicating.  You need to give the documentation for that device and then determine what you options are with it.

    Example:  likely most modern modems can send half duplex and full duplex.  Which mode is better likely depends more on the nature of the developer's application than on the merits of half duplex versus full duplex.

    Rule of thumb (general):  if the developer needs to make decisions based on input line content, likely character input is preferred; OTOH, if the developer is processing input records, likely line based input is preferred.

    To better respond to your question, imo, you need to give us many more details.  Sorry, your question is just way too general.  You need to clarify it for the rest of us.

     

    Regards,
    Gerry (Lowry)

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-22-2009, 4:31 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31
    Thanks for the reply sir, 1)i need to communicate with my Micro controller. 2) The MCU sends a byte at a time and i need to get that byte and process it. whenever a byte/data is transmitted from MCU, interrupt has to be generated in asp.net. i have got Data_received event occurs in windows application... can u guide me for asp.net application.
    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-22-2009, 8:45 AM
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    I do not see what this has to do with the ASP.NET paradigm.

    I think you may be mixing ideas here.  I'm not sure what you're trying to achieve.

    Example:

    ASP.NET MVC or WebForms

    (a) a page request is received

    (b) ASP.NET application displays that page and goes back to sleep

    (c) GET or POST comes back from page displayed by (b)

    (d) ASP.NET application responds appropriately and goes back to sleep.

                et   cetera

      ----------------------------------------

    serial port processing

    (i) local application starts and negotiates connectivity with serial port.

    (ii) local application runs constantly, no sleeping, and continuously listens to serial port.

      ----------------------------------------

    Here is what you should read to meet your serial port listening needs:

    http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx

    also:  http://lmgtfy.com/?q=c%23+baud+port+even+stop+handshake+site%3Amsdn.microsoft.com

    suthakar:
    i have got Data_received event occurs in windows application... can u guide me for asp.net application.

    All you can do AFAIK is to store your data in your ASP.NET MVC Model until a user requests it by clicking a submit button.

    Alternatively, your web page on your end user's computer could continuously request updates using Ajax.

    Ajax example tutorial:  #39 | Iteration #7 – Add Ajax functionality View in VB or C# 

    Regards,
    Gerry (Lowry)

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-23-2009, 3:24 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31

    thanks for the mail sir,

     i got serial port communication in windows application. but i need serial port communication in web application.  i am developing asp.net appplication in my server side. i need to communicate with external GSM modem via serial port.

    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-25-2009, 1:28 PM
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    suthakar .... you can not have what you want per se.

    you need a multi-tier architecture because the hardware that talks to the external GSM modem via the serial port must be physically connected to the external GSM modem.

    Therefore: 

    (A)

    external GSM modem<====>serial port[web_server]   ...... Internet  .....   [web_client]

    (B)

    external GSM modem<====>serial port[data_layer_computer]<====>[web_server]   ...... Internet  .....   [web_client]

    (C)

    external GSM modem<====>serial port[data_layer_computer] ..... Internet ..... [web_server]   ...... Internet  .....   [web_client]

    <====>      =.   physical connection

      .......         =.   TCP/IP connection

     

    suthakar, please study the above three architectures.  Remember, physical devices without wireless connectivity must be physically connected to whatever computer needs to communicate with the physical device.

     

    Gerry

     

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-26-2009, 12:58 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31

    ok sir, i have connected my kit with my server via serial port. Asp webpage runs in a server only. i want receive or send data via serial port in server only. there is a SDK available for serial port communication. can i use it. is it safe for our project?

    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-26-2009, 1:05 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31

    i am having 5 client systems and one server. all the system having wireless kit. all the clients sends the data to server via serial port. i want to collect and save the all the data in to server.


    Now i am using ASP.net and C#.


    but i need to get data from wireless kit via serial port in whole day. Is it possible to communicate. otherwise can i change the environment web application to windows...


    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-26-2009, 7:40 AM
    Answer
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    suthakar, you are talking about architecture (A) ...

    (A)

    external GSM modem<====>serial port[web_server]   ...... Internet  .....   [web_client]

    Earlier in this thread, I showed you what to check out:

    Here is what you should read to meet your serial port listening needs:

    http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx

    also:  http://lmgtfy.com/?q=c%23+baud+port+even+stop+handshake+site%3Amsdn.microsoft.com

    If you want to purchase someone's SKD, it's probably safe ~~ I would ask them for references from their existing customers.  You probably do not need an SDK from a third party.

    Also, the manufacturer of your modem should have documentation to help you.

    You have at least two options:  do it yourself; hire a specialist.

     

    Gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-26-2009, 7:47 AM
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    suthakar, in your previous post, you said the modem was connected directly to the server.  I do not understand ...

    TIMTOWTDI =. there is more than one way to do it

    are your clients in the same room as your server?

    a remote client computer can capture information from its serial port and then send it via FTP to the server.

    TIMTOWTDI

    ???? are you trying to do something in real time?

    ???? is this simply aggregating data for reporting purposes?

    I really do not understand what you are trying to achieve.  That makes it difficult for anyone to answer your question.

    Perhaps you can explain your design goals, your design constraints, and your physical architecture in more detail?

     

    Gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-29-2009, 4:11 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31

    Thanks for your effective replies sir,

    S... this is real time application only. i want trigger the data_received event wherever data received from the clients. i connected GSM kit for all the system.

    If i will receive a data from GSM kit to system via Serial port. if data received from GSM kit mean i want to sleep the current process and start the new process and do some other works from some other pages



    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-29-2009, 4:17 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31



    reference image for my project

    http://www.microsoft.com/library/media/1033/windowsxp/images/using/networking/setup/68588-diagram-ap.gif

    Don't try to Talk in-front of My Back -Suthakar
  • Re: Serial port communication in asp.net

    06-29-2009, 6:04 PM
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    suthakar, if all of your computers are in the same facility, then the diagram is not relevant.  They can simply drop tiny files on the server and the server can aggregate them.  Alternatively, the server can have a local application that they talk to via your network constantly.

    If your server is remote, you can still have similar scenarios as above by using VPN connections.

    VPN will be slow but FTP will be slower.  You could possible create some form of web service on your server and have your local PCs talk to that service.

    You need to simplify your application into two or more separate parts.  E.g.:  one component would gather the serial data, another component would worry about how it gets that data to the server; the server component would deal with aggregating the data.


    Gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-29-2009, 6:09 PM
    • Contributor
      6,615 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,268

    P.S.:  note, at http://www.microsoft.com/library/media/1033/windowsxp/images/using/networking/setup/68588-diagram-ap.gif, the two computers are NOT talking to each other; rather, they are both talking to "the Internet".  In theory, they might even be on separate subnets.

    In the above mentioned diagram, if they want to talk to each other, it would be by following a route out to the Internet and then back from the Internet to the "other" computer.

    Gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Serial port communication in asp.net

    06-30-2009, 12:18 AM
    • Member
      9 point Member
    • suthakar
    • Member since 07-04-2008, 5:55 PM
    • India
    • Posts 31

    Thanks sir, i will be back soon... take care

    Don't try to Talk in-front of My Back -Suthakar
Page 1 of 2 (18 items) 1 2 Next >