Same "ONESHOT" in Multiple Locations

skyfox

Lifetime Supporting Member
Join Date
Nov 2006
Location
CA
Posts
276
Question regarding ONESHOT logic. Can the SAME ONESHOT be used in several locations within the same subroutine?

For an example: Logic in the same subroutine (AB LOGIX Platform)

RUNG#0 MOMENTARY_SWITCH_1-------[ONS1]-----------LIGHT_1_ON(LATCH)

RUNG#33 MOMENTARY_SWITCH_1------[ONS1]-----------LIGHT_5_ON(UNLATCH)

Is this Legal?

How about this scenario.....(Once again the same subroutine, but different switch using the same [ONS1] bit?


RUNG#0 MOMENTARY_SWITCH_44-------[ONS1]-----------LIGHT_1_ON[L]

RUNG#33 MOMENTARY_SWITCH_17------[ONS1]-----------LIGHT_5_ON[L]

Is this possible or is it a no-no. No way to test it at the moment. Can someone help?

Thanks
 
Last edited:
Obviously it's possible - but unless the author has some devious logic behind the repeated use of the same tag, it will give undesirable results.

For instance, if rung 0 is false and rung 33 is true, then the one shot is likely to fire on every scan.
 
Definitely a no-no. Use an individual bit for each ONS.
In a CLX use bits in a DINT or create an UDT array so you don't have lots of indiviual BOOLS making the tag list messy
 
MikeB said:
Definitely a no-no. Use an individual bit for each ONS.
In a CLX use bits in a DINT or create an UDT array so you don't have lots of indiviual BOOLS making the tag list messy

WHY is it a no-no?

It is all about action. IF an action can activate (turn on) something why can't it also de-acttvate (turn off) someting at the same time.

ALL this depends on the program of course, the programmer has to decide if this is appropriate to his/her needs.
 
the bit address assigned to the ONS will stay on for the rest of scan once the ONS has triggered, Using the same ONS address elsewhere in the program is asking for trouble. You could muck setting the address off etc. But the simplest and safest way is to use an individual bit for each ONS.
 
MikeB said:
the bit address assigned to the ONS will stay on for the rest of scan once the ONS has triggered, Using the same ONS address elsewhere in the program is asking for trouble. You could muck setting the address off etc. But the simplest and safest way is to use an individual bit for each ONS.
+

I think an ONS or OSR etc, any bit that works for one scan, can be used where needed. It is just a condition bit.

Please explain why it would cause problems or be trouble.
 
Here's a simple example. in this case COUNT_SHIFT would increment, while COUNT_DAY would not. Using a unique address say, ONS_B for the COUNT_DAY ONS would give the desired result.

ONS_1.JPG
 
I once had to make a trip across the USA for this problem

A customer said he we having problems with our motion controller. I traveled from Vancouver, USA to Appomatax,VA. The PLC program had used a few one shots in as many as 5 different places. I had never programmed a PLC5 before but I became familiar with it after helping a PLC program redo the PLC program so tat no one shot was used more than once. Then we got the program to work. There was nothing wrong with the motion controller.

One shots should only be used for one condition. I don't see how any body could expect one one shot to work for two or more conditions.
 
Skyfox the fact that you asked this question concerning one shots indicates it is wiser for you to use the one shot once only, until you feel you have a VERY good understanding of there operation
 
rsdoran said:

The example shows incorrect use of ONS. As I said replace the ONS_A with ONS_B for Count_Day and then Count_Day will increment. I'm not sure what u find so funny about it. Sure its a simple example but I think it does show a trap a novice programmer could fall into.
 
I have absolutely no problems using one shots (Diff Up or Down) in a program. I do it quite regularly to trigger things simultaneously and HAVE NEVER HAD A PROBLEM. I guess it depends on knowing how the processor works and what you are trying to achieve as a programmer. It can go amiss if you do not know exactly where you are heading.

Mike, I would not write your example that way anyway in a program. I would bring a line down vertically after the ONS and straight into the second ADD. That is how I normally do my maths and all functions operate correctly.
 
I agree I would bring a vertical down myself. What I'm am trying to show is that in an Allen Bradley PLC the program as I have written it will NOT work ie, only one of the count registers will increment. The operation of one shots varies between different brands on PLC. The Modicon implementation was the best I have seen. The Omron Diff up down proably works differently again.
The original poster was asking about Allen Bradley CLX. I still say in an Allen Bradley PLC use a unique address for every one shot.
 


CONDITION OS Store OUTPUT
----||------+------|/|--------------( )
|
| OS Store
+-----------------------( )



OK - here's a one shot presented without an actual one-shot instruction. Note the 'OS Store'. This is the memory of the state of the 'condition' on the previous scan. That memory must be somewhere. The bit address you provide to a one-shot, is where it stores this memory.

If you use an instruction with a bit assignment more than once then the 'memory' for the second use is of the condition at the previous rung, not the previous scan of 'this condition'.
 
Personnally I would never use a ONS instruction in more than 1 location.
If you need a one-shot in more than 1 location, I would have the ONS instruction energize another bit which will remain on for 1 scan, and use that bit in as many places as you need.

If you create a one shot similar to Bernie's, you will see the Output bit go on for one scan, and then turn off, however if you check the ONS bit you will find that the rung it is on will only be on for one scan, but the ONS bit in the Data table will remain on.

If I were to guess, I would say it may work sometimes, depending on what type of PLC you are using.

Here is an clip from the PLC5 Instruction Manual:

"The ONS instruction is an input instruction that makes the rung true for one program scan upon a false-to-true transition of the conditions preceeding the ONS instruction on the rung."

Kim
 

Similar Topics

I am noticing a problem where i am using MOV instruction and writing literal text into source and String datatype in destination. It works fines...
Replies
6
Views
426
I would like to temporarily install AdvancedHMI on the same computer as FactoryTalk View SE. I am waiting for another contractor to finish the FTV...
Replies
3
Views
530
Hi. Not the fist time I'm saying this but just to give a background. 95% of my PLC programming has used Schneider over the last 10 years on...
Replies
66
Views
4,629
Hello, I have an array of 300 of UDT. In each UDT is an array of 3 DINT and another array of 3 REAL. I have 10 controllers that pull data from...
Replies
7
Views
1,132
Hey guys, This is more of a networking question, but maybe you'll be able to help me. I'm trying to get an HMI to connect to two different PLCs...
Replies
9
Views
1,581
Back
Top Bottom