^64 - The DALI Lux Level Port
This read only port contains the state of the lux Level on DALI sensors on a load controller. The value for each sensor is split between a low byte and a high byte.
Syntax
LDA ^64,x
Where x is the sensor low byte and x+1 is the high byte.
LDA ^64,0 will give the low byte of sensor 1
LDA ^64,1 will give the high byte of sensor 1
LDA ^64,2 will give the low byte of sensor 2
LDA ^64,3 will give the high byte of sensor 2
After sensor 1 the Lo byte subport is (SensorNum-1)*2
After sensor 1 the High byte subport is (SensorNum)*2+1
Example
Excerpt from a DALI Sensor Closed loop daylight holdoff switch task template.
#const ClosedLoopArea 8
#const DaylightSwitchLuxHI 0
#const DaylightSwitchLuxLO 200
Task1()
{
Name="Daylight Switch"
//Task is configured to start on motion and stop on no motion. Task stops itself when lights are switched on.
//Task reads lux port and calculates if lights should be set to preset 1 (on)
GetLuxSensor1:
LDA ^64,1 //Lux level Hi byte
CMP #DaylightSwitchLuxHI
BRZ HiByteEqualSensor1
BCC TooBrightSensor1 //Measured lux level higher than switch level
BRA Sensor1P1
HiByteEqualSensor1:
LDA ^64,0 //Lux level Lo byte
CMP #DaylightSwitchLuxLO
BCC TooBrightSensor1 //Measured lux level higher than switch level
BRA Sensor1P1
TooBrightSensor1:
delay(2)
BRA GetLuxSensor1
Sensor1P1:
Preset(a=ClosedLoopArea,p=1,f=2)
null
}