# Codesys HMI Display value

**URL:** <https://www.wago.community/t/codesys-hmi-display-value/911>\
**Category:** CODESYS\
**Tags:** how-to, codesys\
**Created:** [April 29, 2024, 8:04am UTC](https://www.wago.community/t/codesys-hmi-display-value/911 "2024-04-29T08:04:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![umairyamin](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@umairyamin](https://www.wago.community/u/umairyamin)\
**Post date:** [April 29, 2024, 8:04am UTC](https://www.wago.community/t/codesys-hmi-display-value/911/1 "2024-04-29T08:04:28Z")

</div>

Hi all,

i want to ask a question. Can we display a certain information inside the textbox according to the sensor value ? If can, how can I do that ? For example, when the sensor value range is between 50-100, the textbox will display Low. Instead of showing the sensor’s value, I want it to show information according to the sensor’s range.

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

Best regards,  
Umair

---

<div class="post-metadata">

**Author:** ![CpGelot](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@CpGelot](https://www.wago.community/u/CpGelot)\
**Post date:** [April 30, 2024, 3:36am UTC](https://www.wago.community/t/codesys-hmi-display-value/911/2 "2024-04-30T03:36:33Z")

</div>

hii…there are various Methods…you can go with if\_else, Case function or some standrad lib.

```
    SensorValue: REAL;
sDisplay: STRING(INT#10);

```

IF SensorValue\<=0 THEN sDisplay:= ‘Empty’;  
ELSIF SensorValue\>0 AND SensorValue\<=50 THEN sDisplay:= ‘Very Low’;  
ELSIF SensorValue\>50 AND SensorValue\<=100 THEN sDisplay:= ‘Low’;  
ELSIF SensorValue\>100 AND SensorValue\<=140 THEN sDisplay:= ‘High’;  
ELSIF SensorValue\>140 AND SensorValue\<=180 THEN sDisplay:= ‘Very High’;  
END\_IF

---

<div class="post-metadata">

**Author:** ![CpGelot](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@CpGelot](https://www.wago.community/u/CpGelot)\
**Post date:** [April 30, 2024, 3:37am UTC](https://www.wago.community/t/codesys-hmi-display-value/911/3 "2024-04-30T03:37:46Z")

</div>

and use the “sDisplay” variable in HMI.

---

<div class="post-metadata">

**Author:** ![CpGelot](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@CpGelot](https://www.wago.community/u/CpGelot)\
**Post date:** [April 30, 2024, 4:50am UTC](https://www.wago.community/t/codesys-hmi-display-value/911/5 "2024-04-30T04:50:53Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/5e994b433a102d53b364078de2df27ad64de9fd1.png)  
yes…correct

---

<div class="post-metadata">

**Author:** ![umairyamin](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@umairyamin](https://www.wago.community/u/umairyamin)\
**Post date:** [April 30, 2024, 5:00am UTC](https://www.wago.community/t/codesys-hmi-display-value/911/6 "2024-04-30T05:00:22Z")

</div>

Hi,  
Thanks for your help, I finally managed to do! But another question, can the y-axis changed to alphabet too?

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