Entering minutes and sec. on HMI AB1000

wrhill

Member
Join Date
Dec 2007
Location
RTP, NC
Posts
5
Hello all!
Kinda new to the PLC world so here's my question.

What's the best way to convert minutes and seconds from the HMI to a T4 timer? I'm using a Maple system HMI and Micrologix 1000.

i.e. operator will enter time in this format 10.50 minutes. Not sure how to make the ladder logic work for this format.

where should this go in the ladder logic and how do I convert this to seconds for a timer preset?

Thanks in advance for your help..It's much appreciated!!
 
The best way is to think about the math involved first -- and that should give you your answer.

First question: Is that 10.50 minutes 10 min, 30 sec? I will assume it is.

The process of doing this will be:

1) Make your entry field a real number
2) Think about this first -- forget the ladder logic -- how do you convert minutes to seconds? Multiply by 60, right?? So, multiply your real-number entry by 60, result into an integer.
3) Move the result into your timer .pre.


If your 10.50 minutes for some reason would represent 10 min, 50 seconds, then just think about the math involved and make it happen in ladder...
 
The ML1000 does not support floating point numbers.

I suggest you have two numeric entry fields on the Maple system HMI, one for mintues and one for seconds. The two fields are adjacent with a : between them, so that on the screen it appears to be XX:XX even thought its two fields. Each field will write to different registers in the ML1000. Lets say that the minutes writes to N7:0 and seconds writes to N7:1. Thus the timer preset will be (minutes * 60) + seconds, or
MUL N7:0 60 T4:0.PRE
ADD N7:1 T4:0.PRE T4:0.PRE
 
The only kind of math a micrologix 1000 can do is integer math. Rounding issues do not occur in integer multiplication and integer addition and subtraction. Rounding can occur in integer division.

Floating point math is entirely out of the question as your PLC cannot do it.

One thing you may need to watch out for is integer roll over. If it is possible to enter a time longer than 546 minutes then you could suffer from integer roll over (ie, the integer is larger than 32767 so it wraps around and becomes negative) which will cause a processor fault.
 
If you go to the numeric tab on the numeric input at the bottom there is a frame that says numeric. there is an adjustment for displaying number of digits above and below decimal.
if you leave raw data checked then this will display an integer as a float. so the float 10.50 on the screen would actually be 1050 in the PLC.
then your math in the PLC would be (1050/100) * 60 = 630 seconds
 
alanMICS said:
...then your math in the PLC would be (1050/100) * 60 = 630 seconds

In a Micrologix 1000 that will produce 660 seconds as the answer. 1050/100=11

Remember the ML1K absolutely does not do floating point math. None. Zip. Zilch. Nada. Not even the intermediate result will be floating point.

It is possible however to mainupulate 1050 into two seperate integer parts, 10 and 50 and then calculate a time based on such an input - but its not the simple equation posted.

Using the DDV instruction you can double divide 1050 by 100. Throw away the result, were not interested in but rather we are interested in the contents of the math register. The math register will contain 10 and a remainder of 50. Multiply the 10 by 60 and store it somewhere. The remainder will always be between 0 and 99 and it will represent a time between 0 and 59 seconds. A quick trick here is to use the SCP instruction to scale the remainder to 0 to 59. Then add that to the value your stored for the minutes earlier.
 
Last edited:
Bump, since you might not have noticed, I edited my previous post describing how to do it with a number such as 1050 as an integer representation of 10.50.

You cannot use any solution that requires you to store a number with a decimal point in the micrologix 1000. You can use a two field method such as the one in post #3, or you can use a larger integer and break it into two seperate integers.

I have used the method I described in post 3 several times. It has the advantage that the operator enry is in true minutes and seconds and the PLC math is straight forward.
 
Alaric,
I like the idea of two fields. Can you give me a brief idea how to make these two fields on the maple appear the same? Right now I have a entry that pops-up a keypad for entering just minutes.

Thanks again for your help!
 
I'd forgotten that the ML1000 doesn't do floating point... Sorry.

But, how about this idea -- And I'm throwing this out there not knowing anything at all about the Maple HMI -- Why not scale the minutes/seconds in the HMI, and send the seconds directly to the PLC?

Most HMIs have the ability to scale values directly on entry or through some kind of scripting.
 

Similar Topics

Hello, the PLC in question is 1769-L30ER. I have a local 4-20mA Analog Output module (1769-OF4CI), and also a remote ethernet PointIO analog...
Replies
0
Views
410
I've done this successfully using Siemens S7 1200 PLC & HMI .. it was way too complicated and expensive. Simply: Enter a numeric number (base...
Replies
6
Views
2,827
FactoryTalk View-When entering a password I get "test$00" instead of "test" ? Good Afternoon, I'm working on a HMI project with...
Replies
8
Views
4,256
I'm looking to find if there is a way to let a user type in long (80+ characters) worth of text using a Graphite series HMI that I can then...
Replies
3
Views
2,074
Hello, I have a Schmersal safety saensor I am looking to put into the Siemens SET tool, however I only have a PFH value, Mission Time and PFD...
Replies
1
Views
1,336
Back
Top Bottom