#13337 - 03/04/03 02:44 PM
Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
For about a year now my system is an Ocelot running 1.70j at the main panel,and SECU16I in the garage, an RCS X10 thermostat, and a bunch of X10 dimmers,switches and chimes. Everything was working fine until I added a SECU16 next to the ocelot. I auto addressed the new module as #2 with module 1 disconnected as per the ADI ap note. Everything seemed fine til I noticed that the outdoor lights were coming on too soon. The code for them is: If timeofday > sunset+0 And module 1 parameter 10 < 25 Then variable #2 = 1 If variable #2 becomes = 1 Then X10 on commands A homebrew light sensor is connected to input 0 {Par 10} of the SECU16I {mod 1}. When I fired up CMAX to check the analog input, parameter 10 came back with readings of about 250 which matched the 4.95v I measured which matched the amount of daylight. Yet the code was setting var #2. I have tried: 1 Reloading the program 2 Reloading the executive 3 re autoaddressing both modules 4 disconnecting the new module 5 putting the light sensor on a different input 6 replacing the light with a 3V battery 7 Running just a simple program which sets variable #2 if module 1 parameter 10 is less than 25. Nothing has fixed what used to work.The rest of the inputs are supervised switches and motion detectors which are working fine.Retrieving the module parameter manually gives me good numbers. It just seems like the program isn't getting good data. Help!!!!
|
|
Top
|
|
|
|
#13339 - 03/04/03 04:16 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, The lights are coming on at sunset but before the light sensor reading falls below 25. The purpose of simple test 7 was to get the time out of the equation and avoid any other possible program bugs. When I ask CMAX to retrieve parameters I never get numbers less than 25. They always match the input voltage. When I ran test 7 I had a battery in place of the light sensor with a voltage of 2.86V. The parameter retrieval showed parameter 10 to be consistently around 130. But even though this is higher than 25 the program still evaluated the line to be true and set variable #2 to 1. If I reset the variable to another number, the program changes it back to 1. This all used to work rock solid. Could the SECU16I have been altered during the autoaddress? Does the program get module parameters the same way the CMAX diagnostic does? Mike
|
|
Top
|
|
|
|
#13340 - 03/04/03 04:21 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, I had the Ocelot connected RS232 to an AHT24 to get X10 RF but I disconnected it when I started the troubleshooting and nothing helped. Mike
|
|
Top
|
|
|
|
#13341 - 03/04/03 04:21 PM
Re: Help with reading analog values
|
JC
journeyman
Registered: 02/12/03
Posts: 67
Loc: Mascouche, Quebec, Canada
|
Try using the LOAD DATA TO VARIABLE to see if the data being read by the program is the same as the parameter.
_________________________
Imagination is more important than knowledge. - Albert Einstein
|
|
Top
|
|
|
|
#13343 - 03/04/03 05:14 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
I ran the program with the variable increment and connected the battery to input0. The retrieved parameter 10 is a steady 141 but the incrementing variable shot up into the thousands in seconds. How does the load data to variable work?
|
|
Top
|
|
|
|
#13344 - 03/04/03 05:44 PM
Re: Help with reading analog values
|
Guy Lavoie
Beyond All Hope
   
Registered: 12/21/02
Posts: 6421
Loc: Montreal, QC, Canada
|
One thing: You're using a SECU16I with one input generating a voltage and the rest of the inputs are supervised, yet there is only one configuration jumper for each group of 8 inputs on the 16I. Is the first bank of 8 inputs jumpered for supervised operation? Just be careful sending a voltage source into an input configured for supervised mode, it could cause things to act up. I gather your "light sensor" is either a photoresistor or phototransistor, so it would be a current sink, not a source like a battery.
Have you tried the same thing but using one of the SECU16 inputs instead? These can be individually jumpered in this module. Better yet, try it again in the SECU16I but using an input that's in the upper group of 8, which will use the second analog mux chip in the module. If that works, then it could be a bad mux chip in the lower half. If it does look like a bad mux chip, try inverting the two chips and see if the problem moves with it.
Things to try...
Load Data to Variable copies the data of the last input test to the specified variable. For example, if you do:
IF Module# 1/ Parameter #10 >0 THEN Load data to Variable# 8 ELSE Load data to Variable# 8
Then the value of Parameter 10 will be copied to variable #8 whether it is greater then 0 or not (ie: always). You can then use the variable in math operations or whatever.
_________________________
"If you don't know what you're doing, do it neatly..."
|
|
Top
|
|
|
|
#13345 - 03/04/03 05:55 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, The first 8 inputs are jumpered for analog. The second 8 are jumpered for supervised. My light sensor is a photocell feeding an LM324 with the output clamped with a 5.1v zener. This allowed me to set the gain to get the volts per daylight I wanted. I am just baffled as to why it stopped working.
|
|
Top
|
|
|
|
#13346 - 03/04/03 06:03 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, I tried the load data to variable and the debug variables window shows the variable oscillating between 0 and 141 which is the correct value. So where are the zero's coming from?
|
|
Top
|
|
|
|
#13347 - 03/04/03 06:12 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Just to clarify the variable is mostly 141 with an occasional 0.
|
|
Top
|
|
|
|
#13350 - 03/04/03 06:24 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
The opamp circuit has its own 12VDC supply isolated from the SECU16I. For the purpose of the test going on right now a slightly worn 3V battery is supplying the 141 value in parameter 10 and the problem is still there with the random zero's.
|
|
Top
|
|
|
|
#13352 - 03/04/03 07:02 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, I swapped the chips and I'm still seeing the zero's.
|
|
Top
|
|
|
|
#13354 - 03/04/03 07:40 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, I'll try that tomorrow. Thanks for all your help.
|
|
Top
|
|
|
|
#13355 - 03/05/03 05:01 PM
Re: Help with reading analog values
|
Mike Chwojdak
journeyman
Registered: 01/15/03
Posts: 81
Loc: Rochester, NY
|
Guy, I hooked up a battery to input 7 of my SECU16 and ran the same tests as I did with the SECU16I and parameter reads are solid. So I guess this means I have a bad SECU16I module. Right about now I'd like ADI tech support to chime in and tell me what's wrong with it and how it can be fixed.
|
|
Top
|
|
|
|
Moderator: Dan Smith, Monte G, ADI Tech Support, Guy Lavoie
|
1 registered
(dasdasd)
and 17 anonymous users online.
|
|
2765 Members
19 Forums
3856 Topics
22808 Posts
Max Online: 67 @ 08/16/11 03:08 PM
|
|
|