# How to listen serial data without interruption

**URL:** <https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709>\
**Category:** Ignition\
**Created:** [October 19, 2017, 12:36am UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709 "2017-10-19T00:36:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![guanghui](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@guanghui](https://forum.inductiveautomation.com/u/guanghui)\
**Post date:** [October 19, 2017, 12:36am UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/1 "2017-10-19T00:36:49Z")

</div>

I am using serial module to get data from a rs232 device, and the device is could only send its data to serial port ,but could not accept any request. the problem is I don’t know when the data will be send,so I need to listen the serial constantly to avoid lose any data. but unfortunately, there are no any event trigger on serial component in ignition . dose anyone meet the same problem and could give some help? (I’m using ignition 7.7.5)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2e1c9312d5263247d392d69ab63509cd772b87e1.png)

I put scripts on a timer , but datas always losed,and after some time, there is an error “could not creat any more thread”

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 19, 2017, 2:40pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/2 "2017-10-19T14:40:36Z")

</div>

This is actually a rather challenging task, requiring a background thread constantly listening to the serial port. You might find inspiration in this example: [clientserial.py](https://www.automation-pros.com/ignition/clientserial.py).

---

<div class="post-metadata">

**Author:** ![oscar.salcedo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/oscar.salcedo/32/11019_2.png) [@oscar.salcedo](https://forum.inductiveautomation.com/u/oscar.salcedo)\
**Post date:** [October 19, 2017, 2:55pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/3 "2017-10-19T14:55:30Z")

</div>

I would consider converting the serial output to TCPIP using a serial to ethernet converter; then you can just use Ignition’s TCP device to connect to the ip:port on the converter to listen for data events.  
I have used Lantronix UDS1100 for this purpose before.

Cheers,

Oscar.

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [October 20, 2017, 3:40am UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/4 "2017-10-20T03:40:59Z")

</div>

I think it is time to get your device online. Get yourself a Lantronix or Digi SP One device and start moving that data over Ethernet. My solution would be to configure a UCON driver in Kepware and create a transaction block representative of the data you are trying to receive. Your device will now become a OPC UA device, reachable from Ignition.

[https://www.kepware.com/en-us/products/kepserverex/drivers/u-con/](https://www.kepware.com/en-us/products/kepserverex/drivers/u-con/)

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [October 20, 2017, 12:44pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/5 "2017-10-20T12:44:29Z")

</div>

You can also check out the Instrument Interface module from Sepasoft ([https://www.sepasoft.com/products/instrument-interface/serial-communications/](https://www.sepasoft.com/products/instrument-interface/serial-communications/)) it has a component that can handle incoming data and monitoring the report. We used it to capture data from 3 serial devices where the data trigger was independent from Ignition (unsolicited data).

---

<div class="post-metadata">

**Author:** ![guanghui](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@guanghui](https://forum.inductiveautomation.com/u/guanghui)\
**Post date:** [October 23, 2017, 12:33pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/6 "2017-10-23T12:33:03Z")

</div>

Thanks for everyone. I have resolved the problem in a indirected way. I put the code in a button’s actionPerformed event. the program will call itself again when the invokeLater() completed.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ef2e828be2400fadd0d4bebc401b3950ad2e33fb.png)

---

<div class="post-metadata">

**Author:** ![dano38291](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dano38291](https://forum.inductiveautomation.com/u/dano38291)\
**Post date:** [February 9, 2018, 2:37pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/7 "2018-02-09T14:37:48Z")

</div>

How are you using the Instrument Interface to continuously monitor the Serial Port? I am used to Rockwell Serial port functions where I can “test” the serial port for CR and once found then I can read the serial port. I am trying to do the same thing in Ignition where I test the serial port until CR characters then read the Serial port till the CR character. (see attached screen cap)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/337aab6fa9bbd6d87a3695408c142eea8cdd9859.PNG)

I am not sure what unsolicited requests means? I might also just experiment with Polled request at super fast rate?

---

<div class="post-metadata">

**Author:** ![guanghui](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@guanghui](https://forum.inductiveautomation.com/u/guanghui)\
**Post date:** [February 10, 2018, 11:31am UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/8 "2018-02-10T11:31:14Z")

</div>

I’m not using Instrument Interface , I think @pturmel have given a perfact way to continuously monitor the serial port data.

---

<div class="post-metadata">

**Author:** ![oscar.salcedo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/oscar.salcedo/32/11019_2.png) [@oscar.salcedo](https://forum.inductiveautomation.com/u/oscar.salcedo)\
**Post date:** [May 8, 2018, 12:53pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/9 "2018-05-08T12:53:45Z")

</div>

If you would still consider putting those serial devices on the network, grab a Raspberry Pi and run ser2sock ([https://github.com/nutechsoftware/ser2sock](https://github.com/nutechsoftware/ser2sock)); then add a new TCP device to Ignition and point it to the port on the Pi where your socket is listening on.

Oscar.

---

<div class="post-metadata">

**Author:** ![AFULLER](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/afuller/32/7931_2.png) [@AFULLER](https://forum.inductiveautomation.com/u/AFULLER)\
**Post date:** [June 15, 2021, 4:31pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/11 "2021-06-15T16:31:52Z")

</div>

That’s a great idea! And use Java commands to record the data?

---

<div class="post-metadata">

**Author:** ![oscar.salcedo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/oscar.salcedo/32/11019_2.png) [@oscar.salcedo](https://forum.inductiveautomation.com/u/oscar.salcedo)\
**Post date:** [June 15, 2021, 5:39pm UTC](https://forum.inductiveautomation.com/t/how-to-listen-serial-data-without-interruption/15709/12 "2021-06-15T17:39:45Z")

</div>

Well, you wouldn’t even need to go that complex. The TCP driver would be the perfect fit to turn that stream out of the TCP socket into tags:  
[https://docs.inductiveautomation.com/display/DOC81/UDP+and+TCP+Driver](https://docs.inductiveautomation.com/display/DOC81/UDP+and+TCP+Driver)

Cheers!  
Oscar.
