The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: X10 scripting in HAL




More questions coming up...

1) Is there a possibility to pass multiple parameters to a triggered sub ?
Here is a piece of the code:

Const MAXVERIFYTRIES = 2
Const WAITFORRETRYSECS = 15

'sort of recursion: event added in the procedure points to itself
sub VerifySuccessState(device, state, trycount)
if x10.attrib(device,X10_STATE) <> state then
if trycount < MAXVERIFYTRIES then  'try again
call SendX10(device, state)
trycount = trycount + 1
call sys.singleevent(DateAdd("s", WAITFORRETRYSECS,Now),
_ "VerifySuccessState", "X_X_X",
"VerifyState")
else  'too many tries, no success
Call LogIt(device & " not set to state " & state &
" after " &
trycount & " tries",2)
end if
else  'success!
if trycount>0 then  'but had retries
Call LogIt(device & " set to state " & state & "
after " &
trycount & " tries", 1)
end if
end if
end sub

What do I replace "X_X_X" with ??


2) What is the granularity of time the scheduler handles ?  Can I set
the execution time to something like now + 15 secs ?

Thanks,
Tom
(btw, HAL is cool :-)


xPL Links: http://www.xplproject.org.uk http://www.xplhal.com http://www.xpl.myby.co.uk
To Post a Message: ukha_xpl@xxxxxxx
To Subscribe:  ukha_xpl-subscribe@xxxxxxx
To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx

xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.