# Create a datablock and read REAL data correctly

**URL:** https://www.wago.community/t/create-a-datablock-and-read-real-data-correctly/1205
**Category:** CODESYS
**Tags:** cc100
**Created:** [September 12, 2024, 12:28pm UTC](https://www.wago.community/t/create-a-datablock-and-read-real-data-correctly/1205 "2024-09-12T12:28:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![engeup](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@engeup](https://www.wago.community/u/engeup)
#### Post date: [September 12, 2024, 12:28pm UTC](https://www.wago.community/t/create-a-datablock-and-read-real-data-correctly/1205/1 "2024-09-12T12:28:50Z")

</div>

Hello,

I’m sending data from a S7-1200 to a CC100 and it’s working correctly to send individual data. However, I need to send a Data Block with some data of different types (bool, real, dword). My question is: How can I create a data block in codesys to receive the s7 data block and how can I read the real data correctly if when I receive this data it’s not showing the value it should (like in the image). If anyone can help me, I’m out of ideas on how to proceed, thanks!  
 ![imagem_2024-09-12_092839054](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/925ac1c948e3339cc80c2b635402d861261509c5.png)

---

<div class="post-metadata">

### Author: ![Alexander\_Landfried](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/alexander_landfried/32/306_2.png) [@Alexander\_Landfried](https://www.wago.community/u/Alexander_Landfried)
#### Post date: [September 12, 2024, 1:39pm UTC](https://www.wago.community/t/create-a-datablock-and-read-real-data-correctly/1205/2 "2024-09-12T13:39:05Z")

</div>

HI @engeup ,

there is a library available for S7 Communication via S7 Protocol.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/2a1ece6e10e0234928833c31a8c94fc8d2404c23.png)

---

<div class="post-metadata">

### Author: ![WagoMark](https://avatars.discourse-cdn.com/v4/letter/w/d07c76/32.png) [@WagoMark](https://www.wago.community/u/WagoMark)
#### Post date: [September 12, 2024, 4:19pm UTC](https://www.wago.community/t/create-a-datablock-and-read-real-data-correctly/1205/3 "2024-09-12T16:19:13Z")

</div>

I assume the data is arriving correctly in Recebe\_Dados.

Declare a pointer and a real variable like this:  
ptrReal : POINTER TO REAL;  
myReal : REAL;

Then add these two lines of code:  
ptrReal := ADR(Recebe\_Dados);  
myReal := ptrReal^;

The real value will be stored to myReal.
