An assembly process.
Lets say I have multiple stations... there is an error in the first station and I want the behavior of the next stations to change because of it.
Fine... I can create an error bit based on some conditions and use this bit in the next program steps and stations to alter the normal flow. Do some of the things like during normal flow but not others.
The problem is that it gets messy. There is the normal behavior and a completely different behavior and they exist together in the same networks... logic in the same networks increase and the complexity increases exponentially.
Is there a good "best practice" method to keep things nice and clean?
Taavi, great question! There are a number of ways to proceed, but this one seems to work well, is scale-able, and does not become too much more complex as the system grows.
The best way to do this is to designate one PLC (or other type of CPU) as the Master Alarm Station. In each of the many CPU's used for control, set aside a long integer (or multiple integers) that will represent the alarms for that particular CPU, one bit per alarm. So, a single DINT would represent up to 32 alarms. Also, set aside another DINT (or more) to receive commands from the master alarm station.
Then, in the master alarm station, read the alarm word(s) from each of the individual CPU's. Then, in the Master Alarm Station, provide any logic necessary to develop bits for instructing individual stations on what action to take.
For example, if the infeed conveyor belt faults, Station 2 Alarm Word 1 Bit 4 is set, and the Master Alarm Station will read this alarm status when it reads the alarm word from that station. Then, based on any applicable logic, the Master Alarm Station may set Alarm Command Word 1 Bit 2, instructing Station 3, the next operation downstream to go to a HOLD condition.
In this manner, the complexity of what to do is handled by an external station. That way, only the Master Alarm Station needs to know the alarm status in each station, rather than trying to cross-communicate among multiple stations. The Master Alarm Station also gives the abnormal state commands, freeing the individual stations to concentrate on control of their local equipment.