# SerialConnection Baud confusion

**URL:** <https://forum.xojo.com/t/serialconnection-baud-confusion/89008>\
**Category:** General\
**Created:** [October 17, 2026, 10:10am UTC](https://forum.xojo.com/t/serialconnection-baud-confusion/89008 "2026-10-17T10:10:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Stevens](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Matthew\_Stevens](https://forum.xojo.com/u/Matthew_Stevens)\
**Post date:** [October 17, 2026, 10:10am UTC](https://forum.xojo.com/t/serialconnection-baud-confusion/89008/1 "2026-10-17T10:10:14Z")

</div>

Xojo Version 2025 R2.1  
Developing on a Mac for a Linux production target.

According to the[documentation](https://documentation.xojo.com/api/hardware/serialconnection.html#serialconnection-baud) the Baud rate of a SerialConnection is set by assigning one of the Baud class constants to the .Baud property.

```auto
SerialConnection1.Baud = SerialConnection.Baud4800
MessageBox(SerialConnection1.Baud.ToString)
> 6

```

So far so good. However when I open the port the .Baud property changes to the actual board rate.

```auto
SerialConnection1.Connect
MessageBox(SerialConnection1.Baud.ToString)
> 4800

```

And stays that way after the port is closed

```auto
SerialConnection1.Close
MessageBox(SerialConnection1.Baud.ToString)
> 4800

```

Is this the expected behaviour?  
Do I have to reassign a class constant if I want to reopen the port?

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [October 17, 2026, 11:03am UTC](https://forum.xojo.com/t/serialconnection-baud-confusion/89008/2 "2026-10-17T11:03:12Z")

</div>

I guess docs need a more clear choice of words.

Seems that what you put into Serial.Baud is just a “Xojo index” of a table, and what you read back from Serial.Baud is the real chosen Baud Rate (set and get differs)

 ![image](https://forum.xojo.com/uploads/default/original/3X/4/c/4cf4c49ccb0a131082290ce24c12c17bf51a119a.png)

---

<div class="post-metadata">

**Author:** ![Matthew\_Stevens](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Matthew\_Stevens](https://forum.xojo.com/u/Matthew_Stevens)\
**Post date:** [October 17, 2026, 11:17am UTC](https://forum.xojo.com/t/serialconnection-baud-confusion/89008/3 "2026-10-17T11:17:21Z")

</div>

> [@Rick\_Araujo](#):
>
> Baud Rate (set and get differs)

It’s not even that consistent.

If you set .Baud and immediately read it back the class constant value is returned. It only changes to the absolute value after the port has been opened.

Clumsy work around for a clumsy behaviour

```auto
Function BaudConstant(baud)
  //return baud as a class constant
  Var BaudConstants() As Integer = Array(300, 600, 1200, 1800, 2400, _
    3600, 4800, 7200, 9600, 14400, 19200, 28800, 38400, 57600, 115200, 230400)

  If Baud < 300 Then
    Return baud
  Else
    Return BaudConstants.IndexOf(baud)
  End If
End

```

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [October 17, 2026, 11:24am UTC](https://forum.xojo.com/t/serialconnection-baud-confusion/89008/4 "2026-10-17T11:24:29Z")

</div>

I agree. Bad consistency.

 ![image](https://forum.xojo.com/uploads/default/original/3X/3/0/30ae78884dd5a948fd11ea526ec1ae49cdaa45a2.png)

To make things worse, it does not complain about any invalid values and “connects”

 ![image](https://forum.xojo.com/uploads/default/original/3X/3/5/350ea1eac530a2fc1260eefbe6681395769bec5c.png)

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [October 18, 2026, 12:21am UTC](https://forum.xojo.com/t/serialconnection-baud-confusion/89008/5 "2026-10-18T00:21:32Z")

</div>

> [@Matthew\_Stevens](#):
>
> According to the[documentation](https://documentation.xojo.com/api/hardware/serialconnection.html#serialconnection-baud) the Baud rate of a SerialConnection is set by assigning one of the Baud class constants to the .Baud property.

What it says is “The “Baud” class constants _can_ be used to get or set the Baud rate”, italics mine, and “can” being the operative word.

What it doesn’t explicitly state is that you can just specify the actual integer baud rate, which imo results in more readable code.
