# How to read the com port data in ue4?

**URL:** <https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468>\
**Category:** UI\
**Tags:** interface, port, unreal-engine, UE4, CPP, question\
**Created:** [April 26, 2015, 3:36pm UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468 "2015-04-26T15:36:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juvarunst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juvarunst](https://forums.unrealengine.com/u/Juvarunst)\
**Post date:** [April 26, 2015, 3:36pm UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/1 "2015-04-26T15:36:30Z")

</div>

I have a hardware device,Data from the com port, I want Read its data in the UE4.

I try to use the WINAPI ReadFile, it does not work in ue4.But on the outside of the UE4, it work properly.  
This looks very strange.

Does anyone know what’s going on?

thanks everybody

---

<div class="post-metadata">

**Author:** ![shadowmint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@shadowmint](https://forums.unrealengine.com/u/shadowmint)\
**Post date:** [April 26, 2015, 3:44pm UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/2 "2015-04-26T15:44:12Z")

</div>

Same way you would in any other C++ program.

For example: [GitHub - wjwwood/serial: Cross-platform, Serial Port library written in C++](https://github.com/wjwwood/serial)

If you want information on linking to the external library from your project, see this question: [https://answers.unrealengine.com/questions/197667/how-do-you-statically-link-an-external-dlldylib-to.html](https://answers.unrealengine.com/questions/197667/how-do-you-statically-link-an-external-dlldylib-to.html)

---

<div class="post-metadata">

**Author:** ![Juvarunst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juvarunst](https://forums.unrealengine.com/u/Juvarunst)\
**Post date:** [April 26, 2015, 3:46pm UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/3 "2015-04-26T15:46:08Z")

</div>

Thank you, I have a try

---

<div class="post-metadata">

**Author:** ![Juvarunst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juvarunst](https://forums.unrealengine.com/u/Juvarunst)\
**Post date:** [April 28, 2015, 8:26am UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/4 "2015-04-28T08:26:39Z")

</div>

Problem solved, thank you

---

<div class="post-metadata">

**Author:** ![Ken\_An](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ken_an/32/866880_2.png) [@Ken\_An](https://forums.unrealengine.com/u/Ken_An)\
**Post date:** [October 3, 2016, 3:20pm UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/5 "2016-10-03T15:20:49Z")

</div>

Hi Juvarunst, could you please post the solution ? I’ve tried many ways but all ended faliure.

---

<div class="post-metadata">

**Author:** ![Juvarunst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juvarunst](https://forums.unrealengine.com/u/Juvarunst)\
**Post date:** [December 31, 2017, 8:10am UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/6 "2017-12-31T08:10:32Z")

</div>

I make a dll, I link the this dll in UE4

---

<div class="post-metadata">

**Author:** ![zxf\_ue4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zxf\_ue4](https://forums.unrealengine.com/u/zxf_ue4)\
**Post date:** [November 14, 2018, 2:33am UTC](https://forums.unrealengine.com/t/how-to-read-the-com-port-data-in-ue4/316468/7 "2018-11-14T02:33:34Z")

</div>

Hello, I have the same problem now. I hope I can get your help.My version is 4.20.May I have your email address?My email is [1278263100@qq.com](mailto:1278263100@qq.com)
