# Serial module and database query

**URL:** <https://forum.inductiveautomation.com/t/serial-module-and-database-query/8415>\
**Category:** Ignition\
**Created:** [May 6, 2014, 9:56pm UTC](https://forum.inductiveautomation.com/t/serial-module-and-database-query/8415 "2014-05-06T21:56:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WChester](https://avatars.discourse-cdn.com/v4/letter/w/df788c/32.png) [@WChester](https://forum.inductiveautomation.com/u/WChester)\
**Post date:** [May 6, 2014, 9:56pm UTC](https://forum.inductiveautomation.com/t/serial-module-and-database-query/8415/1 "2014-05-06T21:56:05Z")

</div>

I have an application where I need to use the serial module. My problem is this I have a client application that uses three serial ports to communicate with peripherial devices. When I start the application I open the serial ports and start a client timer script that periodically sends querys to the peripherial to get status on several parameters. Since I have multiple clients and each may designate the serial ports differently ie ‘COM4’,‘COM5’,'COM3" vs ‘COM2’,‘COM7’,‘COM8’. in order to not have client specific code I tried to use an initialization data table to query and get the client specific port configuration. This did not work. I think that I am getting an extra character in the string when I query it. I have tried strip and regular expressions but do not seem to be having much sucess. I have had to return to hard coded constants to get it to work. Ultimately I would like to get away from this as it is a source of error when making changes and is not very scalable.

---

<div class="post-metadata">

**Author:** ![WChester](https://avatars.discourse-cdn.com/v4/letter/w/df788c/32.png) [@WChester](https://forum.inductiveautomation.com/u/WChester)\
**Post date:** [May 14, 2014, 10:34pm UTC](https://forum.inductiveautomation.com/t/serial-module-and-database-query/8415/2 "2014-05-14T22:34:25Z")

</div>

After some investigation I think the problem has to do with the unicode as the list comes out like this [u’COM4’,u’COM5’,u’COM6’]. The peripherial specfically uses ascii so I will encode the data as ascii and then see what happens.
