Loading ...
Sorry, an error occurred while loading the content.

Serial Input code example

Expand Messages
  • jhnstockton
    I m looking for a html code example of how to read two chars from the com port receive channel. I ve browsed this group for a while, have seen references to
    Message 1 of 6 , Dec 29, 2006
    View Source
    • 0 Attachment
      I'm looking for a html code example of how to read two chars from the
      com port receive channel. I've browsed this group for a while, have
      seen references to others with the same problem, but have managed to
      miss the solutions. Any suggestions?

      John
    • Angel
      For what I know, when you define a variable, you get that memery location. When you write to the Comm port, you use their defined message format that address
      Message 2 of 6 , Jan 2, 2007
      View Source
      • 0 Attachment
        For what I know, when you define a variable, you get that memery
        location. When you write to the Comm port, you use their defined
        message format that address that memory location directly and then is
        just a matter of manipulating that memory location.
        Hope that this helps!

        Angel



        --- In siteplayer@yahoogroups.com, "jhnstockton" <john@...> wrote:
        >
        > I'm looking for a html code example of how to read two chars from the
        > com port receive channel. I've browsed this group for a while, have
        > seen references to others with the same problem, but have managed to
        > miss the solutions. Any suggestions?
        >
        > John
        >
      • Rusty Haddock
        ... Sorry John, there is no simple solution. The Siteplayer s COM port is not able to just blindly read N-characters. Yeah, it can write but it can t read.
        Message 3 of 6 , Jan 2, 2007
        View Source
        • 0 Attachment
          jhnstockton wrote:
          >I'm looking for a html code example of how to read two chars from the
          >com port receive channel. I've browsed this group for a while, have
          >seen references to others with the same problem, but have managed to
          >miss the solutions. Any suggestions?

          Sorry John, there is no simple solution. The Siteplayer's COM port is
          not able to just blindly read N-characters. Yeah, it can write but
          it can't read. That's just the way it is. For input on the serial
          port, the Siteplayer is always expecting input in a certain format.
          This format is outlined in the Software Manual. Basically, it consists
          of command bytes followed by a memory address and/or associated data.
          Usually, an attached processor (like a PIC, an AVR, or Basic Stamp of
          some sort, not just Parallax's) will send commands to the SP into its
          serial port to read from or write to the SP's RAM. These memory locations
          (or SP Objects) can then be displayed onto a webpage by the SitePlayer
          or written to by an HTML form.

          Depending on what you're trying to do would require an attached processor
          or maybe a Siteplayer Telnet module instead.

          -Rusty-
          --
          _____ Rusty Haddock = KD4WLZ = rusty@...
          |\/ o \ o **Out yonder in the Van Alstyne (TX) Metropolitan Area**
          | ( -< O o Every day I think people can't get more stupid.
          |/\__V__/ Every day I'm proven horribly wrong.
        • Greg Molenaar
          I may be missing something from Rusty s response, but I can read two bytes, or more, on the Siteplayer HTML... but the bytes must be preceded by &H81&H00 ..
          Message 4 of 6 , Jan 3, 2007
          View Source
          • 0 Attachment
            I may be missing something from Rusty's response, but I can read two bytes, or more, on the Siteplayer HTML... but the bytes must be preceded by &H81&H00
            .. that is 8=read +1 (0 and 1 is the bytecount) and 00 is the buffer address as defined by the names in the DEF and HTML files.
            -- Greg M

            jhnstockton <john@...> wrote: I'm looking for a html code example of how to read two chars from the
            com port receive channel. I've browsed this group for a while, have
            seen references to others with the same problem, but have managed to
            miss the solutions. Any suggestions?

            John





            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com

            [Non-text portions of this message have been removed]
          • Rusty Haddock
            ... Sorry if you missed something Greg. I took John s question to be more like reading two characters from the COM port -- just any ol characters -- from a
            Message 5 of 6 , Jan 3, 2007
            View Source
            • 0 Attachment
              Greg Molenaar wrote:
              >I may be missing something from Rusty's response, but I can read
              >two bytes, or more, on the Siteplayer HTML... but the bytes must
              >be preceded by &H81&H00 .. that is 8=read +1 (0 and 1 is the
              >bytecount) and 00 is the buffer address as defined by the names
              >in the DEF and HTML files.

              Sorry if you missed something Greg. I took John's question to be
              more like reading two characters from the COM port -- just any ol'
              characters -- from a serial stream in response to an action from a
              webpage. Preceeding each byte by 81h,00h is simply sending the byte
              that follows into address 00h in the SP. Hopefully, you'll have an
              object there. This is called the WRITE command when sending bytes
              to the SP's comm port. Changing the 81h to 82h will allow two bytes
              that follow to be "read" and put into a two-byte object at address 00h.
              This would all be asynchronous to anything else happening on the SP
              and requires some sort of critter device attached to the COM port that
              knows the protocol.

              I look at those data bytes being sent to the SP, as opposed to being
              simply "read" since the SP is acting upon the 81h command to "read"
              the data. PotAHto, potAYto, whatever... :-)

              -Rusty-
              --
              _____ Rusty Haddock = KD4WLZ = rusty@...
              |\/ o \ o **Out yonder in the Van Alstyne (TX) Metropolitan Area**
              | ( -< O o Every day I think people can't get more stupid.
              |/\__V__/ Every day I'm proven horribly wrong.
            • Greg Molenaar
              Hi Rusty... of course... you are WRITE as usual. :D ... Sorry if you missed something Greg. I took John s question to be more like reading two characters from
              Message 6 of 6 , Jan 3, 2007
              View Source
              • 0 Attachment
                Hi Rusty... of course... you are WRITE as usual. :D

                Rusty Haddock <rusty@...> wrote: Greg Molenaar wrote:
                >I may be missing something from Rusty's response, but I can read
                >two bytes, or more, on the Siteplayer HTML... but the bytes must
                >be preceded by &H81&H00 .. that is 8=read +1 (0 and 1 is the
                >bytecount) and 00 is the buffer address as defined by the names
                >in the DEF and HTML files.

                Sorry if you missed something Greg. I took John's question to be
                more like reading two characters from the COM port -- just any ol'
                characters -- from a serial stream in response to an action from a
                webpage. Preceeding each byte by 81h,00h is simply sending the byte
                that follows into address 00h in the SP. Hopefully, you'll have an
                object there. This is called the WRITE command when sending bytes
                to the SP's comm port. Changing the 81h to 82h will allow two bytes
                that follow to be "read" and put into a two-byte object at address 00h.
                This would all be asynchronous to anything else happening on the SP
                and requires some sort of critter device attached to the COM port that
                knows the protocol.

                I look at those data bytes being sent to the SP, as opposed to being
                simply "read" since the SP is acting upon the 81h command to "read"
                the data. PotAHto, potAYto, whatever... :-)

                -Rusty-
                --
                _____ Rusty Haddock = KD4WLZ = rusty@...
                |\/ o \ o **Out yonder in the Van Alstyne (TX) Metropolitan Area**
                | ( -< O o Every day I think people can't get more stupid.
                |/\__V__/ Every day I'm proven horribly wrong.




                __________________________________________________
                Do You Yahoo!?
                Tired of spam? Yahoo! Mail has the best spam protection around
                http://mail.yahoo.com

                [Non-text portions of this message have been removed]
              Your message has been successfully submitted and would be delivered to recipients shortly.