Would like some techno-logical help on a working project

CeeDee

Member
Join Date
Jun 2014
Location
Bremerton, WA.
Posts
94
I have a small part of a working project that I have going on and I wanted some suggestions or advice on how this will play out before trying it on the machine. The ladder program in the machine currently works, I've just been modifying to the program to make it run with an auto/manual motor control switch I've added within the HMI for better user control. I've omitted a lot of the extra stuff, like how the auto and manual mode work for example, and just listed what I'm trying to figure out at the moment. The addresses are all made up. I had to regurgitate all this from memory since all this is at work. I can't bring it home. I know I know... it sucks. Tell me 'bout it! o_O

I have two things I'm looking at here:

I'm not too sure on the OSR command, and how it works in a practical sense. I want the run enable to disengage (go false) when the auto/manual (mode select) switch is switched from whatever state it is in while the motor is running. This will shut the motor off after 15 sec. If the motor is not running and the mode switch is toggled, I want the run enable to stay true. The stop button has an immediate stop to the motor.

The next thing is the restart delay timer. I just want to make sure the motor can't restart after shutting down until 15 seconds has passed. I'm not sure I'm reasoning out the ladder scan correctly.

Please 🤞🏻 go easy on me. I'm no expert at this. Just a guy trying to make a living. (y)
 
Last edited:
I had to regurgitate all this from memory since all this is at work. I can't bring it home. I know I know... it sucks. Tell me 'bout it! o_O

What I do at my part time day job to get around that is My Windows 8.1 laptop & new desktop came with OneDrive from Microsoft, a cloud based file storage folder. The job computer is Windows 7 Pro, but was easily able to install OneDrive on it. I have all my programs now set to the default folder of OneDrive instead of My Documents. Any file saved to the OneDrive folder under the Users directory is automatically uploaded to my cloud storage & then immediately downloaded by my other 2 computers so any change I make on any computer is on all 3 within minutes. I also got the Android OneDrive app & can VIEW all the files, pictures & videos on my phone, plus any picture or video I take on the phone is automatically uploaded & appears on all 3 computers without intervention.:cool:

IT there has yet to complain & they monitor & log all network & internet activity.
 
Aabeck - I wish. Work won't allow it. It's not that I wouldn't bring work home to get some extra time in on a project I'm working on, it's that I can't. I can't even plug in a USB thumb drive into our networked computer system. It is not worth my job over. Uncle Sam has strict rules. (n)

It's nuts I know. It's a very hard way to do business. That's why I'm on here. Learning and getting help when I can so I can be a little more self-sufficient. :p

I just forgot to bring home a printed copy of what I was working on.
 
The two methods of the mode changing (rungs 0 and 1) must go to separate bits, not the same one. Then, on another rung, make a parallel circuit (OR) of those two which energizes a third (keep this as B3:0/0 so the rest of the logic is the same.) But choose two currently non-used bits for the first two rungs.


Rung 6 - restart Delay Timer. Use just a NC of 'Run Enable' as the enable for this timer. 'Run Enable' will only switch off if the 'Run Relay' was energized at the moment of the mode change.

Just a guy trying to make a living
As are we all. Good luck.

Re: not being able to bring stuff home, while I can I really don't need to. After more than 30 years at this company code is burned into my brain, which keeps working on it without a computer all night. Sometimes though the answer to a really sticky problem will just pop into my head in the middle of my sleep. I keep paper by my bed to write it down in case I lose it.
 
Last edited:
Just a quick look but maybe try:

Change B3:1/0 OSR to ONS
Change B3:0/0 to a OTL

Change B3:1/1 OSR to ONS
Change B3:0/0 (on rung 001) to another element say B3:0/1 if it is not already used and make this OTL.

Extend branch under B3:0/0 on rung 002 and add XIC with the new B3:0/1 you just made from above.

Now add a rung after rung 002 and add XIC T4:0/DN and then put a OTU for both B3:0/0 and B3:0/1

Also it looks as if you have something funky going on with rung 005 and rung 006.

Motor run relay O:1/2 is dependent on T4:1/DN

But it looks like the way you have rung 6 set up you will knock this timer out of DN state as soon as the motor run relay O:1/2 Energizes, thus you will deenergize the Motor run relay and it looks as if you will have to cycle the motor run command to start this same process all over again.

I think you could just delete the branch extension on rung 006 and the 2 XICs that are on it and what you are trying to do should work.

I just gave it a quick glace so excuse me if I have looked at this wrong.

BCS

EDIT: Man, Bernie types fast!!!
 
Last edited:
Also it looks as if you have something funky going on with rung 005 and rung 006.

Yes, I did. I had rung 0006 XIO address for O:1/0 it should have been the same as the extended branch XIC (O:1/2). Well, that's the way I intended it to be written, anyways. I will edit the post.

I'm still reading through, and interpreting your guys' feedback. Converting words to logic takes a little more time. But I appreciate you! I'll look into it more in depth tomorrow (y)

Bernie does type fast!
code is burned into my brain
;)

For now, Need sleepy ... :sleep:
 
The two methods of the mode changing (rungs 0 and 1) must go to separate bits, not the same one
BERNIE - If ONLY one rung could be true at a time I don't see the problem with using the same addressed OTE bit. Is that a defined RSlogix rule? Either way, I like what you suggested. I think it looks cleaner. (y)

BCS - Looking at the instruction help page within the RSlogix version(old) I'm using at work and it shows OSR is used for the PLC family of PLCs and the ONS instruction is for the Micrologix family. But besides that part, I don't see the need for latching outputs. The timer on rung 0002 will latch itself in via the extended branch and the timer timing bit.

:confused: I know the last rungs 0005 and 0006 look funky, but believe it or not, those are OEM rungs. I checked back at work today, and those are in the original program. I'm just trying to figure out how it works exactly and if I should change it. I've never tried to start the motor within 15 seconds of it shutting down. I've just always played it safe with old industrial motors. It must be some kind of tried and true method using the simplest method to achieve a working delay.

After 15 sec of rung 0006 being true (motor run relay off), timer 4:1 goes done. Lower branch latches in the timer to stay done once O:1/2 energizes. Staying done makes it so the motor run relay can go true, provided there is a run command. But, what I don't get is once O:1/2 goes false (motor run relay drops out) the XIO on rung 0006 simultaneously becomes true once again. Since the timer, in that instant of time is done, how does it not just stay done, with the XIO contacts essentially just taking over the work of the lower branch latch? I wonder how the timer actually resets to start timing again. o_O
 
Last edited:
CeeDee said:
BERNIE - If ONLY one rung could be true at a time I don't see the problem with using the same addressed OTE bit. Is that a defined RSlogix rule? Either way, I like what you suggested. I think it looks cleaner.

There is a very big problem with this. Consider this logic:
Code:
     B3:0/0     B3:0/1             O:0/0    
|-----| |---------|/|---------------(  )-|

     B3:0/0     B3:0/1             O:0/0    
|-----|/|---------| |---------------(  )-|
It is impossible to have both rungs true at the same time, as you suggest.

At first glance you might say, if B3:0/0 OR B3:0/1 are on - but NOT both of them - then in either case, O:0/0 will be turned on. But this is not the case.

Let's say that B3:0/0 is off and B3:0/1 is on. The first rung will examine B3:0/0. Since it's off, it will not pass "power" through to the next instruction. The PLC will then continue along that rung and scan B3:0/1. It doesn't care about the state, it already knows that the input to the -|/|- instruction is false, so the output will be false regardless. It proceeds to the next item in the rung, which is the OTE (coil). Since the logic at this point is false, it will turn O:0/0 off. Next rung! Second rung will examine B3:0/0. It's off, which it needs to be to pass "power" through the -|/|- instruction, so it will pass "power" through to the next instruction. The PLC continues along to the next instruction and scans B3:0/1. B3:0/1 is on, so once again we pass the "power" along and continue to the next instruction, which is the OTE (coil). Since the logic at this point is true (i.e. "power" passed all the way through the rung), it will turn O:0/0 on.

So in this example, our logic seems to have worked. We have one of the two B3 bits on, and not the other, and our output came on. But now let's consider what would happen if the reverse were the case: B3:0/0 is ON and B3:0/1 is OFF. We still have one bit on, but not the other, so our output should still come on, right? (spoiler alert: not right)

The first rung will examine B3:0/0. It's on, so it will pass "power" through to the next instruction. The PLC continues along to the next instruction and scans B3:0/1. For the -|/|- instruction to pass "power", B3:0/1 needs to be off/false, which it is. So we pass the "power" along and continue to the next instruction, which is the OTE (coil). Since the logic at this point is true (i.e. "power" passed all the way through the rung), it will turn O:0/0 on. Next rung! The second rung will examine B3:0/0. Since it's on, it will not pass "power" through the -|/|- instruction. The PLC will then once again continue along that rung and scan B3:0/1. It doesn't care about the state, it already knows that the input to the -| |- instruction is false, so the output will be false regardless. It proceeds to the next item in the rung, which is the OTE (coil). Since the logic at this point is false, it will turn O:0/0 off. So at the end of the two rungs of logic, our output is off, and we wanted it on.

The moral of the story is twofold. First, the PLC doesn't stop executing a rung just because the chain of "true" conditions is broken; and second, if you use multiple OTE's, the last one always wins.
 
Last edited:
Well thats what I get for only looking at it for a second.

I do see now how you are keeping the Motor Shutdown Timer lached with the branch extension and the TT bit. So you are right the Latching Outputs would not be nessasary.

As for rung 5 & 6 if you replaced the T4:1DN instruction on rung 5 with a XIO T4:1/TT and just delete the branch extension (and the 2 instuctions on it) from rung 6 I think that would do what you are looking for and be more readable.

BCS
 
Last edited:
P.S., to make our theoretical logic work as we theoretically wanted it to, we would do this:
Code:
     B3:0/0     B3:0/1             O:0/0    
|-----| |---------|/|----------------(  )-|
                             |
     B3:0/0     B3:0/1       | 
|-----|/|---------| |--------*
 
Looking at the instruction help page within the RSlogix version(old) I'm using at work and it shows OSR is used for the PLC family of PLCs and the ONS instruction is for the Micrologix family.

Hmm, I never notice this before, so I had a look at my PLC-5 Program and I do have ONS instructions all over the place, as well as I checked on the Tabbed Instruction Bar and ONS is avalible as a valid choice.

Then I looked at a program for a SLC 5/04 and the ONS instruction is not valid for this PLC.
(Never had to add anything to the SLC so I never noticed this before)


Thats why I like spending time on this forum and participating in the conversation.
I learn plenty from here, even if it is just someone else telling me I am wrong. At least then I know.🍺

What PLC are you using? (I dont think you said in your post)

Have a good one G-Man.
(Ha, that should be your new forum name)

BCS
 
if you replaced the T4:1DN instruction on rung 5 with a XIO T4:1/TT and just delete the branch extension (and the 2 instuctions on it) from rung 6 I think that would do what you are looking for and be more readable.
BCS - you're right! That would make it more readable. And I should have seen that. Simple and effective. I must have been staring at it way too long, :eek:. I think I will go that route. It just baffled me on why it was done the way it was. I just wanted to know how it worked. I have an inquiring and curious mind. But, Thanks for the tip!
What PLC are you using? (I dont think you said in your post)
My bad. I'm using a SLC503. I have a 505 somewhere as well, I really want to mess with some day. But this particular machine is using the 503.

ASF - Thanks for taking the time to type up the lesson. I needed it. I forgot about how the scan cycle works. After reading your post and looking at a Ron B Training video afterwards on the scan, it refreshed my memory from back in school. It is very easy to forget if you don't stop, sit down and think (remember) how the PLC is running. It's too easy to think of it as a electrical relay-logic diagram. I'll probably forget again. I'm getting old. :(
P.S., to make our theoretical logic work as we theoretically wanted it to, we would do this:
I only drew it out as two individual rungs because I got an error when I tried to branch it into one OTE as you've shown. "Invalid OSR position!" is what it said. I would have preferred your way, if I could've done it. But the way BERNIE suggested from a previous post should do the trick just dandy. (y)

Thank you gentlemen (sorry if any of you is a woman)for your help! I applaud you. (y) And, I would buy you all a beer if I could. 🍺

...I will have more questions some time later if I don't get around to testing it. This was only part of the program I've been working on.
 
I only drew it out as two individual rungs because I got an error when I tried to branch it into one OTE as you've shown. "Invalid OSR position!" is what it said.
CeeDee,

You must have been trying to use 2 OSR instructions (one on the rung and one on the branch) and then reunite the branch to the rung just before the OTE.

If you only use 1 OSR and reunite the branch and the rung before the OSR you would not get the error message.

I just dont think you can have a OSR on the Branch or before where the branch and the rung reunite. It needs to be the last single instruction before the output.

Only thing I would not be sure of is would the rung ever go false this way for the OSR to fire agian???
(NOT SURE)


-----] [---------------------------OSR------( )
|```````````````````|
|```````````````````|
*---]/[--------------------*

You are probably much better off using the two seperated OTE with unique data addresses.

And Man a beer would be good right about now.


I have about 2 more months to go before I can have a beer.
We are treated like children about this, but it is only because there are those that have no self control, and would go out and have way to many and get in trouble.
(They have tried letting crew have a few off duty in the past and it did not work out very well)
Sucks for the rest of us though.

Oh well just add it to the list of thing I look forward too when I get off this floating prison with a paycheck.

Good luck with you project.

BCS
 
Last edited:
Sometimes though the answer to a really sticky problem will just pop into my head in the middle of my sleep. I keep paper by my bed to write it down in case I lose it.

Funny you say this. I have done the same and once a whole page full of code popped into my head in the middle of the night! I programmed it the next day and fixed a nagging problem (y)
 
Funny you say this. I have done the same and once a whole page full of code popped into my head in the middle of the night! I programmed it the next day and fixed a nagging problem (y)

When I got a nagging problem, I load everyone in the van & go to Dairy Queen, usually while relaxing there the complete answer comes to me without thinking about it - I call it writers block.
 

Similar Topics

Does anyone know a workaround to open a .ACD file with this error code. We are not onsite and we need to open it to get tag data but we cant...
Replies
4
Views
3,321
Hello I am currenlty facing a problem on cpu load with using Technological Objects (TO) with a ET200S CPU 1512F. i have two axis drives S210 on...
Replies
8
Views
3,020
Hello, I have a radio telemetry system that has an RS-232 interface that "understands" the DF1 protocol. In one place I still have a Compact...
Replies
4
Views
2,079
I have been asked to work on a still running Micro84 system that I built in the mid 80's. I have one PLC throwing e60 which usually means PLC...
Replies
0
Views
1,459
Hi, I have cross cutter example for Siemens 315T CPU. This example have function blocks FB530, FB531, FB532 and FB534. my question is 'Can I use...
Replies
5
Views
2,634
Back
Top Bottom