help with plc coding....

so what are the different sections called in the main part? Branches?

If you mean the additional space for example

Code:
  goto testmail
					    <--- this blank line
dry:

They are only there to show logical breaks in the code. Just be careful though, there's only one case (and this is the one) where it's not actually "linear code". All the others are actually part of conditional execution - where an instruction is either skipped (test result) or conditionally branched around.

This is where I find flowcharting to be particularly helpful. I didn't bother with yours as it is sufficiently simple its easy to remember what its doing, but I have others like this one http://support.rossw.net/tomw/webctl-tracker-flowchart.pdf that would be unmaintainable without a flowchart :)
 
Rossw thanks for your help, could you help me with this?

could you break up the code so that if it detects a leak on IP1 it will send its own email? That is a floor drain while the other are simply monitoring rubber pipe couplers that might leak. If the sensor on IP1 goes off its 10x worse than IP2, IP3, IP4.

thanks.
 
Perhaps you need a more precise description of what you want to achieve?
Scenario: you have a small, insignificant leak on input 2. So you've turned the valve off.... but then input 1 goes off.
You can't turn the water off any "more". Do you generate another email alarm?

Do you generate one email whenever you get a "higher priority" alarm? Ie, if ip3 is active you generate an alarm email. If ip4 then goes off, you ignore it, but if ip2 goes off you generate another alarm?

Simply generating an alarm email whenever ANY input goes off, regardless, is easy enough - but could get irritating.
Or do you just send an email for the first alarm and ignore any more until the system has reset?
 
Perhaps you need a more precise description of what you want to achieve?
Scenario: you have a small, insignificant leak on input 2. So you've turned the valve off.... but then input 1 goes off.
You can't turn the water off any "more". Do you generate another email alarm?

Do you generate one email whenever you get a "higher priority" alarm? Ie, if ip3 is active you generate an alarm email. If ip4 then goes off, you ignore it, but if ip2 goes off you generate another alarm?

Simply generating an alarm email whenever ANY input goes off, regardless, is easy enough - but could get irritating.
Or do you just send an email for the first alarm and ignore any more until the system has reset?

They should all ignore any triggers until reset.

I want it to ignore anymore triggers until it is reset except the following situation:

IP2 (or ip3 or ip4) goes off so it shuts the valve and sends the e-mail. Then IP1 Trips. I want it to send an e-mail then since this is a potential disaster (sewer overflow = bad lol). then not send another until the valve resets.
 
Back
Top