# Easy way to clear the Serial buffer

**URL:** <https://forum.inductiveautomation.com/t/easy-way-to-clear-the-serial-buffer/103240>\
**Category:** Ignition\
**Tags:** vision, ignition81, scripting\
**Created:** [March 4, 2025, 8:30pm UTC](https://forum.inductiveautomation.com/t/easy-way-to-clear-the-serial-buffer/103240 "2025-03-04T20:30:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 4, 2025, 11:07pm UTC](https://forum.inductiveautomation.com/t/easy-way-to-clear-the-serial-buffer/103240/4 "2025-03-04T23:07:53Z")

</div>

I think you'd have to throw in something like this to get at the private inner field:

```python
from org.apache.commons.lang3.reflect import FieldUtils
with system.serial.port("COM1") as port:
    jSerialPort = FieldUtils.readField(port, "serialPort", True)
    jSerialPort.flushIOBuffers()

```

Disclaimer: Still untested

---

_[View the full topic](https://forum.inductiveautomation.com/t/easy-way-to-clear-the-serial-buffer/103240)._
