Help with changing PLC Program

TONH2

Member
Join Date
Nov 2024
Location
NJ
Posts
6
Hi, I am pretty new to PLCs, I have the program attached that requires some changes to it.

There are two inputs (Alarm 1 and 2), at the moment when an alarm occurs it closes the contact. I am looking to change this so that the inputs are energised during "normal" operation and they go open when an alarm condition occurs.
There is a light stack that is illuminated when either alarms occur (Alarm 1 take priority). The outputs energise relays to the light stack to turn on the lights, however at the moment they are wired as NO, however this does not provide "fail safe" should the relays fail. I need to provide fail safe where the relays are energised in Good conditions and then deenergised for an alarm condition. The wiring will be changed to provide this on the relays however I need help on how to change the PLC program for this.
Hopefully this all makes sense.
Ladder Logic Edit_Page_1.jpg
 
Last edited:
Just change each instance of X003 and X004 to the opposite state instruction. If XIC/NO, change it to XIO/NC and vice versa.
 
Just change each instance of X003 and X004 to the opposite state instruction. If XIC/NO, change it to XIO/NC and vice versa.
Hi, I originally tried that thinking it was that simple but doesnt appear to work (unless I am missing something!), see the simulators I have created below:
Original - Original
Changed (as per your instructions) - Updated
Feel free to edit the simulator, you can save any changes and create a new shareable link as below:
1730543714079.png

thanks
 
Your simulation (both) works for me. Did you turn both X003 and X004 on in the second instance as the normal state?

BTW, in your simulations, your C2 gets latched on for 100 seconds due to first run bit. Not sure if that was intended but doesn't make sense.
 
Last edited:
Your simulation (both) works for me. Did you turn both X003 and X004 on in the second instance as the normal state?
sorry not sure how both work?
In the second one I have changed all instances to be opposite state.
If 5ppm = Active then Only the RED light should be ON
If 1ppm is Active then Only the YELLOW light should be ON, however if 5 ppm is active then it should take priority and Only RED light should be on regardless of 1ppm state
If heartbeat is in Fault then only BLUE light should be ON
When all conditions are good then GREEN light should be ON and then overwritten by any of the conditions above.

5PPM (X003) = TRUE = RED LIGHT (Overrules YELLOW Light condition)
1PPM (X004) = TRUE = YELLOW LIGHT
Simulate GC9100 Fault = TRUE = BLUE LIGHT
 
Last edited:
You have a typo on your yellow light. You inverted the red light Y and you should not have.

Check your logic. The only thing that should have changed were the instances of X003 and X004.
 
You have a typo on your yellow light. You inverted the red light Y and you should not have.

Check your logic. The only thing that should have changed were the instances of X003 and X004.
ok I have fixed that, however still not correct, this should show GREEN light only:
1730545491024.png
this shoudl show YELLOW light Only:
1730545755786.png
this should show RED Light only:
1730545678461.png
 
You are fundamentally misunderstanding. For green light, x003 and x004 must both be on, not off. You have them off and are expecting a green light. The whole purpose of your exercise are that when x003 and x004 are both ON, that's a good state. When X003 is OFF that's a red light. When X004 is off that's a yellow light.
 
You are fundamentally misunderstanding. For green light, x003 and x004 must both be on, not off. You have them off and are expecting a green light. The whole purpose of your exercise are that when x003 and x004 are both ON, that's a good state. When X003 is OFF that's a red light. When X004 is off that's a yellow light.
OK, so the original setup was as below:
1730548953644.png


The new setup needs to be:
1730548231699.png

Therefore if PLC or relays fail then the relay will de-energise and provide power to the RED light and illuminate, providing a warning as a fail safe.

In the new setup:
X003 = TRUE = NO ALARM, however output Y001 is not active, therefore it would not be energising the relay. I want the output to energise the relay in a GOOD condition and when in BAD (ALARM) it will denergise the relay (or a failure of the PLC or relay would also denergise the relay causing an ALARM which would need to be investigated).

I dont believe the current setup gives me this? X003 = FALSE (ALARM state) energises the RED light which is the wrong way round, it should denergise.

1730548840194.png

Simulator - Sim
 

Attachments

  • 1730548185207.png
    1730548185207.png
    49.8 KB · Views: 6
In regards to the relay being held on in a good state, your first four rungs accomplish this. You would change the actual Ys in logic to intermediate bits, and the first four rungs would be your Ys, invert the state and turn off the output. I assumed you knew this and the reason you added those four rungs.

And you changed the first four rungs....they should be as you had them before. NC Y = OUTPUT. When I said earlier that your Yellow rung was wrong, I did not mean for you to change the first four rungs. I said that in all your normal logic, do not invert anything but X003 and X004. The first four rungs need to Invert the state of your lights if you are changing all relays to NC.
 
Last edited:
Look up De Morgan's Laws (see e.g. here).

TL;DR

Ladder relay logic is Boolean logic.

Boolean logic has only three operators: AND; OR ; NOT.

In ladder relay logic
  • A binary Boolean AND is implemented as two contacts in series on a rung or branch
  • A binary Boolean OR is implemented as two contact in parallel branches
  • A unary Boolean NOT is implemented by inverting the sense of a contact i.e. -] [- Normally Open Contactvs. -]/[- Normal Closed contact.
Boolean AND and OR operations are associative, so more than two elements ANDed or ORed together are implemented by extending the series or parallel constructions.

All of that to get to statement: if you want to invert the sense of a compound Boolean expression in ladder logic, look up De Morgan's Laws.
 
In regards to the relay being held on in a good state, your first four rungs accomplish this. You would change the actual Ys in logic to intermediate bits, and the first four rungs would be your Ys, invert the state and turn off the output. I assumed you knew this and the reason you added those four rungs.

And you changed the first four rungs....they should be as you had them before. NC Y = OUTPUT. When I said earlier that your Yellow rung was wrong, I did not mean for you to change the first four rungs. I said that in all your normal logic, do not invert anything but X003 and X004. The first four rungs need to Invert the state of your lights if you are changing all relays to NC.
thanks for your help, I think my brain just went into meltdown with overthinking it. But it now makes sense (I think!). I'll revisit it again tomorrow once the brain fog has cleared to make sure I comprehend it.
Thanks again, greatly appreciated.
 
OK, so the original setup was as below:
  • [picture of two PLC states:
    1) If X003 input switch is closed, Y001 output should be closed;
    2) if X003 input switch is open, then Y001 output switch should be closed]
The new setup needs to be:

  • [picture of two PLC states:
    1) If X003 input switch is open, Y001 output should be open;
    2) if X003 input switch is closed, then Y001 output switch should be closed]
I.e. the Y001 output should be the same as the X003 input. So why does the PLC logic need to change?

Caveat: I have had a busy morning and have not read this thread in detail; so consider this a typical Internet thread post and feel free to ignore it.
 
I.e. the Y001 output should be the same as the X003 input. So why does the PLC logic need to change?

Caveat: I have had a busy morning and have not read this thread in detail; so consider this a typical Internet thread post and feel free to ignore it.
Because I believe he's using the state of the Y Input in other logic. It was easier to just invert the inputs in every instance, and change the real outputs to intermediate bits everywhere, then invert the intermediate bit for the output. It wasn't clear if the blue and green lights and relays were changing also, but it's easy to just invert the states driving the relays based on what's needed without having to fundamentally change the logic.
 
In Post #1, is that image the original logic, or is it an attempt at the updated logic?

Because if it is the original logic, then I think rung 1 has a problem.

However, if it is the updated logic, then it should be fine: if either switch input X003 opens (PLC internal X003 bit value is 0) or a watchdog times out (PLC internal bit WD_AlarmState value is 1), then Rung 1 will write a 0 value to Y001, so Alarm 1/Red turns on
 
Last edited:

Similar Topics

Hello guy, I need to change out a slc 5/04 processor. I have a new processor to replace the old, it is a 1747-L542 Ser B 32k memory OS401. The...
Replies
7
Views
5,160
Hi guys, I'm on a remote mine site and I've got a connectivity issue with my HMIGTO5310 coming up with "Failed to open connection to PLC...
Replies
18
Views
265
We are using a Siemens S7-1500 PLC, and I need to monitor the status of an input card to detect if it loses communication or if there's an issue...
Replies
6
Views
198
Hello, I have a IFM PN 7294 pressure sensor plugged into a Balluff BNI006A port. I have no idea what this manual is trying to tell me here to sort...
Replies
1
Views
87
Hello, I’m trying to connect a Control Techniques MaxAx 100 drive to a brushless motor for testing purposes. I found the manual here: MaxAx 100...
Replies
0
Views
89
Back
Top Bottom