Belt scale calculation for a 12hr period

jtashaffer

Member
Join Date
Aug 2009
Location
KY
Posts
415
I need to calculate the running 12hr total for a belt scale. The belt scale running hour total is done in a Compactlogix PLC but not a 12hr total. I am sending the running hour total in a message to a Controllogix PLC. In the Controllogix PLC I want to store the running hour total for each hour. Then after 12 hours calculate that total for Day shift and then same for night shift. It is another head banger. Does anyone have a good idea about doing this one.
 
I don't know if this is a GOOD idea or not, but you could store those one hour totals in an array and then add them up however you liked

Create new tag > HourlyTotals[11]

or am I missing something? I often do.

Seems if you've gotten as far as you've described, what I'm talking about should be a piece of cake for you ... which makes me think Im missing something .... did I mention that I often miss things?
 
Last edited:
Yeah that's what I was thinking, hour total for each hour than add them togeather to get my 12 hour total. I have my GSV instruction setup to do my hour pulse. For every 12 hour period I need to get my total. 6 am to 6pm, and 6 pm to 6 am. Does anyone have a program example
 
I dont have a program example of exactly what you are asking for. But I do have an example where I use EQU instructions to trigger MOV logic or one shot a bit true that I could share with you if you want.

What you are trying to do is pretty straight forward though.
Each hour move the scale time to a distinct tag for that hour, at the end of 12 hours one shot a CPT instruction and then send the result of that calculation to a specific tag for day shift.
Repeat process for night shift.

Example:

EQU source A = DateTime.Hour / source B = 1
EQU source A = DateTime.Minute / source B = 0
EQU source A = DateTime.Second / source B = 0
Then on end of rung have a MOV instruction with Source = scale run time / Dest = 1st hour total storage tag.
Also you will need to reset scale run time counter after MOV.

So this would move the "scale run time" to a specific tag "first hour total" at 0100 (or 1:00 for you landlubbers)

Repeat this for 12 hours each hour with its own specific storage tag.
Then set up same at say 12:00:01 to CPT (Add hours 1-12 together) with Dest of CPT as your final result for that 12 hour shift.

Let me know if you need the code I can put something together for you to look at.

There may be easier ways to accomplish this but this is one way that will work.

BCS
 
Last edited:
Here you go, just unzip and import into a NEW Program to try it out.
Dont import to a working program as it will populate all the tags I made into your program.

Open RSLogix5000, select New, put curser on MAIN PROGRAM in Controller Organizer tree, Right Click and select IMPORT PROGRAM.

(This was done in version 20, not sure if it makes a difference)


Clock is set up as UDT.

BCS
 
I just found a problem in the program I gave you.

You will need to set the counter preset value to say 4,000,000 or larger, and also change the /60000 at the end of the CPT instruction to /3600000.

This will divide the sum of hour 1 thru hour 12 by 3600000 microseconds to give you a hour value. (Real/Float)
Which will be read as 9.45 hours for example.

Still getting used to microseconds on timers and counters in Logix5000 and was dividing by 1 minute instead of 1 hour.

Also in my last post when I said
put curser on MAIN PROGRAM
to import the program, well I just tried it and you actually put the pointer on "Main Task" not main program, then right click and you will see option for import program.
Sorry about that.

BCS
 
Last edited:
Thanks for the help. I am not where I can look at it right now in that format. Is there anyway you could put it in PDf format?
 
I dont have Cute Writer or anything (IT lock-down ;) )
But I did go and print the two routines off, then scan them back into a thumb drive as PDF.

Long way around but it worked.

Just go off of the PDF as the other file I posted yesterday had a couple of mistakes.
(I was up for 30 hours when I made that yesterday)
Made some dumb mistakes like:
Used unconditonal counter, instead of conditional RTO.
Did not set timer preset correctly
used wrong hour constant in CPT
Called time base Microseconds instead of Milliseconds.(cant believe no one called me out on that one)

Wish that there was a way to go back and delete prior post, but I guess it will be a lesson in what not to do, for someone in the future.

I am sure the GURUs are looking at this thread, shaking their heads, and saying "Its the Blind Leading the Blind"

Anyway here you go written in BRAIL. (PDF)

The file attached to this post is my clock set up.
And I will attach the Day Shift Example to next post, they both would not fit.

BCS
 
And here is your Day Shift Example

Dont ask me why, but when I tried to attach it all as one document it exceded the allowable amount of data, even if I zipped it.

I copy/pasted each page of ladder from the document to individual pages and then attach all 5 pages and it is under the allowable amount. (makes no since, but thats what you got)


EDIT: I give up, right off the bat I see an EQU instruction got deleted in all my messing around.
You will need to add another EQU instruction for Minute = 0 between the hour and second EQU instruction on rung #1.

I am not going to go and print and scan and repost to fix this one, I will take the mulligan.
 
Last edited:
I guess that is a good point, but in post 1 he said:
The belt scale running hour total

So I took it to be running hours not weight per hour, but I could be wrong.

Same kind of idea either way.
If he wants weight totals he will need a way to reset the scale each hour or use another CPT on each hour total rung to subtract previous hours ACC total from current ACC total to get current hour total weight.

Then just add them up at the end after 12 hours.

BCS
 
Last edited:
Tag Arrays used
LocalTime[7] from GSV
Production[26] for hourly totals
Display[2] for 12 Totals

Tag
HR_Total From Compactlogix Message

Create new Subroutine, On first rung double click and paste column E rows 1-52 into mnemonic editor. Then hit Enter. This will create all 52 rungs needed.
 
Last edited:
Hello cwal61,

Could you please explain the process of getting the info from the exel spreadsheet onto the ladder rungs in Logix5000.

I have tried to copy and then paste as you said but I do not get the option to paste. (it is greyed out) and CTRL V will not work either.

Sorry if this turns out to be elementary, I have not used exel to move data back and forth between logix before.

Thanks,

BCS
 
insert a new rung. On the rung number double click or highlight and press enter. This will put the rung into edit mode. Look at the top of your ladder and you will see a Formula bar.
Click inside the formula bar and paste. This will enter the code and then hit enter. The rungs will then be created.

if you double on any rung that contains logic you will see the nmemonic code for that rung in the formula bar.

edit:
I see you got it.
 

Similar Topics

Anyone have a modbus map for one of their Scale Integrators? They have lots of info on their website and state it has Modbus TCP but no Modbus...
Replies
0
Views
849
Hey everyone, Recently installed a Siemens BW500 belt scale on a conveyor, and everything is nearly wrapped up except that we can't seem to get...
Replies
4
Views
2,567
Hello all, I have to write a piece of software (S7-300) for the following: A crusher feeds a conveyor which in turn feeds a system of moving...
Replies
3
Views
1,717
Hi Everyone ! I am trying to develope a belt scale for my project. I have a load cell, wich gives a 0 - 10 V value, depending on the weight. 0...
Replies
2
Views
1,962
Hello, I have a servo motor running a conveyor belt system. I do not have the exact circumference of the head pully and therefore I get some...
Replies
5
Views
1,418
Back
Top Bottom