^14 - The Box Number Port
The Box Number port (^14,0) is a read/write value storing the box number of the device. This can be useful if you want to use the same task in multiple devices and have a unique value in each of them or to retrieve the box number for use in 0x5c Physical messages like page change commands.
Syntax
LDA ^14,x //Loads the box number
STA ^14,0 //Changes the device’s box number to the value in the accumulator
Examples
Example 1
This task uses the box number as a delay in seconds to prevent devices from all responding at once.
StartTask()
{
LDA ^14,0 // get Box number
STA ~0 //Store to ~0
Loop:
BRZ RequestSend //Is it 0?
Delay(1) //Delay 1 sec
DEC //Reduce it by 1
BRA Loop //Go check again
RequestSend:
DyNet(0x1C,SensorArea,0x00,0x63,0x00,0x00,0xFF) //Request Current Preset
}
Example 2
This task DyNet mutes a 5c message at the Antumbra Display to change the display page without network traffic.
#const HomePage 1 //Page number of Antumbra Display for the home page
SendPage: DyNet(0x5C,0xFD,0x00,0x62,0x00,0x00,0x00) //go to page
Task1()
{
Name="Return to HomePage"
Copy SendPage,~40,7 //Here we load the message into some tilde locations so we can edit it and use the TX command to send it out.
LDA ^14,0 //get Box number
STA ~42 //Store to the box number slot in our SendPage command
LDA #HomePage //Load home page number
STA ~46 //Store into our SendPage command
TX ~40,0,7 //Send to Dynet Mute to reduce network spam
}