MicroLogix-using ADD as a Totalizer,but I do not want it to overwrite previous sum

Redland Brick

Member
Join Date
Mar 2005
Posts
24
Hi Folks,
I am using a Micrologix 1200.I want to record the weight on a
conv.Every 45 pulses I want to record the weight.I am using an ADD
funtion,but every time I get a reading from my scale to add,I
overwrite my previous total.I want to create a total instead of a present weight and overwriting.Could you tell me the best way to accomplish this.I am taking in a 4-20 ma from a scale.I want to take this reading in and continuously add this weight.
Thanks in advance.
 

IF (TimeToIntegrate)
Total = Total + New_Reading
TimeToIntegrate = 0
EndIf



TimeToIntegrate is a condition or set of conditions that triggers the store and add of the input.
Based on your description I'm kind of curious what exactly you are trying to accomplish. Can I assume that 45 pulses defines your weighing area and that the weigh station is measuring new material every 45 pulses? If that isn't true I'm not sure what you are looking to accomplish.

Keith
 
Last edited:
Two rungs:
The First one always put the latest value (after scaling it to engineering value) and put in a specific memory register (Word_A)

The seconed one does the following:
Word_B = word_B + Word_A

where Word_B is another memory register (The total).

Is that what you want, Or am I missing something?
 
Keith,

I didn't see your post .. It's the same (and you also mentioned a very important thing which is TimeToIntegrate )
 
Last edited:
Redland Brick,
Something in your title tells me that you already did it the way we did and you are asking for another way to do it, Right? If so, Why?
 
Hey Guys,
You are right Keith,I am taking a reading after 45 pulses.Could you
and Ayman show me an example.I am using RS Logix.

Thanks
 
Is this what you wanted?
add.GIF


I suggest that either you keep the total in a floating point register or you program some additional logic to trap and handle the integer overflow that is sure to occur if you are keeping the running total in an integer.
 
Last edited:
We aren't getting much response on this but from the first post there is a concern about 'overwriting the previous total'. Of course an ADD with the same destination each time will overwrite the previous total. Possibly a table with two pointers pointeg to the previous and next total.

N7:0 = current reading
N7:1 = last total pointer
N7:2 = next total pointer

File N10 table

Initialize N7:1 = 0, N7:2 = 1, N10:0 = 0

Then for each 45 pulse end

ADD N7:0, N10:[N7:1], N10:[N7:2]
ADD 1, N7:1, N7:1
ADD 1, N7:2, N7:2

Which of course will rapidly overflow any table. But I'm thinking that something like this is what is wanted. But we can't tell until we have more info.
 
Before the ADD instruction, MOV the value you want to keep to a different integer. This will save ONE previous total and will not work if you want to keep several totals. We track production numbers by the hour and I have to use 24 words to track the values for 24 hours. We zero these values daily so we only use the 24.
 

Similar Topics

Hi, I am using a Micrologix 1400 for a project, and we were supposed to use a 4.3in PanelView HMI. By means of delivery times, that won't be...
Replies
1
Views
971
Using Rslogix 5000 Data Access manual as a reference I keep getting 'Service Not Supported' response when using symbol instance addressing to...
Replies
2
Views
1,552
Hey everyone, i have a very very stupid stupid question. How do i change the IP address on Micrologix 1400 using Rslogix 500. i know how to do...
Replies
2
Views
3,831
Hi! We need to keep a copy of the program of our packaging machine AB PLC. Would I be able to read the program of a Micrologix 1400 PLC using CCW...
Replies
8
Views
2,981
Good Evening , How easy is it to setup and communicate with a AB MicroLogix with a C-More EA-3 HMI ( Serial ) ? Thanks for your help and...
Replies
3
Views
1,488
Back
Top Bottom