# CodeSys - Modbus TCP - REAL & INT IO tags?

**URL:** https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905
**Category:** Support
**Created:** [February 1, 2023, 8:36am UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905 "2023-02-01T08:36:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tokis\_andersson](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tokis\_andersson](https://community.factoryio.com/u/tokis_andersson)
#### Post date: [February 1, 2023, 8:36am UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/1 "2023-02-01T08:36:30Z")

</div>

Hello FactoryIO Community! I have searched both on this forum, YouTube and checked codesys/factoryio documents, I don’t find anything that answer my question so now I will ask here in hope that someone could take some time and help me out.

I don’t have a problem to communicate with the BOOL input/outputs via Codesys bulilt-in Modbus TCP, but how do I communicate with values like INT and REAL?

I use the Slave Modbus TCP device.

![image](https://europe1.discourse-cdn.com/flex017/uploads/factoryio/original/1X/bc5af50b05cc3a305e80eb2240040a9ebe828a8b.png)

---

<div class="post-metadata">

### Author: ![tokis\_andersson](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tokis\_andersson](https://community.factoryio.com/u/tokis_andersson)
#### Post date: [March 5, 2023, 9:51am UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/2 "2023-03-05T09:51:23Z")

</div>

Is there really nobody on this forum that knows the answer? This is really frustrating and stops me from doing many of the scenes.

---

<div class="post-metadata">

### Author: ![brunovgr](https://dub1.discourse-cdn.com/flex017/user_avatar/community.factoryio.com/brunovgr/32/12_2.png) [@brunovgr](https://community.factoryio.com/u/brunovgr)
#### Post date: [March 8, 2023, 5:50pm UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/3 "2023-03-08T17:50:21Z")

</div>

Hi @tokis_andersson,

When using Modbus, Factory I/O scales **Float** sensor values by 100, converts it to an integer, and sends it in a **Word**. In Codesys you have to convert this **Word** to a **Real** and divide it by 100 to get the correct value. Note that Factory I/O **Float** and **Int** data types correspond to **Real** and **DInt** in Codesys.

You can find additional information here: [Modbus TCP/IP Client - FACTORY I/O](https://docs.factoryio.com/manual/drivers/modbus-client/#configuration)

---

<div class="post-metadata">

### Author: ![bernard.riera](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@bernard.riera](https://community.factoryio.com/u/bernard.riera)
#### Post date: [June 6, 2023, 2:12pm UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/4 "2023-06-06T14:12:11Z")

</div>

Hi Tokis,

Sorry for my late reply. You maybe could use a web tool we have developped to get the Codesys file from a FACTORY I/O scene.

> **[CReSTIC | Générateur automatique de canevas à partir d'un fichier Factory I/O...](https://crestic-fiotoplcmdb.univ-reims.fr/canvas_generator.php)**
>
> Générateur automatique de canevas pour IDE d’API depuis une scène Factory I/O permettant un gain de temps dans la réalisation de travaux pratiques

This application allows to obtain from a Factory I/O scene file with [Modbus TCP/IP Client card configured], the application canvas for EcoStruxure Control Expert/Unity Pro (.xef), EcoStruxure Machine Expert - BASIC 1.2 (.smbp) & CoDeSys 3.5.14/3.5.17 (.xml).

The project includes all declared PLC variables and the configured Modbus TCP/IP client communication allowing a connection with their soft PLC.

Best regards

Bernard

---

<div class="post-metadata">

### Author: ![tokis\_andersson](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tokis\_andersson](https://community.factoryio.com/u/tokis_andersson)
#### Post date: [August 26, 2023, 6:21pm UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/5 "2023-08-26T18:21:47Z")

</div>

![image](https://europe1.discourse-cdn.com/flex017/uploads/factoryio/original/1X/1e8daf5fb4a2129d43ae1f3f2e99f0569a828d5d.png)

I’m stuck at this stage, I have factoryio 2.5.1 and Codesys 3.5.17.60

---

<div class="post-metadata">

### Author: ![tokis\_andersson](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tokis\_andersson](https://community.factoryio.com/u/tokis_andersson)
#### Post date: [August 31, 2023, 5:40pm UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/6 "2023-08-31T17:40:32Z")

</div>

I just want to say a big thank you to @bernard.riera that took his own time and helped me personally. We had a videocall one-on-one via Discord, he shared his screen and explained to me the process of how to use Factory IO and CodeSys.

I then used his website to generate all PLC variables of the FactoryIO scene inside CodeSys, it was easy to use and saves time when starting a new scene project.

---

<div class="post-metadata">

### Author: ![dilukamdp](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dilukamdp](https://community.factoryio.com/u/dilukamdp)
#### Post date: [August 16, 2024, 11:19pm UTC](https://community.factoryio.com/t/codesys-modbus-tcp-real-int-io-tags/1905/7 "2024-08-16T23:19:08Z")

</div>

Hi Tokis, how did you get pass from this stage ? Thanks.
