^51 - The Logical Channel Port
This is a read/write port for the logical channel number of a feature on a device.
For a load controller this will be the channel assignment of each output. For sensors and UIs it will be things like motion control, light control, native channel, and temperature channel.
Syntax
LDA ^51,x //loads from the channel value
STA ^51,x //writes to the channel value
Where x is the proxy channel index of the thing you want the logical channel of.
SubPort |
Load Controller |
Sensor |
UI |
^51,0 |
Output 1 |
Motion Channel |
Native Channel |
^51,1 |
Output 2 |
Primary Closed Loop Channel |
Proximity Sensor Channel |
^51,2 |
Output 3 |
Tertiary Closed Loop Channel |
|
^51,3 |
Output 4 |
Open Loop Channel |
|
^51,4 |
Output 5 |
IR Channel 1 |
Temperature Channel |
^51,5 |
Output 6 |
IR Channel 2 |
|
^51,6 |
Output 7 |
IR Channel 3 |
|
^51,7 |
Output 8 |
IR Channel 4 |
|
^51,8 |
Output 9 |
IR Channel 5 |
|
^51,9 |
Output 10 |
||
^51,n |
Output n-1 |
Examples
Example 1
This task updates the preset table on a DDC116 based on what channel it is assigned to via the sign on button.
Task1()
{
Name="Preset Update Task"
Delay=1
PresetUpdate:
LDA ^51,0 //Load the channel number
STA ~21 //Store to tilde memory 21.
CMP #1
BRZ CH1Screen //Is it the screen? (Channel 1)
CMP #6 //Is it the plugload? (Channel 6)
BRZ CH6PlugLoad //If not assume general lighting channel
/////////////////////////Channels 2-5//////////////////////////////////////////
//Here we load the message into some tilde locations so we can edit it and use the TX command to send it out.
Copy Msg_All_Zones_Preset5_Level_20,~0,7//Load and send Blind program level 20% to preset 5 (Av)
TX ~0,0,7 //Send to Dynet Mute to self program
Delay()
Copy Msg_All_Zones_Preset6_Level_10,~0,7//Load and send Blind program level 10% to preset 6 (Present)
TX ~0,0,7
Delay()
Copy Msg_All_Zones_Preset10_Level_10,~0,7//Load and send Blind program level 10% to preset 10 (AV Grace)
TX ~0,0,7
Delay()
Copy Msg_All_Zones_Preset11_Level_10,~0,7//Load and send Blind program level 10% to preset 11 (Present Grace)
TX ~0,0,7
Delay()
Copy Msg_All_Zones_Preset12_Level_0,~0,7//Load and send Blind program level 0% to preset 12 (Manual Off)
TX ~0,0,7
BRA ChannelCheck
CH1Screen:
//Here we load the message into some tilde locations so we can edit it and use the TX command to send it out.
Copy Msg_Zone1_Preset5_Level_0,~0,7 //Load and send Blind program level 0% to preset 5 (Av)
TX ~0,0,7 //Send to Dynet Mute to self program
Delay()
Copy Msg_Zone1_Preset6_Level_60,~0,7//Load and send Blind program level 60% to preset 6 (Present)
TX ~0,0,7
Delay()
Copy Msg_Zone1_Preset10_Level_0,~0,7//Load and send Blind program level 0% to preset 10 (AV Grace)
TX ~0,0,7
Delay()
Copy Msg_Zone1_Preset11_Level_20,~0,7//Load and send Blind program level 20% to preset 11 (Present Grace)
TX ~0,0,7
Delay()
Copy Msg_Zone1_Preset12_Level_0,~0,7//Load and send Blind program level 0% to preset 12 (Manual Off)
TX ~0,0,7
BRA ChannelCheck
///////////////////////////////////Plug Load//////////////////////////////////
CH6PlugLoad:
//Here we load the message into some tilde locations so we can edit it and use the TX command to send it out.
Copy Msg_Zone6_Preset5_Level_100,~0,7//Load and send Blind program level 100% to preset 5 (Av)
TX ~0,0,7 //Send to Dynet Mute to self program
Delay()
Copy Msg_Zone6_Preset10_Level_100,~0,7//Load and send Blind program level 100% to preset 10 (AV Grace)
TX ~0,0,7
Delay()
Copy Msg_Zone6_Preset12_Level_100,~0,7//Load and send Blind program level 100% to preset 12 (Manual Off)
TX ~0,0,7
ChannelCheck:
LDA ^51,0 //Load the channel number
CMP ~21 //Compare to the previous channel number
BNE PresetUpdate //If different go update the preset values
Delay(1) //If the same delay 1 second
BRA ChannelCheck //And check again
Null
}
Example 2
This task changes the channel of an output to exclude it from DH.
{
Name="DH Excluder"
LDA ~3 //Load the preset byte
BRZ DH_Enabled //If in preset 1, all on, add the output back into DH
LDA #5 //Load channel 5
STA ^51,5 //Store it as the new channel for output 4.
Null
DH_Enabled:
LDA #1 //Load channel 1
STA ^51,5 //Store it as the new channel for output 4.
Null
}