Allen Nelson
Member
Greg:
I like that. Much cleaner than mine. Let me see if I'm undertanding you:
Each alarm has a register (in a contiguous array) that is either
"Zero" or "Message Number". Your 'message handler' searches through
the array (by incrementing a pointer once per scan). If it finds a
non-zero number, the pointer dwells at that register for a timer, and
then resumes searching.
Translating it into AB, for cousin Eric (not that he needs it -
I just enjoy doing this ladder stuff):
That last line I found I needed to add when I went to test the code.
You could clear the message on some other event (like timer done),
but then you get a 'blip' between message. If the LOW bits are
contiguous, that line can be simplified.
I also noticed a typo in my orginial code. The bits on the last rung
which check to see if the alarm is no longer valid should be -|/|-,
not -| |-.
I like that. Much cleaner than mine. Let me see if I'm undertanding you:
Each alarm has a register (in a contiguous array) that is either
"Zero" or "Message Number". Your 'message handler' searches through
the array (by incrementing a pointer once per scan). If it finds a
non-zero number, the pointer dwells at that register for a timer, and
then resumes searching.
Translating it into AB, for cousin Eric (not that he needs it -
I just enjoy doing this ladder stuff):
LANE 1
IS LOW +--- MOV -+
----+----| |-------| 1 |
| | N7:51 |
| LANE 1 +---------+
| IS LOW +--- MOV -+
+----|/|----- | 0 |
| N7:51 |
+---------+
LANE 2
IS LOW +--- MOV -+
----+----| |-------| 2 |
| | N7:52 |
| LANE 2 +---------+
| IS LOW +--- MOV -+
+----|/|----- | 0 |
| N7:52 |
+---------+
Duplicated 2 more times, for N7:53 & :54
STILL USING INDEXED ADDRESSING BECAUSE MICROLOGIX 1000 DOESN'T SUPPORT INDIRECT
+--- MOV -+
------| N60:0 |
| S:24 |
+---------+
MOVE THE POINTED TO REGISTER INTO THE MESSAGE REGISTER (N7:50)
CURRENT
MESSAGE
+--- NEQ -+ +--- MOV -+
---| #N7:50 |-------| #N7:50 |
| 0 | | N7:50 |
+---------+ +---------+
MESSAGE TIMER. NOTE THAT THE INDIRECT MESSAGE IS CHECKED.
MESSAGE
TIMER
+--- NEQ -+ T4:10/DN +--- TON -+
---| #N7:50 |------|/|------| T4:10 |
| 0 | | 5 SEC |
+---------+ +---------+
INCREMENT THE POINTER
CURRENT
MESSAGE POINTER
+--- EQU -| +---- ADD -+
---+---| #N7:50 |---+---| N7:60 |
| | 0 | | | 1 |
| +---------+ | | N7:60 |
| | +----------+
| MESSAGE TIMER |
| T4:10/DN |
+------| |--------+
WHEN THE POINTER GETS TO THE END, RESET IT
POINTER POINTER
+--- GEQ -| +---- MOV -+
----| N7:60 |-----| 1 |
| 0 | | N7:60 |
+---------+ +----------+
IF THERE ARE NO ERROR, CLEAR THE MESSAGE
LANE 1 LANE 2 LANE 3 LANE 4
IS LOW IS LOW IS LOW IS LOW +--- MOV -+
---|/|-----|/|-----|/|-----|/|-----| 0 |
| N7:50 |
+---------+
That last line I found I needed to add when I went to test the code.
You could clear the message on some other event (like timer done),
but then you get a 'blip' between message. If the LOW bits are
contiguous, that line can be simplified.
I also noticed a typo in my orginial code. The bits on the last rung
which check to see if the alarm is no longer valid should be -|/|-,
not -| |-.