defcon.klaxon
Lifetime Supporting Member
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.
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: