Hi,
I was hoping to get some feedback on the AE engine and creating some simple
output timers based upon energizing outputs based on time of day. I can
already set the RTC from the HOST and it resets at midnight, so the RTC
represents seconds since midnight.
This is what I am trying to achieve on the stack
IF RTC > ON_TIME and RTC <(ON-TIME+DURATION)
then DUTY1,0
else DUTY1,10001
This is some rough code I thought I could use however not tested, I wanted
to know if I was on the correct track and if the stack can handle maths
results that go negative.
// ON / OFF TIMES (Seconds)
// L_UserN ON time for Relay1 Seconds since Midnight
// W_UserL Duration for PIO Duration for relay ON time, seconds
relay1_ctl:
CMP.L L_RTC,L_USERL
BLE relay1_off
PUSH.L L_RTC //Get time since midnight
PUSH.L L_USERN // get user ON time in seconds since midnight
SUB // Find out how many seconds difference
between RTC and on time
CMP.W @-1, W_USERL // See if difference is less than Duration, if so
the output should be ON
BGR relay_off
BLE relay_on
END
relay1_on
SET.W W_DUTY1,0
BRA Relay2_ctl
Relay1_off
SET.W W_DUTY1,10001
BRA Relay2_ctl
relay2_ctl:
~ code similar to relay 1
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers