Serial port encoding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack Russell

    #1

    Serial port encoding

    I am trying to use the serial port control to send and receive 8 bit
    characters to/ from a n instrument. whatever I set encoding to it
    converts the characters.

    Any ideas how to stop it?

    Thanks

    Jack Russell
  • Armin Zingler

    #2
    Re: Serial port encoding

    "Jack Russell" <jackr@norubbis h.tpg.com.ausch rieb
    I am trying to use the serial port control to send and receive 8 bit
    characters to/ from a n instrument. whatever I set encoding to it
    converts the characters.
    >
    Any ideas how to stop it?
    Can you give an example of the sent/received data? How did you find out that
    it gets converted? How do you send the data (code)?


    Armin

    Comment

    • Armin Zingler

      #3
      Re: Serial port encoding

      "Jack Russell" <jackr@norubbis h.tpg.com.ausch rieb


      Armin
      Sorry, I am not sending "strings" I am sending binary data.

      You wrote:

      serialport1.wri te(String)


      I thought String means String. Now you write, you don't send a String.
      What's right now?


      Armin

      Comment

      • =?ISO-8859-1?Q?G=F6ran_Andersson?=

        #4
        Re: Serial port encoding

        Jack Russell wrote:
        >Which encoding does the device expect?
        >>
        >>
        >Armin
        This is the point, I and a lot of other people use serial ports to
        transmit binary data, we do not want any encoding. According to the help
        files the default is 7 bit ascii, but you can set the various unicode
        alternatives. The help file says that setting 0 gives the "default"
        which is patently not true
        The solution is very simple. If you want to send binary data, send
        binary data. Don't send it as a string, send it as a byte array.

        --
        Göran Andersson
        _____
        Göran Anderssons privata hemsida.

        Comment

        • Jack Russell

          #5
          Re: Serial port encoding

          Göran Andersson wrote:
          Jack Russell wrote:
          >
          >>Which encoding does the device expect?
          >>>
          >>>
          >>Armin
          >>
          >This is the point, I and a lot of other people use serial ports to
          >transmit binary data, we do not want any encoding. According to the
          >help files the default is 7 bit ascii, but you can set the various
          >unicode alternatives. The help file says that setting 0 gives the
          >"default" which is patently not true
          >
          >
          The solution is very simple. If you want to send binary data, send
          binary data. Don't send it as a string, send it as a byte array.
          >
          Thanks, just what I wanted. I should have fully read the help file I
          suppose, too many years of fooling devices so it never occurred to me it
          would be that easy!

          Thanks again

          Jack Russell

          Comment

          Working...