CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Apr 23, 2019 3:28 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jan 23, 2019 4:17 pm 
Offline
User avatar

Joined: Wed Mar 09, 2016 1:20 pm
Posts: 24
I need to visualize into Codesys 2.3 HMI an INT value like this:
myVAR:INT;
100 = 10.0 sec

is there some way to get 10.0 visualization using INT? I found this

Attachment:
Codesys_2019-01-23_16-14-17.png
,

but if it's ok on reading, when I write it miss 0.1 : ex I write 10 , then I should expect 100 into INT var but I get 99!

Any help is appreciated


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Jan 24, 2019 2:16 am 
Offline
Frequent User
Frequent User

Joined: Sun Apr 15, 2007 1:18 am
Posts: 155
Hello,

If I understand you idea, you want to :
dispay 10.0 if MyVar=100
display 10.2 if Myvar=102
and so on ...

To do that you can, in the settings of a rectangle (by example) write :
Category Text -> Content: %2.1f //display format for a REAL, with 2 digits before point and 1 digit after
Category variable -> Textdisplay : INT_TO_REAL(MyVar)/10 //conversion of the INT into REAL, then division by 10

Another solution could be :
Category Text -> Contente: %2.1f //display format for a REAL, with 2 digits before point and 1 digit after
Category variable -> Textdisplay : INT_TO_REAL(MyVar) //conversion of the INT into REAL
Conversion factor : 0.1 //Division by 10
:D

It works ... but you can't change the value of MyVar directly by this rectangle. You can't have a text imput with a such equation. :cry:
If you want to change the value of MyVar, you have to add another rectangle close the display (I put it in the background under the first, letting it go a little beyond, so I can click on it).
In this second rectangle you can display MyVar with %d and configure a text input.

It's just an idea. Maybe there is a smarter solution ?

BR


Top
   
PostPosted: Thu Jan 24, 2019 5:41 pm 
Offline
User avatar

Joined: Wed Mar 09, 2016 1:20 pm
Posts: 24
JAPIB wrote:
To do that you can, in the settings of a rectangle (by example) write :
Category Text -> Content: %2.1f //display format for a REAL, with 2 digits before point and 1 digit after
Category variable -> Textdisplay : INT_TO_REAL(MyVar)/10 //conversion of the INT into REAL, then division by 10


great it works! I 100% miss I can use conversion function into HMI, good to know.
Thanks


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited