Help - Search - Members - Calendar
Full Version: Calculation of totals
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
Noely
Hi,

I have a weigh hopper that weighs cement. What i want to do is calculate the total amount of cement used in a day. The weigh hopper is weighed with loadcells and my weight indicator give me a 4-20mA signal with 0 kgs = 4mA and 100kgs = 20mA. Each time I weigh up I want to record the weight that has just been weighed and then add on the weight to a previous weight. I am using an slc 500. Any ideas would be very helpful.
TWControls
I would first use an SCP instruction
Input - Your Analog Input
Input Min - 6240 (This will vary depending on your which input module you are using)
Input Max - 31200 (This will vary depending on your which input module you are using)
Scaled Min - 0
Scaled Max - 100
Destination - A floating number

Then everytime you want to add the current weight to the accumulated weight use an ADD instruction
Source A - A floating number that is your accumulated weight
Source B - The floating number that you assigned to the destination of your SCP
Destination - The same floating number you assigned to source A of this instruction

paulengr
QUOTE(Noely @ Jul 14 2007, 08:32 AM) [snapback]56577[/snapback]
Hi,

I have a weigh hopper that weighs cement. What i want to do is calculate the total amount of cement used in a day. The weigh hopper is weighed with loadcells and my weight indicator give me a 4-20mA signal with 0 kgs = 4mA and 100kgs = 20mA. Each time I weigh up I want to record the weight that has just been weighed and then add on the weight to a previous weight. I am using an slc 500. Any ideas would be very helpful.


Once you've reached the end of a batch, simply execute an ADD instruction once. Use the one shot (ONS) to do this, or organize your logic in some other way so that it only happens exactly one time.

Trigger off the time such as EQU S:21 0 (check if it's midnight) followed by a one shot in the location where you want to zero the total register as well as most likely copy the number into a "yesterday" location.

If you can't control the timing of the sequence (such as watching an operator add cement and then dump it all), then you have to capture the minimum and maximum readings. Even if you only need the maximum, you might still need the minimum because you will want to measure a TARE.

finfin
You said you wanted to also record the reading... We commonly use a complete file (256words) for data and a separate file for Time. Are you wanting to "record more than 256 instances? We only keep a record of the last 100. we copy the current data to N(x):100 then copy N(x):1, length 50 to N(x):0 then a second step of N(x):51, length 50 to N(x):50. This puts the oldest as the first word of the file and the newest at 99.
finfin
Forgot to mention: The data is copied in two steps (maybe three) due to limitations on the "length" in the copy command.( may it is three copies to get 100... I don't remember now) Be sure and copy the data the "direction" that I showed so that the oldest data point is in the word "zero". If you try to go the other way the copy command will just fill the table with one data point. That is because the copy command is really like a looped move that starts at the lowest address.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.