I haven't worked with PLC's for about ten years, but here's the way it worked back then.
Most PLC's used what was called Ladder Logic. The 'program' that the PLC runs is represented by an electrical schematic and is continuously executed from top to bottom. Inputs to the PLC are represented as control signals to the software relays. Scanning takes place as the program runs and when a change in a control signal takes place the event is recorded as soon as the PLC reaches the point in the program at which that signal lis utilized.
The PLC's that I worked with as a rule didn't have an interrupt in which subroutines would be executed when a signal change occurred. In many cases, it simply isn't necessary.
On a practical level, though I haven't actually worked with these, youi can use the model of a traffic signal control to see how a PLC works.
The program is continuously running. Timing is controlled by a software counter. At the start, the light is green in one direction and red in the other. Being late at night, traffic coordinators have determined that keeping the light continuously green in one direction is best as little traffic travels in the other direction, and lamps turning on and off reduces the life expectancy of the bulb.
At this time, the PLC is simply running a loop, looking for a change in the sensor which detects the presence of an automobile in the alternate direction. When it does so, it starts the routine to change the lamps. First a loop counter is started which changes the lamp in the active direction from green to yellow. When that counts down to zero, the lamp is changed from yellow to red, and the lamp in the other direction from red to green.... and so on.
Conditions generated from within the PLC, such as the results from counters are scanned in the same way as those from external sensors. They are all simply conditions. External sensors may have different hardware attached, but to the program are identical to internal conditions.
I hope this helps a little, and isn't too out of date.
2006-12-23 02:59:15
·
answer #1
·
answered by Deirdre H 7
·
0⤊
0⤋