Logix 5000 ONS Across Multiple Programs

it appears that some of the folks posting here are suffering from some common misconceptions on how the ONS instruction works in RSLogix5000
My approach is to duplicate ONS (Rung 0001 below) functionality with contacts and coils (Rung 0000 below), which contacts and coils I assume everyone understands. This was only an exercise; I assume this is nothing OP does not already understand.

Peace to all.
atomic_ons.png
 
Although OP does not have any conditional JSRs, I am fairly certain that there are some routines that do not execute their XIC(Global_New_Day_Bit) test instruction during the same scan that the Global_New_Day_Bit has a value of 1. There are other possible explanations (one-shot bit is modified during that scan; one-shot actions are ineffective; etc.), but that seems the most likely.

With that in mind, here is a MicroLogix 1100 example, using conditional JSRs* to emulate the same effect, of a single global one-shot event triggering single events in downstream JSR-called subroutines on later scan cycles. The images shown are cropped to fit better; the .ZIP file contains the full-width images.

* Again, I assume OP does not have conditional JSRs; they are only a technique used here to emulate the symptoms OP describes and which are the genesis for this thread.

In all of the subroutines (LADs 10, 20, 30), Rung 0000 is the logic activated by the global one-shot; Rung 0001 is the logic executed every time the routine is called.

Main routine, before first subroutine is triggered:
00crop.png
First subroutine, soon after it is triggered:
01crop.png
Second subroutine, soon after it is triggered:
02crop.png
Third subroutine, soon after it is triggered:
03crop.png
 
I've created a simplified version of the program. Here's the jist:


B87SNH6.png


wT2TINi.png


HCBc13o.png


kNC1JCj.png


I've added a bit to toggle between using the global ONS directly and using the local ONS.

5069-L320ER v32.14

The weirdest thing is that I have 2 programs, running this same exact ONS logic and one is working, one is not. Both 5069-L320ER v32.14.

The one that is working, worked with both the ONS and the TON implementation, after I changed it. The other doesn't work either way.

I've triple checked that all subroutines are called and only called once, all JSRs are unconditional and not AFI'd, each ONS bit is unique, each bit only has one destructive reference.


Working:
RCZRa6n.png



Not Working:
EeASAdx.png
 
In both versions is the ONS controller scope? I think you said yes earlier but just confirming. Also, on the controller advanced tab, what is the time slice set to, and which radio button is selected?
 
In both versions is the ONS controller scope? I think you said yes earlier but just confirming. Also, on the controller advanced tab, what is the time slice set to, and which radio button is selected?

You'll have to be more clear. Assuming you meant the bits used for the ONS instructions? Yes, they're all controller scoped.

Don't know what you mean by time slice or radio button. The controller advanced tab shows the fault routine selection, power-up routine selection, and options to match the project to the controller, allow consumed tags to use RPM, and report overflow faults.
 
I've created a simplified version of the program. Here's the jist:
...
Untitled.png
...


Not Working/Working (similar):
Untitled2.png
New_Day_ONS is the memory bit for that ONS, its value is not the ONS result itself, and is not normally used in a contact (XIC).

In the images above it will reset the previous days' totals as well as reset the totalizer, at, and for the entirety of, each New Day Minute.

The question for me is not why it is not working in one PLC, rather why it is working in the other PLC.
 
I am curious why OP felt the need to reinvent the OSR.

As the good doctor notes, while you can use the address of an ONS as an XIC, this is not usually done because this is functionally equivalent to treating it as on OTE, ie you lose the 'one-shot' aspect which was why you used it in the first place.
 
I suppose that's possible.

We have to re-download this one soon anyway, so we'll see if that fixes it.

re-investigated this again. If I change the reset time to non-0 I can verify that the ONS rung does execute and the totals get reset.

UusDSuQ.png


UQWcTuZ.png


So, for some reason it doesn't work when it's 0? But it does on the other one?
 
New_Day_ONS is the memory bit for that ONS, its value is not the ONS result itself, and is not normally used in a contact (XIC).

In the images above it will reset the previous days' totals as well as reset the totalizer, at, and for the entirety of, each New Day Minute.

The question for me is not why it is not working in one PLC, rather why it is working in the other PLC.

You're looking at 2 different programs. Like I said, those first screenshots are a simplified version. In that second screenshot "New_Day_ONS" is equivalent to the "Global_New_Day_ONS" in the first screenshot.
 

Similar Topics

Hello Friends I have a installation with v16, v17, v18, v19, v20. When I tried to open a v20 file, the enable source protection was not enabled...
Replies
1
Views
258
Hello all, I have the misfortune of needing to support some old firmware version 1756 controllogix machines in rslogix 5000, as well as some...
Replies
16
Views
1,039
I am working for a client and currently installed on their computer studio 5000. they need to give me a backup file on their plc with rslogix 5000...
Replies
1
Views
440
I am working for a client and currently installed on their computer studio 5000. they need to give me a backup file on their plc with rslogix 5000...
Replies
10
Views
830
So, I have a little dillemma I am trying to work through but I feel there is probably a better way. I've always liked the idea of using a VM in...
Replies
5
Views
2,110
Back
Top Bottom