PLC program for detecting Run mode status loss

unsaint33

Member
Join Date
Sep 2019
Location
MInnesota
Posts
117
I had bought a used PLC before but I had to return it. Once in a while its run mode shut off momentarily. I had the PLC on my desk. (No I/Os wired) At one point I saw that happening. No issue with the power supplying the PLC. If I was running a machine with it, it would have taken a while before I realized that was going on.

Now I am again buying a used PLC, Micrologix1000 1761-L32AWA. I am going to download a program (No I/Os wired) and then leave it in the run mode for several days.

Is there a way to write a program so I know if it loses the Run Mode? Of course, assuming no issue with the power supplying the PLC.
 
I don't think that PLC even has a real time clock. If you could wire up a "tattle tale" relay to one of the outputs you could use that to tell that either the PLC faulted or lost power.

Just wire an output to a normally open contact on the relay (which needs to have a manual override operator on it) then to its coil. Write a program to keep that output on, then manually operate the contact and it will stay held in until the PLC output loses power which will happen if it drops out of run mode or loses power.
 
Use a S:4 status bit (free running timer) to pulse an output and watch the status light blink for that output.
 
Use a PLC output to generate periodic pulses that restarts an external electronic timer, if the PLC stops the timer output will trigger an alarm
 
If it restarts itself after stopping, you could use a first scan contact driving a counter instruction. Reset the counter when you first start it running for your test. Each time the program starts running after that the counter's .ACC value will increment. Any value greater than zero indicates that the PLC stopped and restarted.
 
Digital output > relay coil > normally closed contact > the loudest foghorn you can lay your hands on.

Set the PLC up to turn that output on at all times, and you will become immediately aware if it turns off (y)
 
I had bought a used PLC before but I had to return it. Once in a while its run mode shut off momentarily. I had the PLC on my desk. (No I/Os wired) At one point I saw that happening. No issue with the power supplying the PLC. If I was running a machine with it, it would have taken a while before I realized that was going on.

Now I am again buying a used PLC, Micrologix1000 1761-L32AWA. I am going to download a program (No I/Os wired) and then leave it in the run mode for several days.

Is there a way to write a program so I know if it loses the Run Mode? Of course, assuming no issue with the power supplying the PLC.

In a previous experience, the company I worked for always had a dedicated output that toggled ON and OFF, at a 1-second rate. This single output would drive the enable coils of two solid state timers - one ON delay, and one OFF delay; both set to 1.5 seconds. The normally closed (open on power fail or timeout) contacts were wired in series with the ESTOP/STOP function of the machine.

When the PLC 'ceased operating its program', one of the timers would time-out, and the ESTOP/STOP would take over.

This is one intrepretation of NFPA 79 - 9.4.2.2.2
 
Use a PLC output to generate periodic pulses that restarts an external electronic timer, if the PLC stops the timer output will trigger an alarm

The OP did state "Once in a while its run mode shut off momentarily", without clarifying how long his "moment" was.

And if the PLC drops out of run mode "momentarily", it will turn all its outputs off. If they are currently off at that moment in time, you will see no difference.

I am intrigued to know how he saw it, "momentarily". Was it a 1mS moment, a 10mS moment, a 100mS moment and so on ....



Now back to the OP''s question : "Is there a way to write a program so I know if it loses the Run Mode?"

The answer is NO, if the PLC drops out of Run Mode, then no amount of PLC program can detect that happening, because the PLC program will stop executing immediately. I do not believe it stops at the end of the scan either. Even if the "Mode Change" does occur at the end of the scan, the PLC would still be thinking it was in Run Mode, until the Mode Change is effected.

With external hardware, driven by a PLC output, even that is going to be dependant upon how long this elusive "moment" is. Too short, and you won't be able to de-energise a relay, for example.

unsaint33 did not mention the brand or model number of the PLC he saw it happening on, just that he''s now buying a Micrologix1000 1761-L32AWA. Saving grace there is that it is relay output, so if he writes a program to turn all the relays on, and leaves that to "soak test", at least he will hear it drop out of run mode, assuming he has a long enough "moment".
 
Some PLC's have diagnostic buffers or power down/ stop routines (these detect a power loss or stop instances) and can either write error codes to a buffer or even run a short bit of code before shutting down, not sure about ML though.
 
The OP did state "Once in a while its run mode shut off momentarily", without clarifying how long his "moment" was.

Daba,
I happened to see the PLC (SLC500 1747-L40A) losing all LEDs then coming back on. I was sitting right next to it and heard a click made me look at it. Maybe a second or two for going from on to off then back to on.

You said if the run mode loss is very quick, an external relay holding circuit may not be a reliable method. I did not think of that. Thank you.
 
Digital output > relay coil > normally closed contact > the loudest foghorn you can lay your hands on.

Set the PLC up to turn that output on at all times, and you will become immediately aware if it turns off (y)




Thank you sir, you just made my day :D. And in doing so you reminded me of the motorcyclist who installed a truck horn driven by compressed air from a considerable air tank on his motorcycle (no small bike either). The effect of said horn was aptly described as "stains Volvo seats brown".


My sincere apologies for the slight derailment. Normal service will now resume.
 
Daba,
I happened to see the PLC (SLC500 1747-L40A) losing all LEDs then coming back on. I was sitting right next to it and heard a click made me look at it. Maybe a second or two for going from on to off then back to on.

OK, so now we know what PLC we are talking about.

The modular SLC500 range power supply is one of the most forgiving of "brown-outs" (where the supply is disrupted or even dips for a time).

I have successfully demonstrated several times in class that you can literally switch the AC input off and on again quickly (rapidly !), and the SLC doesn't hiccup.

Of course, and I think it's a law attributed to a certain person named Murphy, if you try to repeat the test, in front of the same class, you will fail !!

What you described sounds like the processor is going through its "power-up" tests, before going back into Run mode.

My first thought was the power supply is faulty, has a loose connection in it, or electrolytic capacitors "headed south", as they tend to do with age. But I don't think we can rule out a bad chassis connection, or that you bought a dud SLC.

Best way to find out what's not working as it undoubtedly should, is by substitution, keep a record of what you are swapping out, and the permutations should lead you to where the problem is.

It is also highly possible that if you re-assemble the same system that was faulting, you may never see the fault ever again. Stuff like that tends to happen with remarkable regularity !!
 
I have successfully demonstrated several times in class that you can literally switch the AC input off and on again quickly (rapidly !), and the SLC doesn't hiccup.

I used to do that with Atari Space Invaders to glitch the game and it would let you have two missiles in flight simultaneously if you got lucky.
 

Similar Topics

Posted this to Reddit with little success, so I figured I would share it here as well. Very new to PLCs, but figured I would give it a shot to...
Replies
0
Views
110
I'm a beginner in the automation field and I've set up an automation system connecting several devices (datalogger, radio, etc.) via Modbus RS485...
Replies
5
Views
194
Hi All, want to ask. I have PLC a programme to control the valve. The existing programme is to control valve A (Y22), and I want to change to...
Replies
2
Views
137
can anyone has a good program to learn plc programming online. i have the basic looking into improve my skills thanks
Replies
1
Views
137
Hi, I am new to ladder logic. I have completed a code in the Xinje PLC XC3-32RT-E for one of the machines I am developing. Currently the program...
Replies
30
Views
944
Back
Top Bottom