readtemp 4, A ' reading is put into variable A
if A4 < 18 ' A4? I think that you really mean
if A < 18 ' not A4. Similarly when you test again later you are
' testing A4 instead of A
Hello,I would agree with Paix's analysis - it's the "A4" in the comparison cells.
"A4" is analogue input 4, not the variable "A" you have read the temperature into.
There's no reason I can see that the program should not be working. Perhaps re-enable debug and see what results you are getting in varA. You may think it's 24C but it could be the temperature as read by the DS18B20 is lower than that.
Has eclectic just caused confusion by posting one of his usual rather generic replies? It certainly sounds like it is now working. The problem that has been fixed was that the readtemp command wasn't executed again in the loop formed by the second decision cell so the old value would always be in that variable regardless of the actual temperature.I inserted a second ReadTemp & Debug. Now the set-up appears to be working.
Going back to post #2,
can you convert,
then re - post your code as BASIC.
Then, you may get more replies.
Sorry I can't help further on the Logicator.
The problem that has been fixed was that the readtemp command wasn't executed again in the loop formed by the second decision cell so the old value would always be in that variable regardless of the actual temperature.
The problem with flowcharting is that what's visible does not necessarily reflect what has actually been programmed into the flowchart cells. For example it's entirely possible for a comparison to show "A > B" when the code actually checks "C < D".How is coming into the Logicator forum and basically stating that you don't know and that you should convert it into BASIC supposed to be helpful?
Hello Everyone,Looking at the converted basic code that does not appear to be the problem. If it gets to Label_18 it then gets to Label_30 where the second READTEMP is, and after that either branches to Label_20, or back to Label_30 for another READTEMP.
If the problem has been fixed I am intrigued what the problem actually was.
I have now realised the code listing was for the altered and working code, not the original non-working code.
The problem with flowcharting is that what's visible does not necessarily reflect what has actually been programmed into the flowchart cells. For example it's entirely possible for a comparison to show "A > B" when the code actually checks "C < D".
Converting to Basic is a quick and easy way to get to what the code is actually doing. If eclectic had not asked for a Basic conversion then I would have or asked for the .plf file to check the conversion myself.
Yes - instead of comparing the ADC reading with the fixed values, you can compare it with other variables. Use two different variables for the comparisons and set the value of the variables to the temperatures you want.Now that the circuit is working, may I ask if any one can suggest, is it possible to manually adjust the temperature by a degree or two. Its set to come on at 18° & go off at 20°. I know that I can change these settings in the program mode.
Instead of comparing to 18 and 20 you could compare to varB and VarC. Then you need to put the values into varB and varC.Now that the circuit is working, may I ask if any one can suggest, is it possible to manually adjust the temperature by a degree or two.
Yes I did miss it and sorry for the late reply.In honesty, I thought at first that Nick had missed the fact that a DS18B20 was being used and didn't follow the plot at all.