Notifications
Clear all

Add unit without changing recieved value

6 Posts
2 Users
0 Reactions
1,785 Views
(@f-thibaud)
Posts: 3
Member
Topic starter
 

Hello,
I recieve from MQTT a formatted value, with the correct number of decimal (wich I don't know). I try to add only the unit to this value.
I tried with the format :

for a received value of 25.36

{ kN} gives : "  kN25"

0{ kN} gives : "25 kN"

0.0{ kN} gives : "25.4 kN"

How can I just add the unit without modifying the value ?

 


 
Posted : 24/07/2023 11:15 a.m. CET
Matthias
(@m-folte-9469)
Posts: 34
Member Admin
 

Hello Francois,

if you always receive two decimal places you could use 0.00{ kN}.


 
Posted : 26/07/2023 8:19 a.m. CET
(@f-thibaud)
Posts: 3
Member
Topic starter
 

Hello Matthias,

Thank you for reply. Unfortunally, I don't know the number of decimal places, but I need to display the value I recieve (with x decimals) and add the unit.
I changed the way to recieve MQTT values. I now recieve string value, with the correct decimal places and the unit. The display is correct, but now I have problem when I want to get conditions on display.

For example, I recieve a string '12.34 bar'. and I want to change the forecolor of the display if the value is under 0.  It looks impossible for me.

Do I have to publish raw value and string ? this is not really an optimized communication.

Thank you for your help


 
Posted : 31/07/2023 5:23 p.m. CET
Matthias
(@m-folte-9469)
Posts: 34
Member Admin
 

Hello Francois,

is it an option to just add a label with the unti, e.g. "bar", next to the textbox?


 
Posted : 02/08/2023 9:08 a.m. CET
(@f-thibaud)
Posts: 3
Member
Topic starter
 

Hello Matthias,

Thank you for reply.
it can be a solution, but not very convenient. As  example, I have that kind of dipslay for a pump and I have around 10 pumps. 

image

This one is a SVG, but it doesn't change my problem !

I think I 'm gonna display strings and for the conditions (forecolors),  I 'll send a bit from the PLC to indicate a faulty value. 

Thank you for your help.


 
Posted : 02/08/2023 11:05 a.m. CET
Matthias
(@m-folte-9469)
Posts: 34
Member Admin
 

Thank you for your feedback,

we'll take your suggestion of using the format property to add a unit without formatting the value itself into consideration.


 
Posted : 03/08/2023 7:54 a.m. CET