Time Delay for Alarm in Ladder Logic

defcon.klaxon

Lifetime Supporting Member
Join Date
Feb 2015
Location
Far NorCal
Posts
616
Hi guys,

I'm new to PLC programming and I'm trying to figure out the best way to take a program originally written in FIX 7.0 and translate it to ladder logic (specifically, a Function Block Diagram in ISaGRAF from ICLinks). The problem I'm facing is that the original FIX program relies on functionality that doesn't have a direct correlation in ladder logic.

So here's the basic gist of the program I'm trying to work on: there is an alarm that activates when a well pump is in local control; unfortunately there is no actual "local control bit" so the program implies local control by looking at a "pump running bit" (feedback from the remote site) and a "pump command bit" (command from master controller); if the pump is running and there's no run command after ten seconds, then it must be in local mode and conversely, if the pump isn't running after ten seconds but it's been given a run command, it's also in local mode...now I know this assumes a lot (namely, no failures) but it's an existing system that we're working with, so we're just trying to interface with it at this point.

The functionality I'm trying to figure out is, how would one tackle the challenge of creating the time delay functionality in ladder logic (which is continually running the rungs)? The main problem I'm noticing is that the original program uses indefinite wait and goto commands, which are not supported in any of the languages ISaGRAF has (IEC 61131). I'm working on the problem here (I'm thinking it's going to be a solution comprised of NO, NC and COS contacts) but I'd love to see what the more experienced programmers would do. Any help is greatly appreciated and thanks for taking the time to reply.
Code:
If it's helpful, here is the original program I'm trying to replicate:

00 NUL
01 OPEN AWP-PMPNC / AWP-PMPNC is the local control alarm
02 IF AWP-PMPRS = 1.00 GOTO 11 /AWP-PMPRS is the "pump is running" feedback bit
03 MAXWAIT 0
04 WAITFOR AWP-PMPRS = 1.00
05 OPEN AWP-PMPNC
06 MAXWAIT 10
07 WAITFOR AWP-PMP = 1.00 /AWP-PMP is the "pump run command" bit
08 IF AWP-PMP = 1.00 GOTO 11
09 CLOSE AWP_PMPNC
10 NUL
11 MAXWAIT 0
12 WAITFOR AWP-PMPRS = 0.00
13 OPEN AWP-PMPNC
14 MAXWAIT 10
15 WAITFOR AWP-PMP = 0.00
16 IF AWP-PMP = 0.00 GOTO 3
17 CLOSE AWP-PMPNC
18 NUL
19 GOTO 3
 
Last edited:
Here's what I've come up with so far:

q6iVasM.png


The problem is that once the counter reaches ten, any change in logic will result in immediate alarm tripping; for example, on the top, if the pump is running and there is a pump command present, no alarm...but if the pump command goes away, it immediately trips...what I need is a ten second delay for that situation as well. Will continue to work on this, but thought I'd show what I had so far...seems to be close.
 
Try this:

Hey, thanks for the suggestion! I was actually one step behind you on this; I had the two contacts through an AND block that fed the counter, but when I looked at your response I realized that putting contacts in series is an automatic AND and my code was redundant. Cheers!
 

Similar Topics

I'm working from some spec documents that declare I must allow the operator to set an alarm delay for any alarm signal. I would like to use WW's...
Replies
2
Views
3,803
Build error occurs with TON ladder logic command. Time Input expected on block. Using Integer Tag under Control Local, and then hard number 19...
Replies
2
Views
757
I have an SLC 503 running a machine with a scanner and 1794 RIO. One of the functions is a register motor on a printing cylinder. The manual 3...
Replies
3
Views
1,275
Hello all, I am using a temposonic R series linear transducer for positioning of a lower ram on a hydraulic powdered metal press. The transducer...
Replies
7
Views
1,939
My first post so I am going to try my best.:D I am totally new to RSlogix 5000, all my previous work was on 500. I am working with a...
Replies
14
Views
5,565
Back
Top Bottom