You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 28th, 2007, 10:24 AM   #1
kdcui
Lifetime Supporting Member
United States

kdcui is offline
 
kdcui's Avatar
 
Join Date: Dec 2007
Location: New Hampshrie
Posts: 309
RSLogix 5K - ONS vs OSR?

I'm trying to determine the difference in functionality of the One-Shot (ONS) vs the One-Shot Rising (OSR) instruction in RSLogix5k.

When I set up both in a test program, they seems to achieve the same result, ONS taking up only one rung where OSR will require two. See attached image.

The instuctions are described as the following:

Quote:
ONS
Structured text does not have an OTU instruction, but you can achieve the same results using an IF…THEN construct.

IF BOOL_expression AND NOT storage_bit THEN

<statement>;

END_IF;


When enabled and the storage bit is cleared, the ONS instruction enables the remainder of the rung. When disabled or when the storage bit is set, the ONS instruction disables the remainder of the rung.


You typically precede the ONS instruction with an input instruction because you scan the ONS instruction when it is enabled and when it is disabled for it to operate correctly. Once the ONS instruction is enabled, the rung-condition-in must go clear or the storage bit must be cleared for the ONS instruction to be enabled again.
Quote:
OSR
When enabled and the storage bit is cleared, the OSR instruction sets the output bit. When enabled and the storage bit is set or when disabled, the OSR instruction clears the output bit.
There is more but I'm sure I don't need to paste it all. I can understand the OSR pretty easily, but I find the logic on the ONS confusing, especially when it seems to function similarly to OSR.

Can anyone explain? Thanks!

  Reply With Quote
Old December 28th, 2007, 11:10 AM   #2
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 5,379
The 'one rung' versus 'two rungs' is an 'apples to oranges' comparison. A more valid one is your rung 0 without the OTL instruction to rung number 1. Both produce a bit (test10 and test14 respectively) which will be on for one scan.

The ONS instruction is more compact if the one-shot effect is needed for that rung only (to set a latch in your example).

Both are similar if the needed effect is to produce the one-scan on bit and use the same number of bits. They're just in different positions on the rung.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old December 28th, 2007, 11:19 AM   #3
kdcui
Lifetime Supporting Member
United States

kdcui is offline
 
kdcui's Avatar
 
Join Date: Dec 2007
Location: New Hampshrie
Posts: 309
Thanks for the reply.

In the example the OTL on Rung 0 does not output to Rung 1, they are different bits. I was manually toggling the test bit on Rung 0 and seeing if that would affect the OTL on that rung in the same way as the OSR on 1 was affecting the OTL on Rung 2; basically Rung 0 and Rungs 1-2 are separate form one another. Sorry, it was a quick and sloppy routine I threw toegether to play around with.

So besides being on different positions on the rung, how would they be used differently? I guess I am wondering if there are any situatations where I would want the one over the other?

Sorry if this might seem like an overly basic question, but I'm pretty new PLC programming.

Thanks again.
  Reply With Quote
Old December 28th, 2007, 11:33 AM   #4
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 5,379
It's really just a matter of programming preference. Just remember the effect of each instruction.

I'm thinking that the presence of two instructions with virtually the same effect comes from the various previous type processors (the PLC2/5 family and the SLC/Micrologix family) and the ways they provided this function.

The ONS instruction is the more intuitive to me. The part of the rung after this instruction will be true only on the rising edge of the logic before this instruction.

The OSR instruction is just a box and, except for the name, doesn't give as visually obvious clue as to its effect - the second bit of this instruction will be true only on the rising edge of the logic into this box.

If a continuation of the one-shot output is not needed beyond the current rung then the ONS is the more obvious choice. It can be used, as in your rung 0 example, to do something immediately (set a Latch). But that 'rising edge on' logic output is not available past this rung. To make it so you need to add a bit which then makes it functionally equivalent to the OSR.

I standardized on the OSR just for continutity.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old December 28th, 2007, 11:43 AM   #5
kdcui
Lifetime Supporting Member
United States

kdcui is offline
 
kdcui's Avatar
 
Join Date: Dec 2007
Location: New Hampshrie
Posts: 309
That makes much more sense now. Thanks!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Rockwell Allen Bradley Programming Software, RSLogix 5, RSLogix 500, RS Linx, RSLogix vvcd LIVE PLC Questions And Answers 21 September 24th, 2009 10:04 PM
RSLogix 5000 V15 Features Samneggs LIVE PLC Questions And Answers 18 April 20th, 2006 05:45 PM
Latching One shots? sportster LIVE PLC Questions And Answers 25 October 10th, 2005 08:36 AM
Cascading ONS and OSR instruction ettikudiappan LIVE PLC Questions And Answers 5 January 30th, 2003 03:14 AM
Cascading ONS and OSR instruction ettikudiappan LIVE PLC Questions And Answers 1 January 29th, 2003 02:02 PM


All times are GMT -5. The time now is 01:22 AM.


.