posting ladder ect...

bce123

Lifetime Supporting Member
Join Date
Feb 2011
Location
texas
Posts
1,177
need help with code

--------------------------------------------------------------------------------

I,m trying to make my post look right. does this look right for the following: If you had a cow and it ate a bale and a half of hay every day and a half how much day would it eat in a week?
load: k1
out: cow
load 1.5
out: hay
load: 1.5
out: days
load: hay
div: days
out: hay per day
div: cow
out: hay per cow per day
load: hay per cow cow per day
mul: k7
out: bales per week

sorry forgot details this is koyo plc
 
Last edited:
I have run the code on a co(w)processor, and here's the result. As you see, it's an anal-og real value: (okay guys, this is as low-brain as can be, but I couldn't resist. I'll retire now. Promise). Kalle

cow.jpg
 
Homework? That is an interesting exercise. While the math is trivial it appears that the exercise is intended to get you to think about your units as part of the computation (a good practice IMO as it helps you avoid mistakes.) though in practice you wouldn't program the units into the PLC equation.

1(cow) * 1.5(bales)/1.5(cow*day) * 7(day)/1(week) =

1(cow) * 1.5(bales)/1.5(cow*day)) * 7(day)/1(week) = 7bales/week.

Notice how some of the units cancel each other out and all that is left is bales/week, which is the desired units for the answer - so we can be reasonably confident that its set up right. Now if a number changes we can just plug it into the right spot and still get the right answer (eg, if we add more cows or if cows start eating more or less, or we want to change the cow*days value (is that anything like man-hours?) or we want to know about how many bales per month we need all we need to do is change the variables instead of the equation.
 
Last edited:
need help with code

--------------------------------------------------------------------------------

I,m trying to make my post look right. does this look right for the following: If you had a cow and it ate a bale and a half of hay every day and a half how much day would it eat in a week?
load: k1
out: cow
load 1.5
out: hay
load: 1.5
out: days
load: hay
div: days
out: hay per day
div: cow
out: hay per cow per day
load: hay per cow cow per day
mul: k7
out: bales per week

sorry forgot details this is koyo plc
If the question was " How many bales of 'hay' per week? " my guess is that the answer would be 7. You didn't ask that question, or did you? By the way, I really dont know how many days it can eat in a week. I'm guessing if there was enough hay the cow could eat every day if it wanted to but it wouldn't have to.
 
My favorite example for teaching students to deal with unit conversions is very similar to BCE123's.

If a hen and a half lay an egg and a half in a day and a half, how many eggs can you expect from a brace of hens in a fortnight?

For an entertaining discussion of units and conversions:
http://www.plctalk.net/qanda/showthread.php?t=12835
 
Last edited:
Trick question. A brace is a pair of birds, one male and one female. The male doesn't lay eggs, so you have to include a 1(hens/brace) unit.
 
maybe we should throw a peck of pickled into the equation. we could give a gold star to whoever comes up with the best problem to solve then post it and give a gold star to the firts one to solve it.we could vote on which plc platform to use. it would br a good learning for students. looking foward the replies. Steve
 
looking back at KALLE's post seems i might need to add some safe guards to this logic
 
A 'collective noun' reference at an audobon site reserves 'brace' for ducks and doesn't specify the number or gender makeup. So it could be as there is no 'brace of chickens' that the output in Steve's question would be zero.
 
never used it but maybe some fuzzy math , or a featherly fractions could be used here. maybe an old time dde link to websters would help this equation. Steve edit: could use that dde link for my post
 
Last edited:

Similar Topics

U
I would like to display RS Logix code for this forum to review. How is this accomplished? I'm having some issueS with configuring an HSCE...
Replies
2
Views
2,317
If I want to post a ladder file (rslogix500) for you guys to review and maybe offer suggestions should I leave it as a .rss file or convert to...
Replies
1
Views
3,122
Perhaps my memories are failing but I used to be able to attach files and post picts directly.....if I upgrade my membership can I post directly...
Replies
8
Views
1,701
Hey group, is there a section where we can post potential jobs openings? Is that allowed on this website? New to the thread - Thanks Never mind -...
Replies
1
Views
1,483
Full time, hands on technician needed for large manufacturer on digital transformation journey. Pay based on experience. Even the most...
Replies
0
Views
1,762
Back
Top Bottom