defcon.klaxon
Lifetime Supporting Member
EDIT: Sorry for the typo in the title, it should say "via MSG"
Hi guys,
I've come up against something that is likely simple to take care of, but I'm having a hard time wrapping my head around the necessary logic.
Basically, I have a remote PLC (CompactLogix) controlling well sites. All the control logic is done at the remote sites, and a "master" PLC polls each site; the master PLC is responsible for interacting with the HMI (InTouch). I have it set up so that I use four MSG instructions for each site; the master PLC sends an array of DINTs, then an array of REALs; then receives an array of DINTs, then REALs.
The problem I'm encountering is with the idea of Alarm Reset. All the alarms at the remote site latch, so they have to be manually cleared via local control panel pushbutton, or an HMI button. The problem I'm encountering is, let's say I set the alarm reset bit high with a button in InTouch:
1. Alarm_Reset bit is now high at the "master" PLC.
2. Alarm_Reset bit is sent to remote site.
3. Alarm_Reset resets the alarm, then remote site resets Alarm_Reset bit.
4. Alarm_Reset needs to be reset at "master" PLC.
The problem is with step 4; I can only allow Alarm_Reset to go back low at the master PLC after the actual reset occurs; otherwise, I'd be over-riding the master PLC every time it polled the site because I'm sending all the data with every poll cycle.
Such a simple task proves devilishly difficult to gracefully implement; I think the solution is going to involve some sort of rising/falling edge detection and/or one shots but this feels like it's getting pretty complicated, and as I'm learning more and more about programming PLCs it seems like there's usually a graceful way of doing things that you don't know until you have the experience, hence me asking how you guys would tackle this problem. I'm going to keep working on trying to find a solution but I'd love to hear your opinions. Thanks a bunch!
Hi guys,
I've come up against something that is likely simple to take care of, but I'm having a hard time wrapping my head around the necessary logic.
Basically, I have a remote PLC (CompactLogix) controlling well sites. All the control logic is done at the remote sites, and a "master" PLC polls each site; the master PLC is responsible for interacting with the HMI (InTouch). I have it set up so that I use four MSG instructions for each site; the master PLC sends an array of DINTs, then an array of REALs; then receives an array of DINTs, then REALs.
The problem I'm encountering is with the idea of Alarm Reset. All the alarms at the remote site latch, so they have to be manually cleared via local control panel pushbutton, or an HMI button. The problem I'm encountering is, let's say I set the alarm reset bit high with a button in InTouch:
1. Alarm_Reset bit is now high at the "master" PLC.
2. Alarm_Reset bit is sent to remote site.
3. Alarm_Reset resets the alarm, then remote site resets Alarm_Reset bit.
4. Alarm_Reset needs to be reset at "master" PLC.
The problem is with step 4; I can only allow Alarm_Reset to go back low at the master PLC after the actual reset occurs; otherwise, I'd be over-riding the master PLC every time it polled the site because I'm sending all the data with every poll cycle.
Such a simple task proves devilishly difficult to gracefully implement; I think the solution is going to involve some sort of rising/falling edge detection and/or one shots but this feels like it's getting pretty complicated, and as I'm learning more and more about programming PLCs it seems like there's usually a graceful way of doing things that you don't know until you have the experience, hence me asking how you guys would tackle this problem. I'm going to keep working on trying to find a solution but I'd love to hear your opinions. Thanks a bunch!