ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#24280 - 12/10/15 03:01 PM My code doesn't work, WHY
poordom Offline
junior


Registered: 01/23/14
Posts: 46
https://www.facebook.com/photo.php?fbid=...&type=3&theater

Good evening All,

I have been working on the code, attached in the above indicated file, I just can't figure it out.

I am referring to Module 2, a Bobcat-L with the set parameters.

Parameter 2 = 150 for High Threshold
Parameter 3 = 115 for Low Threshold
Parameter 5 = 1 for analog reading.

HELP PLEASE.

Dom

Top
#24281 - 12/10/15 06:24 PM Re: My code doesn't work, WHY [Re: poordom]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
The link says that the content is not available.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#24282 - 12/11/15 07:19 AM Re: My code doesn't work, WHY [Re: Guy Lavoie]
poordom Offline
junior


Registered: 01/23/14
Posts: 46
Sorry Guy,

Here is a better site : http://tinypic.com/m/j97jmo/4

Thanks Guy

Dom

Top
#24283 - 12/11/15 11:26 AM Re: My code doesn't work, WHY [Re: poordom]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
You did not say exactly what it is that's not working...but I can see a problem with the lines where you are testing two static conditions and then sending X10 commands. This would cause it to send those X10 commands repeatedly over and over, appearing to jam the powerline with X10 commands. It would also restart the timer over and over.

If one condition always happens before the other then you can make the later one a "becomes" like this (example variable #7 becoming = 1):

IF Variable #4 = 1
AND Variable #7 becomes = 1
THEN (send X10...)
THEN (start timer...)

If either one can occur first (ie: if it's getting dark early or if it's 16:00) then you need to test for both possibilities and then set a flag to execute the commands only once by testing for the flag becoming set in separate statements and then immediately resetting the flag (ex Variable 99)
:

IF Variable #4 = 1
AND Variable #7 becomes = 1
THEN Varaible #99 = 1

IF Variable #7 = 1
AND Variable #4 becomes = 1
THEN Variable #99 = 1

IF Variable #99 becomes = 1
THEN (send X10...)
THEN (start timer...)
THEN Variable #99 = 0
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#24284 - 12/11/15 01:35 PM Re: My code doesn't work, WHY [Re: Guy Lavoie]
poordom Offline
junior


Registered: 01/23/14
Posts: 46
Thanks Guy,

What I am trying to achieve is to have the lights come on once the BOBCAT-L reading reaches <135, but have light only once the time reaches past 4:00 P.M.

So it is the combination of both conditions.

Dom

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 65 anonymous users online.
Recent Posts
Ocelot Battery
by ADI Tech Support
Today at 07:38 AM
Comms Retry Error
by HDTVPete
09/18/17 04:04 PM
Cmax Message: Failed to set data for a 'delay'
by HDTVPete
09/16/17 04:36 PM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4002 Topics
23435 Posts

Max Online: 132 @ 11/13/16 10:07 AM
September
Su M Tu W Th F Sa
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 30