#21429 - 10/12/09 04:45 PM
Glitch with "Time of Day" code in my program
|
GaryA
newbie
Registered: 10/12/09
Posts: 3
|
I'm a newbie to the Ocelot/X-10 programming world here in Australia. I have had some success with my C-Max program but have failed to get the "Time of Day" function to work. Some details up front: 1) Australia power supply operates under 240 Volts / 50 Hz. I bought my Ocelot in USA and Ocelot inside the box bears the number 58, 2)Firmware V8.31/58, Application V3.18, Code Editor V2.00e5 3) The following code operates fine apart from lines 10 to 12: 0001 - IF Module #1 -SECU16-I Input #0 Turns ON // 0002 - THEN X-10 House B / Unit 6, Turn ON // 0003 - THEN Timer #1 = 1 // 0004 - IF Timer #1 becomes > 5 // 0005 - THEN X-10 House B / Unit 14, Turn ON // 0006 - THEN Ocelot, Zone 0 IR IR #1 // 0007 - THEN Module #3 -SECU16-IR, IR Zone #9 IR IR #1 // 0008 - THEN Timer #1 = 0 // 0009 - // 0010 - IF Time of Day is > 20:00 // 0011 - AND Time of Day is < 22:00 // 0012 - THEN X-10 House B / Unit 14, Turn OFF // 0013 - // 0014 - // 0015 - IF Module #2 -BOBCAT-T is < 256 // 0016 - THEN Variable #1 = Data for Module# 2 // 0017 - THEN Variable #1 + 80 // 0018 - THEN Variable #1 - 32 // 0019 - THEN Variable #1 * 5 // 0020 - THEN Variable #1 / 9 // 0021 - THEN Variable #1 - 100 // 0022 - THEN Variable #2 = Variable #1 // 0023 - // 0024 - End Program //
Can anybody offer help? It will be much appreciated. PS: My computer is in time mode with AM and PM format (not military)
|
|
Top
|
|
|
|
#21432 - 10/12/09 11:27 PM
Re: Glitch with "Time of Day" code in my program
[Re: Guy Lavoie]
|
GaryA
newbie
Registered: 10/12/09
Posts: 3
|
Thanks for a speedy reply. I will experiment with your code tonight, BUT, my problem is also that my C-MAX Editor does not allow me a choice of "becomes > 20:00", but rather will only allow "becomes = 20:00". Why is that the case? Can I turn off the Control Wizard and enter code manually?? Yes, I am only trying to turn a light on or off to experiment with this piece of code that I cannot get to work. Also my sunrise/sunset time code does not work. I am hoping to operate my house lighting system to function at different modes depending on time of day - so desperately need this piece of code to work.
|
|
Top
|
|
|
|
#21436 - 10/13/09 09:16 PM
Re: Glitch with "Time of Day" code in my program
[Re: Guy Lavoie]
|
GaryA
newbie
Registered: 10/12/09
Posts: 3
|
Thanks Guy for your help. After you verified that the code should work I set about looking at other problems. You are right the problem was an INCORRECT time in the Ocelot. The Ocelot time was lagging by 8 hours, so each time I did a test for a time in a few minutes, I never got the expected result. Now that the Ocelot's time is equal to the Computer's time (real time) I get a favourable result with the code "Time of Day". That begs the question - Why did my Ocelot fall behind in time by 8 hours (Exactly 8 hours to the second). Is there a battery inside the Ocelot that needs changing regularly? Or maybe I have just discovered the reason while typing this message. I recall messing around with the "Comms Setup - Time Zone" to get my sunrise and sunset to mimmick correctly. I actually changed the Time Zone offset - Could explain the 8 hour diffeerence. I'm enjoying the learning experience and really appreciate your prompt assistance. Thanks a lot.
|
|
Top
|
|
|
|
Moderator: Dan Smith, Monte G, ADI Tech Support, Guy Lavoie
|
1 registered
(kuro)
and 21 anonymous users online.
|
|
2747 Members
19 Forums
3837 Topics
22714 Posts
Max Online: 67 @ 08/16/11 03:08 PM
|
|
|
|
|
|
1
|
2
|
3
|
4
|
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
|
28
|
29
|
|
|
|
|
|