Quick question

New2PLCs

Guest
N
My program worked great until I fired it up with an input on. Bummer! Part of my code executes on a one-shot rising instruction. It looks like this:

<big><big><listing>
I:0 B3:0
|--| |-----------------------------------( )--|
0 0

B3:0
|--| |----------------------------+-OSR-----+-|
0 | B3:0/1 |
| B3:0/2 |
+---------+
B3:0
|--| |----------------------------+-ADD-----+-|
2 | |
+---------+
</listing></big></big>
.

The code is a bit more involved than this, instead of I:0/0 simplying turning on B3:0/0 there is some intermediate processing in a subroutine, and there's also other outputs hanging off the XIC B3:0/0, but this is essentially what it amounts to.

My question is why doesn't my one-shot fire when an input is on when the program initializes. (I've already got a work-around: an XIO S:1/15 in line with the XIC I:0/0 so that it waits to examine the inputs until the second scan, in which case my one-shot works just fine.) I was hoping one of you guys with more knowledge of the internals of this stuff might be able to tell me. I would think there's something more to the OSR that you don't see other than the storage bit and the output bit, or I would expect the one-shot to fire on the first rung scan.

Thanks,

-Don
 
Instead of using an OSR one-shot, try the ONS type - I think it may work more along the way you are expecting (to one-shot on power-up if the bit is ON on powerup.

Or, try the classic:

B3/0 B3/1 B3/2
---| |---+---|/|---( )
|
| B3/1
+---------( )





The PLC will reset B3/1 and B3/2 on power-up, and so B3/2 will fire for one scan on the first scan (assuming you start with I:0/0 ON), even if it had fired (and B3/1) is still ON) when the PLC went off/program mode.

I think what's happening is that the PLC only resets the OSR instruction on a True-to-False transition, and it is not one of those instructions that get reset on powerup (unlike Timers and Coils). Since B3:0/0 was ON on the last program scan, and is also ON on the first scan, there is no transition, therefore no firing.


Ooops. I just read the Help for PLC-5 ONS.

Note: During prescan, the bit address is set to inhibit false triggering when the program scan begins. © 1997 Rockwell Software Inc.

Which means that the ONS also won't fire on startup. So it looks like you need the "classic" method.
 
Last edited:
The OSR instruction evaluates the preceding conditions and upon a false to true transition the one shot 'executes'. When an input is present on start up the XIC is true at the beginning of the program scan and thus would have to toggle off then back on for the one shot to work. Your solution of using the first pass bit does seem to work although in reality the one shot is executing on the second program scan.

Note that the address specified for the one shot stores the previous rung condition, not the state of the one shot.
 
<blockquote>quote:<hr><blockquote>
quote:
<hr>
Note: During prescan, the bit address is set to inhibit false triggering when the program scan begins. © 1997 Rockwell Software Inc.
<hr></blockquote><hr></blockquote>

Hmmm. I guess that means that for a OSR, the bit that stores the previous rung condition is set to true, and for a OSF it's set to false.

-Don
 
Peter,

COOL. Probably doesn't make any difference, the way I'm doing it works fine, but that is a neat idea/solution. I was just dumbly assuming that there was something else "behind" the instruction--didn't think about them possibly manipulating those storage bits at startup.

Thanks, all.

-Don
 

Similar Topics

So the quick and short of the situation is that I designed an axle press that was sent to one of my company's other facilities. That facility just...
Replies
19
Views
4,228
So I have a PID loop on an 1756-L61 running V17 software just for background. Also the PID PV is a pressure transmitter and the CV is speed sent...
Replies
1
Views
893
Has anyone come across a 3 turn potentiometer that is panal mounted with either a 22 or 30 mm hole? I have been looking but nothing so far. They...
Replies
20
Views
4,682
Hi, I am just learning CCW, finally got connected to a micro820. I'm wondering what the Version number means. The program that was already in the...
Replies
1
Views
1,617
How do I measure if I am getting a signal out of the plc output? All of the outputs are giving me the same voltage, however I am certain that not...
Replies
6
Views
2,167
Back
Top Bottom