Stuck ONS studio 5000 V33

Letone

Member
Join Date
Oct 2021
Location
Québec
Posts
5
Hello everyone,

So I have an AOI that historizes data for the last 30 days, months and years. It worked fine for about a month, then I realized that the last day had about 82 hours of data, which is impossible (we are on earth, not mercury).

For what follows, note that Lo_DATE_DAY is local to the AOI and In_DATE_DAY is the actual date of the PLC. See the attached file for a screenshot of the rung.

To detect a day change, I have a NEQ(Lo_DATE_DAY, In_DATE_DAY). When this condition is true, I send an ONS to MOV(In_DATE_DAY, Lo_DATE_DAY) and lock a data change request.

So, the next time I scan, In_DATE_DAY will be equal to Lo_DATE_DAY.

The problem I have today is that the ONS remains active. Lo_DATE_DAY != In_DATE_DAY even though the ONS was supposed to execute the Lo_DATE_DAY = In_DATE_DAY. But now because the condition before the ONS did not change from true to false, the storage bit of the ONS remains set and does not allow execution.

My question is: Why did the MOV(In_DATE_DAY, Lo_DATE_DAY) operation not occur on the first execution of the ONS and how can I fix this problem so it does not happen again?

Again, this logic worked correctly for a few months. There is no other way to write to Lo_DATE_DAY and the ONS storage bit is only used on this ONS.

Thank you.

ONS_STUCK.PNG
 
Any chance you are using the ons tag elsewhere
If not, my guess is the behaviour observed here is due to the prescan setting the ONS to true.

Basically, if the machine is not in run (eg powered off) when the day changes, then the logic following the ONS will not run.

As bernie said, it doesn't look like you need the ONS anyways unless something not shown can change Lo_DATE_DAY.

Edit: cf. post #2 in this thread.
 
Last edited:
The first thing I would try is change lo_ONS.3 to lo_ONS.12 if that one is not used.


The other possibility is the AOI is not being called. Studio shows the power rails as green in AOIs even if not actively called, Add a rung turning on a test bit, but right before the call to the AOI unlatch that bit. If that bit is not on then the AOI isn't running.
 
If not, my guess is the behaviour observed here is due to the prescan setting the ONS to true.

Basically, if the machine is not in run (eg powered off) when the day changes, then the logic following the ONS will not run.

As bernie said, it doesn't look like you need the ONS anyways unless something not shown can change Lo_DATE_DAY.

Edit: cf. post #2 in this thread.

That's it !! The machine was turned off a couple of time recently. That's a great thing to learn !

And as Bernie and you said, I don't really need the ONS after all.

Thanks !!
 

Similar Topics

Has anyone experienced a ONS instruction bit getting set true? Its happened twice in the last 2 weeks to the same bit. The process has been...
Replies
10
Views
3,912
Hi, I am using M221 reading from 3 different sensors (modbus rs485) sharing same bus (daisy chain). I am currently using READ_VAR (in total...
Replies
0
Views
89
I'm using one TON (called SystemTimer) throughout a program that I change the .PRE given different conditions. I'm porting an IDEC ladder over to...
Replies
8
Views
321
We have a keg check weigher that that lost a fight to a forklift. The scale was previously a Systec IT3000, which was the only PROFIBUS slave...
Replies
5
Views
678
really strange issue. The panelview(2711p-T10C22D9P) will try to load an application and get stuck on "Starting Alarms". If I reboot the...
Replies
4
Views
1,453
Back
Top Bottom