J
J Danforth
I felt mildly embarrassed when I came accross this little question in an application that needs to examine a series of about 40 pushbuttons on an
operator interface panel. There is not enough space on the touch screen to add 40 more buttons for separate on / off control, and the program in the PLC has to be fairly fast, so I was disinclined from adding a whole bunch of logic to
examine each one separately.
What I came up with, that works like a charm, is a scheme in which a counter is incremented each program scan, and the counter value is used to build an indirect address to examine the state of each button in turn. And the toggling? The word value of the buttons is meshed through a bitwise exclusive OR with the word value of the pilot lights. I don't think I could make it short enough to be elegant for a single button, but it sure works nice when there are lots of them.
J Danforth
KVA Induction, Inc.
operator interface panel. There is not enough space on the touch screen to add 40 more buttons for separate on / off control, and the program in the PLC has to be fairly fast, so I was disinclined from adding a whole bunch of logic to
examine each one separately.
What I came up with, that works like a charm, is a scheme in which a counter is incremented each program scan, and the counter value is used to build an indirect address to examine the state of each button in turn. And the toggling? The word value of the buttons is meshed through a bitwise exclusive OR with the word value of the pilot lights. I don't think I could make it short enough to be elegant for a single button, but it sure works nice when there are lots of them.
J Danforth
KVA Induction, Inc.