Thanks for the reply Archangel,
In the beginning I looked at a lookup table but didn't know enough about using it so I went with the IF .. Then senario.
There are 20 slaves with 8 inputs on each. They send 000 thru 007 for the first card, 008 thru 015 for the second and so on. The Master then assigns the apartment number and based on the numbers and their grouping, sends the program to the appropriate display/printout routines. The first 160 apartment numbers are grouped by two buildings and then the second 160 numbers represent when the signal has been returned to normal and that gets the apartment number assigned then goes to a printout routine. I have a serial data line connected between the Master and a busy line that controls the traffic.
This is an alarm annunciator system that I built for my customer. There is one panel in the apartment lobby and another is in a nursing station in another building.
Here are a couple of examples:
If B7 = 065 then Apt = 509: goto DispAlarm1 (DispAlarm1 would be for the first building)
If B7 = 082 then Apt = 018: goto DispAlarm2 (DispAlarm2 would be for the second building)
If B7 = 163 then Apt = 107: goto PrntRestore (The PrntRestore routine simply time stamps the return to normal)
The first two types of lines would printout a time stamp showing which building and which apartment and the last line would printout the time and which apartment number has returned to normal meaning the reponder has reset the alarm switch. The Master panel also has a 4 x 20 display and a beeper that shows the alarm information for the office staff.
Bookmarks