Running display on Panelview

maintpro

Member
Join Date
May 2003
Location
Osceola, IN
Posts
28
I having trouble getting my Panelveiw 550 to display the proper total on the screen. I am trying to display a running total of gallons filled in .01 increments. The problem that I am having is that the math registers keep going to -32767 and then decreases to 0 before going to +32767. How can I keep this from happening.

The math setup in my program (micrologix 1500) is that I will take the current value from my high speed counter and divide it by the preset. I want the result to display on the panelview. How can I set up the program or controller to stay above 0? :confused:
 
Have you set up a reset function for that High Speed Counter ?
I am guessing that the actual value is simply running around in "circles" as you have described.
Whatever it is that you are counting, you must know when to start and stop the counter module.
 
The problem here is that by default the Panelview is using a two's complement Integer, which if bit 16 is high the display will result to a negative number. I the Panelview for this tag change the data type to an unsigned Integer and it should display the proper value.

beerchug
 
Panelview running display (more info)

I am trying to fill 1-gallon jugs with various solutions. There is a flow meter installed on the fill nozzle with a pulse output. The high speed counter (hsc) is being reset when the fill sequence is completed. The fill volume setting is made in the panelview in .01 divisions. To change the hsc high preset, I take the panelview input times the preset for one gallon in the program. The panelview read tag then is supposed to display the current fill volume for that station in .01 divisions. To do this, I am taking the hsc accumulated count and dividing it by the hsc preset value. I then multiply by 100 to make it read in properly in the panelview. The panelview read tag is set for unsigned integers and reads fine up to .33 on the display. This is when the the math overflow flips and starts to go to -32767. As the hsc accumulated count increases the math overflow starts to climb to zero and then upwards toward the final math figure (one x 100 when the acc = preset). When the overflow goes negative, the panelview will only display *.** until it goes positive again. How can I set this up to stay positive and is there a better way to accomplish this.
 
Maintpro:

It appears that you need to make your PanelView display integer field a bit bigger. It looks like the display overflows because there is not enough space to show the negative sign. Increase your field size and see if it works out.

Best of luck!

Greg
 
Mike:

I'm missing something. When you say:

To change the hsc high preset, I take the panelview input times the preset for one gallon in the program.

What do you mean by "times the preset"? I assume that there is another constant in your program, but your description makes me wonder if you are multiplying by the existing "hsc high preset"?

Can you give an example of the calculation you expect with some real numbers? Ex: The operator enters 75 into the fill-volume-setting which should be multiplied by a program constant of 10000 pulses per gallon to give an hsc preset of 7500. As material is dispensed, we should see the PV display the actual percent of fill as (ACC/7500)*100.

Thanks,

Marc
 
What do you mean by "times the preset"? I assume that there is another constant in your program

Yes Marc,
there is another constant in the program. The operator will enter a value on the panelview screen, lets say 1.00. The entered value is actually 100 to the program. Therefore, I take the entered value (100) times a set constant in the program so that the total equals the preset needed for the counter. EX. 100 x 88= 8800 to be moved into the counter preset.

I then take the hsc accumulated value and multply it by 100 and divide it by the preset. EX: 756 x 100/8800=8.59. The panelview will display this as 0.08.

Now that I am explaining this to you, I think that maybe I should divide the accumulated value by the preset value then multiply it out for my display. What do you think?

I still do not understand why, with the controller set up for long math (32 bit), why the values keep going to negative numbers once the math equals 32767 or greater. :confused:
 
Mike:

I think that you are absolutely correct - order of operations is critical. I recall that the rules for CPT, MUL, and DIV, specify math problems (overflows, etc) if any of the intermediate values exceeded the valid range of the data type.

With that in mind, if you are using integers, I would make every effort to keep the intermediate values below 32767. So - Divide, then Multiply.


Marc


PS: I would expect that you could convert your data to float and get rid of the problem too.
 
If you multiply first, then you risk math overflow.
If you divide first, then you risk excessive rounding errors.
The ML1500 supports floating point math. Use it for your intermediary math.

Here is a tip: If you use CPT, or MUL or other math instruction, only one of the operands have to be a floating point for the entire calculation to be done with floating point math.

Define your inputs:
How much volume per flowmeter impulse ?

Define your constants:
What is the "preset" that you are using in your math ?
Why do you use the counter preset in the formula ?

I cant make heads or tails out of your math descriptions. Write it down in formula style with dimensions:
like this:
Volume [liters] = (volume per impulse)[liter/imp] x (ACC impulses) [imp].
 
Here is a tip: If you use CPT, or MUL or other math instruction, only one of the operands have to be a floating point for the entire calculation to be done with floating point math.

Okay,
how do I set the PLC up for floating point math? :confused:
The Micrologix programming manual is a little vague in this area.
 
The floating point file F8 exists allready, but has only one element by default: F8:0
You should expand the file to suit your program.
In you program, simply use F8: adresses in stead if N7:. The PLC will automatically convert between floating point and integer math.
When putting the result in an integer, the fraction part of the floating point value will be rounded off.

Question: How much volume of "solution" for one impulse from the flowmeter ?
 
Question: How much volume of "solution" for one impulse from the flowmeter ?

It takes 8800 counts (pulses) from the flowmeter to equal one gallon of solution. Of course this total will vary from flowmeter to flowmeter, but this is what I have come up with.
 
Maybe the problem comes when you need to dose more than 7.44 gallons.
At that amount you will have 7.44 x 8800 impulses = 65536 which is the maximum that a one-word unsigned integer can hold.
(If the module interprets the count as an signed integer it will happen at 32767 = 3.72 gallons.)

I dont know your program, but I guess that you are only using one of the two Actual Count Value words.

In the following I assume that the value is interpreted as an unsigned int by the module (but I dont know for sure).
The 1769-HSC module stores the actual count in two words. So if the count is greater than 65536 unsigned (32767 signed), the value will start to fill into the second word and the first word will be reset to 0 unsigned (-32768 signed).
When you look at a word in RSLogix, it will always be interpreted as a signed int.

You could calculate the actual dosed amount like this (use floating point):
Number of impulses = (1stWord + 32767) + ((2ndWord + 32767) x 32767)
Dosed amount = Number of impulses / 8800.
 
I think I made a typo. The correct formula should read:

Number of impulses = (1stWord + 32767) + ((2ndWord + 32767) x 65536 )

Another method that I have just discovered is that the ML1500 supports long integers !
You have to create a new datafile of type "long" (ex: L9).
Right now I dont know how to move the actual content from the two counter words into the L9: address.
But it would simplify the whole thing:
Number of impulses = (long address filled with data from counter module).
Dosed amount = Number of impulses / 8800.
 
Last edited:

Similar Topics

Powerflex 40 drive suddnly stopping while running & there is no alarm on the display Hi, I need help on Powerflex 40, 3 no's powerflex drives...
Replies
1
Views
6,178
Greetings! HAs anyone encountered working with displaying an alarm indicators like machine troubles: Low water level at cooling tower Low...
Replies
8
Views
2,782
I have no experience with Eaton HMIs. I downloaded the Galileo software and I am trying to get the file on a HMI (XV-102-H3-70twrl-10) to modify a...
Replies
4
Views
101
How to fix if appears code “$115 plc-restart running” on the screen OP17
Replies
5
Views
246
Here's what happened, Operator turned on the disconnect for an auger while it was still running to cut power. Auger DID in fact turn off, but the...
Replies
8
Views
335
Back
Top Bottom