Actions

Difference between revisions of "Inputs as Key Matrix (ICX-AlphaCom)"

From Zenitel Wiki

(Created page with "{{AI}} ===Use Inputs As Key Matrix=== If there is a need for more than the 6 inputs available, it is possible to combine inputs in a diode matrix and use the Event Handler to...")
 
Line 7: Line 7:
  
 
*2 Inputs (input 1-2, Virtual Inputs 1-3)
 
*2 Inputs (input 1-2, Virtual Inputs 1-3)
{| border="1" {{table}}
+
{| border="1"
 
| align="center" style="background:#ffd400;"|'''Input 2'''
 
| align="center" style="background:#ffd400;"|'''Input 2'''
 
| align="center" style="background:#ffd400;"|'''Input 1'''
 
| align="center" style="background:#ffd400;"|'''Input 1'''
Line 25: Line 25:
 
*3 Inputs (input 1-3, Virtual Inputs 1-7):
 
*3 Inputs (input 1-3, Virtual Inputs 1-7):
 
[[File:IO as matrix ICX.jpg|thumb|right|500px|Diode matrix when using 3 inputs to activate 7 DAK keys]]  
 
[[File:IO as matrix ICX.jpg|thumb|right|500px|Diode matrix when using 3 inputs to activate 7 DAK keys]]  
{| border="1" {{table}}
+
{| border="1"  
 
| align="center" style="background:#ffd400;"|'''Input 3'''
 
| align="center" style="background:#ffd400;"|'''Input 3'''
 
| align="center" style="background:#ffd400;"|'''Input 2'''
 
| align="center" style="background:#ffd400;"|'''Input 2'''
Line 50: Line 50:
  
 
*4 Inputs (input 1-4, Virtual Input 1-15):
 
*4 Inputs (input 1-4, Virtual Input 1-15):
{| border="1" {{table}}
+
{| border="1"  
 
| align="center" style="background:#ffd400;"|'''Input 4'''
 
| align="center" style="background:#ffd400;"|'''Input 4'''
 
| align="center" style="background:#ffd400;"|'''Input 3'''
 
| align="center" style="background:#ffd400;"|'''Input 3'''
Line 101: Line 101:
 
[[File:ICX_Matrix1.PNG|thumb|left|500px]]
 
[[File:ICX_Matrix1.PNG|thumb|left|500px]]
 
<br style="clear:both;" />
 
<br style="clear:both;" />
 
+
{{Code2|
IF %op(%sev(1),=,1)<br>
+
IF %op(%sev(1),<nowiki>=</nowiki>,1)
 
!Input 1<BR>
 
!Input 1<BR>
WUDD %1.PHY %op(%udd(%1.PHY),+,1)<br>
+
WUDD %1.PHY %op(%udd(%1.PHY),<nowiki>+</nowiki>,1)<br>
 
ENDIF<br>
 
ENDIF<br>
IF %op(%sev(1),=,2)<br>
+
IF %op(%sev(1),<nowiki>=</nowiki>,2)<br>
 
!Input 2<br>
 
!Input 2<br>
WUDD %1.PHY %op(%udd(%1.PHY),+,2)<br>
+
WUDD %1.PHY %op(%udd(%1.PHY),<nowiki>+</nowiki>,2)<br>
 
ENDIF<br>
 
ENDIF<br>
IF %op(%sev(1),=,3)<br>
+
IF %op(%sev(1),<nowiki>=</nowiki>,3)<br>
 
!Input 3<br>
 
!Input 3<br>
WUDD %1.PHY %op(%udd(%1.PHY),+,4)<br>
+
WUDD %1.PHY %op(%udd(%1.PHY),<nowiki>+</nowiki>,4)<br>
 
ENDIF<br>
 
ENDIF<br>
IF %op(%sev(1),=,4)<br>
+
IF %op(%sev(1),<nowiki>=</nowiki>,4)<br>
 
!Input 4<br>
 
!Input 4<br>
WUDD %1.PHY %op(%udd(%1.PHY),+,8)<br>
+
WUDD %1.PHY %op(%udd(%1.PHY),<nowiki>+</nowiki>,8)<br>
 
ENDIF<br>
 
ENDIF<br>
 +
}}
  
 
==On button release==
 
==On button release==

Revision as of 11:10, 9 February 2023

AI.png

Use Inputs As Key Matrix

If there is a need for more than the 6 inputs available, it is possible to combine inputs in a diode matrix and use the Event Handler to process. By for example using 3 physical inputs it is possible to get 7 virtual inputs.

The different options are:

  • 2 Inputs (input 1-2, Virtual Inputs 1-3)
Input 2 Input 1 Virtual Input triggered
0 1 Virtual Input 1
1 0 Virtual Input 2
1 1 Virtual Input 3
0 0 Inputs released


  • 3 Inputs (input 1-3, Virtual Inputs 1-7):
Diode matrix when using 3 inputs to activate 7 DAK keys
Input 3 Input 2 Input 1 Virtual Input triggered
0 0 1 Virtual Input 1
0 1 0 Virtual Input 2
0 1 1 Virtual Input 3
1 0 0 Virtual Input 4
1 0 1 Virtual Input 5
1 1 0 Virtual Input 6
1 1 1 Virtual Input 7
0 0 0 Inputs released


  • 4 Inputs (input 1-4, Virtual Input 1-15):
Input 4 Input 3 Input 2 Input 1 Virtual Input triggered
0 0 0 1 Virtual Input 1
0 0 1 0 Virtual Input 2
0 0 1 1 Virtual Input 3
0 1 0 0 Virtual Input 4
0 1 0 1 Virtual Input 5
0 1 1 0 Virtual Input 6
0 1 1 1 Virtual Input 7
1 0 0 0 Virtual Input 8
1 0 0 1 Virtual Input 9
1 0 1 0 Virtual Input 10
1 0 1 1 Virtual Input 11
1 1 0 0 Virtual Input 12
1 1 0 1 Virtual Input 13
1 1 1 0 Virtual Input 14
1 1 1 1 Virtual Input 15
0 0 0 0 Inputs released

The Virtual Input actions are configured from the Event Handler.

Events

2 events are required to process inputs as a matrix. Shown below are the events required for 15 inputs (2^4). You can expand this to 63 inputs (2^6) if required.

On button press

Here, we use the serial nature of the Event Handler to process the individual inputs.
By assigning a bitwise value to the input, we can add this value to a UDD associated with the physical number.
As each successive input is processed by the event handler, a total sum is derived.

ICX Matrix1.PNG


Action commands:

IF %op(%sev(1),=,1) !Input 1
WUDD %1.PHY %op(%udd(%1.PHY),+,1)
ENDIF
IF %op(%sev(1),=,2)
!Input 2
WUDD %1.PHY %op(%udd(%1.PHY),+,2)
ENDIF
IF %op(%sev(1),=,3)
!Input 3
WUDD %1.PHY %op(%udd(%1.PHY),+,4)
ENDIF
IF %op(%sev(1),=,4)
!Input 4
WUDD %1.PHY %op(%udd(%1.PHY),+,8)
ENDIF


On button release

Here, we again rely on the serial processing of the input release.
First we check if the UDD has a value other than 0.
Then we check the value of the UDD and process the required command. This can be a $DD, $DIAL_DAK, $SM or any other DP command.
After the first round of processing, the UDD is returned to 0 so that successive input release commands do not execute.

ICX Matrix2.PNG


IF %udd(%1.phy)
IF %op(%udd(%1.phy),=,1)
!Virtual Input 1
$DD L%1.DIR L101
ENDIF
IF %op(%udd(%1.phy),=,2)
!Virtual Input 2
$DD L%1.DIR L102
ENDIF
IF %op(%udd(%1.phy),=,3)
!Virtual Input 3
$DD L%1.DIR L103
ENDIF
IF %op(%udd(%1.phy),=,4)
!Virtual Input 4
$DD L%1.DIR L104
ENDIF
IF %op(%udd(%1.phy),=,5)
!Virtual Input 5
$DD L%1.DIR L105
ENDIF
IF %op(%udd(%1.phy),=,6)
!Virtual Input 6
$DD L%1.DIR L106
ENDIF
IF %op(%udd(%1.phy),=,7)
!Virtual Input 7
$DD L%1.DIR L107
ENDIF
IF %op(%udd(%1.phy),=,8)
!Virtual Input 8
$DD L%1.DIR L108
ENDIF
IF %op(%udd(%1.phy),=,9)
!Virtual Input 9
$DD L%1.DIR L109
ENDIF
IF %op(%udd(%1.phy),=,10)
!Virtual Input 10
$DD L%1.DIR L110
ENDIF
IF %op(%udd(%1.phy),=,11)
!Virtual Input 11
$DD L%1.DIR L111
ENDIF
IF %op(%udd(%1.phy),=,12)
!Virtual Input 12
$DD L%1.DIR L112
ENDIF
IF %op(%udd(%1.phy),=,13)
!Virtual Input 13
$DD L%1.DIR L113
ENDIF
IF %op(%udd(%1.phy),=,14)
!Virtual Input 14
$DD L%1.DIR L114
ENDIF
IF %op(%udd(%1.phy),=,15)
!Virtual Input 15
$DD L%1.DIR L115
ENDIF
WUDD %1.phy 0
ENDIF