Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

need help on running total

This is my understanding of your requirement.
When a batch of cement goes away, you need to subtract it from the total. When the new amount of cement comes in, you need to add it to that total. The amount of the cement to be subtracted is stored in PLC's memory. So I assume that there is a logic value to indicate you that it's time to subtract. Right?
 
It's a little difficult to do so in Lookout, since lookout doesn't support X=X+n.
 
After doing some investigation, I think you can use Accumulator object. For example, pot1 is the amount to be subtracted from total. Pb1 is for pot1 to indicate you when to subtract.  Pot2 is the manually input value. Pb2 is for pot2 to tell you to add the value.
You can create two Accumulator objects. One is for all subtraction. Aother is for all increase. So, for Accumulator1, Input=Pot1, Sample=Pb1. For Accumulator2, input=pot2, sample=pb2. You can create another pb for reset. Then the total=Accumulator2-Accumulator1. 
If the number is too large, you can divide them by 1000 to do all those things.
You can also reset these two Accumulator to zero.  But take down the current value first. After reset, input the current value to pot2.
 
If in your system, there is no pb1. If you just subtract the value at a certain rate, just modify Accumulator1 a little.
 
Let me know if this is what you want.
Ryan Shi
National Instruments
0 Kudos
Message 11 of 18
(2,039 Views)

Other way to do this, is the way most ready-mix batch processors handle it.  Do all the work in the PLC, and just have Lookout handle the final updates on the spreadsheet.

Since the PLC already knows when, and how much cement is being used, have it keep the inventory.  When cement is added, have Lookout accept the amount, and send it to the PLC with a flag (maybe a date/time of when it was added) that the PLC can use to say 'time to add inventory'.  Then all Lookout has to do is get the running total that the PLC is keeping, and store it at appropriate times.

David

0 Kudos
Message 12 of 18
(2,014 Views)
thanks david....you know i would kinda like to handle it in the plc but i don't know how to handle 200000 lbs. in bcd which lets me go to 9999....i have it working sort of like ryan suggested but its a wild workaround.....thanks..randy
0 Kudos
Message 13 of 18
(2,008 Views)

Use double precision BCD (which gives you 99,999,999), or do it in floating point.  Other possibilities would be long integers (32 bits) between Lookout and the PLC, which then get converted to BCD internally.

 

Good luck.

 

David Dudley

0 Kudos
Message 14 of 18
(2,000 Views)
thanks david....that is so easy i'm ashamed of myself...randy
0 Kudos
Message 15 of 18
(1,995 Views)

Historically, we have had mixed results with Lookout.  Probably related to the size or original programming for our system, which is around 6000 I/O points.  Lookout runs, and crashes about once every couple of months.  When it fails, you sometimes loose what's going on up to then, and things have even gotten so bad at times, that we have had to purge all our historical information just to get back in operation.  Oh well, into every life some rain must fall.........

I try to do anything, and everything, that is of operational importance inside the PLC(s).  If one of the PLCs fail, Lookout may survive, but without the PLC.... who cares about Lookout - you can't do anything anyway.  Lookout makes a reasonable operator interface for things, but for something I expect to run for years..... Lookout isn't in the running.  We have PLC systems around here that have run for 10 or 15 years without ever being shut down once.  Lets see you do that with Lookout.

 

David

0 Kudos
Message 16 of 18
(1,988 Views)

Historically, we have had mixed results with Lookout.  Probably related to the size or original programming for our system, which is around 6000 I/O points.  Lookout runs, and crashes about once every couple of months.  When it fails, you sometimes loose what's going on up to then, and things have even gotten so bad at times, that we have had to purge all our historical information just to get back in operation.  Oh well, into every life some rain must fall.........

I try to do anything, and everything, that is of operational importance inside the PLC(s).  If one of the PLCs fail, Lookout may survive, but without the PLC.... who cares about Lookout - you can't do anything anyway.  Lookout makes a reasonable operator interface for things, but for something I expect to run for years..... Lookout isn't in the running.  We have PLC systems around here that have run for 10 or 15 years without ever being shut down once.  Lets see you do that with Lookout.

 

David

0 Kudos
Message 17 of 18
(1,988 Views)
thanks david.....i have it working just like i wanted it.....i have had pretty good luck with lookout for concrete block batching....usually around 200 i/o so i don't have anything near what you deal with.....i also use automation direct plcs which i like alot.....very easy to program and inexpensive and reliable.....about the only problem i ran into for awhile was losing communication with ecom modules which would fault but with some firmware upgrades i think that has gone away....
0 Kudos
Message 18 of 18
(1,980 Views)