Jump to content

Recommended Posts

Posted

Hello,

I am new to this forum. I am making a project where I am measuring pressure values inside 10 water tanks. So I am measuring 10 MF vaules. On the screen I can select a water tank, which pressure I want to view.  After the selection, that takes me to next HMI screen (I would like to keep  only one Display/screen on HMI) where I will view pressure in this tank. I would like it to show me only the pressure in that specific tank that I have selected previously. So on my HMI I would like to insert only one 'Numeric' ''box'' (where I can view MI or MF,...), but only the MF or MI of that tank I have selected. 

So it would be similar to 'List of texts: by pointer', but with numeric values.

Is there an answer in vectors maby, or any other way? I would be very happy for an answer.

Thank you, Jan

  • MVP 2023
Posted

Don't use floats unless you really, really need them.  They don't lend themselves well to use in ladder logic or on the display.  Depending on your range and precision required, use an MI or an ML with a virtual decimal place.

If you keep the data in MIs you can easily implement the data selection logic you describe above.

If you attach your program we can see what you're doing and be more helpful.

Joe T.

  • MVP 2023
Posted
13 minutes ago, Joe Tauser said:

Don't use floats unless you really, really need them.

This cannot be emphasized strongly enough. And when do you need them? Never. Okay, it's not never, but it might as well be. If a sensor or other device will only output a float (stupidly, in my opinion), or if there was some unique situation where you cannot know in advance the precision of a number being worked with (can't imagine how, but if so it would require a float). Any other reason? I can't think of any.

13 minutes ago, Joe Tauser said:

use an MI or an ML with a virtual decimal place.

I find that far too many programmers fail to understand what this is or how to do it. Is it a failure of mathematics education, or something else?

Posted

Thank you for reply. Well I am using Pressure transmitters 4-20mA on 10-bit (Analog inputs).  First I linearize them (X and Y). My sensor can read from 0-2,5 [bar]. I can't write constant 2,5 in Y2. So that is why i wrote 25 and then I use math function DIV (calculates MI2/10[constant]) and i get for example 2,5 or any other value.

Or can I display for example 25 as 2,5 in my 'numeric box' on HMI? Never tried that.

Jan

Slika.PNG

  • MVP 2023
Posted
14 minutes ago, jan_tem said:

Or can I display for example 25 as 2,5 in my 'numeric box' on HMI?

Yes, you absolutely can. You can get even more precision out of your particular setup by linearizing to 0-250 to get 2 decimal places, if needed.

  • Like 1
  • MVP 2023
Posted
1 hour ago, Flex727 said:

I find that far too many programmers fail to understand what this is or how to do it. Is it a failure of mathematics education, or something else?

Anyone who has ever used a slide rule understands all of this intuitively, but I don't think anyone younger than 50 (60?) ever has. With a slide rule, you do all computations without regard to decimal location and just keep track of it mentally. At the end you add up the decimal places in your head and write it down accordingly. That said, I certainly wouldn't trade my calculator for a slide rule today. :)

  • Like 1
Posted

Okey thank you I will try that I need 1 decimal place but it is good to know.

One more question on this topic. 

Lets say I want my machine to hold 2,5 bar in sistem. I will need to store that number in my MI. I would like the user to write value - 2,5 (like in real life) with keyboard, and not 25. Are parameters in my 'numeric box' correct?

Slika2.PNG

  • MVP 2023
Posted

By the way, you can change the entry in the box labeled "Opis:" to anything you want. It will be above the keyboard when the user is entering the number. You could say something like: "Enter the value for pressure (max 2.5 bar)".

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.