Logixpro Sim. Maths problem.

stevelawson

Member
Join Date
Feb 2004
Posts
115
Hi guys.

I am working on the Bottle Line Sim. and am struggling a bit with the scrap Bottle counter.

Just to refresh memories a small broken Bottle has 2/3s the broken Glass to that of a Large Bottle.

I have managed to sort out the 2 different control Bits, 1 for the broken Large Bottles and 1 for the Small.

The problem is i don't know what to do with them Mathamatically, So that i get more Counts for a Larger Bottle than that of a Small one. I have never used any Maths functions and just need a little guidance or example to get me on the way.

Just one other thing, can you flip between Ladder and STL in this package?

Any help would be appreciated.

Steve.
 
Note: not familiar with LogixPro

I messed around with it some way back but do not remember this task. That said I am somewhat familiar with RSL which it emulates.

Should not need math per se, just 2 counters.

I did not understand what you meant about control bits.

There are several ways to do this, a simple one would be sensors that look for small and large then use those sensors to trigger the counters for each. In other words the sensors at mounted one above the other ie if small is triggered and NOT large then count small, if small AND large then count large.

Where it gets more difficult is when the bottles follow each other and the small bottle sensor always get triggered first. In this case you may need to create a WAS bit:
http://www.plctalk.net/qanda/showthread.php?p=185225&highlight=bit#post185225

You may need to also incorporate a timer i.e. if small bit WAS on and large bit not ON in specified time then count small.

Hope this helps.
 
Hi rsdoran.
The simulation revolves around using 3 BSL instructions, 1 for Bottles existing, 1 for Large Bottles and 1 for broken Bottles.

The way in which i have differentiated between the 2 types of Bottles is to use:-
:A B3:6/8 Control Bit for opening the Scrap Gate
:O 2/4 Scrap Gate
to control the rejection of the large Bottles.

:A B3:6/8 Control Bit for opening the Scrap Gate
:AN B3:4/10 Control Bit for detecting large Bottles
:O 2/4 Scrap Gate
to control the rejection of the small Bottles.

Now that i have these 2 true conditions sorted out, i need to work out how to pulse more counts for the large Bottles than the smaller ones. I was thinking along the lines of muliplication in the form of 6 pulses for a large Bottle and 4 for a small one, hence 2/3 for the smaller.

I don't know if i'm explaining this very well, but see what you think.

Steve.
 
Still struggling with this one.

In the exercise, it explains that the cost of providing cardboard boxes can be significant over time. For this reason it is essential that you fill each box to it's maximun capacity, and do so without spillage. since a small bottle only produces 2/3 as much ground glass as a large bottle, you will have to adjust for this difference in your program logic.

There is no Box Full Sensor in the exercise, you have to calculate how much ground Glass is dropping into the Box. So, 3 small broken Bottles is the equivalent of 2 large broken Bottles. It takes the equivalent of 10 large ground Bottles to fill the Box.

I have 2 Bit Arrays, 1 for opening the gate for a large Bottle and 1 for opening the Gate for a small Bottle.

I think i need to be able to give the Counter 2 pulses after detecting 3 small Bottles, to let the Counter know that the equivalent of 2 large Bottles have dropped into the Box.

Any suggestions please.

Steve.
 
since you already know if it is a small bottle or a large bottle, do two different additions based upon the bottle size. We can multiply the values by 100 and use an integer register instead of a floating point.


IF large bottle bit is true THEN
N7:0 := ( N7:0 + 100);
ELSEIF small bottle bit is true THEN
N7:0 := ( N7:0 + 67)
ENDIF;

IF N7:0 > 900 THEN
box_full_large:= true;
ELSEIF N7:0 > 933 THEN
box_full_small:= true;
ENDIF;




When the box_full_large bit is true, you have to change boxes if the next bottle is large, but you can still allow small bottles until box_full_small is true, then change boxes, move a zero to N7:0, repeat.
 
Last edited:
Hi Ken.
I have no experience of the type of code you have suggested, so i don't know if this is a solution or not. I would need a line by line explanation, please. ( i'm more of a Ladder man )

The broken Bottles come along the conveyor at random and both large and small fall into the same Box. The box they fall into will only hold the equivalent of 10 large Bottles. This is the reason why i was thinking of pulsing a Counter twice after detecting 3 small Bottles. 2/3 X 3 = 2
i.e. the equivalent of 2 large Bottles detected.

Am i making any sense here Ken?

Steve.
 
Now I get it. Try using a counter for the small, when count equals 6 then add a 2 into a total count register (N) and add one each time a large bottle is detected. Reset the small bottle counter after the add. To eliminate any overfill problems may need to use comparison instructions i.e. when total count is equal to 9 and small bottle count greater than or equal to 1 then box full.
 
Last edited:
Hi rsdoran.

Thankyou for staying with me on this topic.

Yes that is exactly what i am trying to achieve. But how do i add a 2 to a counter after the 3 small Bottles? I am really a Ladder man and struggle with some of the more complex instructions.

If the instructions need to be written in STL could you explain each line?

Thanks in anticipation of more help.

Steve.
 
I almost messed up, here is a pdf example in ladder. You may have to work with it a little for your needs. I see I did mess up slightly, change the counter (for small bottles from 6 to 3). I got the general idea but not sure exactly how the large bottles and small bottles are differentiated but this should give you something to work with.
 
Last edited:
rsdoran.

Thankyou so much for those few lines of code. Although i havn't sorted it out yet, this is exactly the kind of assistance i was hoping for. I can now hopefully move on.

Many thanks.

Steve.
 

Similar Topics

Good morning. I am needing some direction on the elevator sim in Logixpro. I have the ladder written and functional but can't seem to get my stop...
Replies
1
Views
1,609
Hey Guys I am doing a tech thesis on the bottle sim and I cannot get my scrap box to cooperate. It moves but however a new box does not go...
Replies
6
Views
2,763
Alright, Heres my problem. I am on exercise 3 boxing the broken bottles. I am able to get the broken bottles to drop and grind, now my problem...
Replies
1
Views
9,802
ive been reading alot of bottle line sim questions/answers on here, bout timers/counters/bit shift. im just wondering beacause im not quite sure...
Replies
1
Views
4,260
J
I'm struggling to find a way to get the large bottles to fall onto the second conveyor,,, If somebody could help me get started. This electrician...
Replies
4
Views
5,044
Back
Top Bottom