Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: GLOBAL VAR use Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 20:27 | IP Logged Quote GadgetGuy

OK

Another one of the great mysteries of the western world!

I'm trying to improve my Insteon Thermostat performance
and attempting to use Global Variables instead of pure
Raw Formula data capture.

But I cannot get the Global Vars to work.

One does, and two others that seem identical do not. Go
figure!

The easiest way to examine the issues is from the
following screen capture. . .
08_202606_STATS1.jpg">

The (non skipped in light blue) macros commands are on
the right. They are identical except for variable
names.

The message Box output in the middle shows that the
Globals are correct, and as I expect them to be. These
are reinforced and confirmed in the Global Variables Web
window on the right.

Yet despite all this, the Device Status window (and any
attempt to access the Global Variables via a web page)
only correctly displays the House Temp (TEMPNOW) data.
The other two data points are not viable.

Is there a data conversion issue here I'm missing, or
something else?

PS-Worse yet I can't get the image to upload although it
is only a 105KB JPG!!! (%$#@!&%$!!)

Sooooo! As an alternative to an image here are facts.
The three macros statements that I have are...
Code:
ph_setotheranalogout("VIRT",0,0,1,{TEMPMODE})
ph_setotheranalogout("VIRT",0,0,1,{TEMPSET})
ph_setotheranalogout("VIRT",0,0,1,{TEMPNOW})


Only the TEMPNOW statement works. The TEMPMODE gives an
"Unknown" result and the TEMPSET result is -1.

The values shown respectively (and correctly as
expected) for each of these in the msgbox window and the
Global Varables web window are... 1, 70, 68

Edited by GadgetGuy - January 08 2009 at 20:37


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: January 08 2009 at 20:56 | IP Logged Quote nadler

This probably won't help much (or at all) because I
think we set up our Insteon Stats differently in PH, but
to read the set point in my thermostats and write them
to a global variable I use:
ph_setglobal_a("THERMOSTAT_SP",
ph_insteonwithret("THERMOSTAT",106,32) / 2)

This retrieves the set point of the thermostat with the
clever name of "THERMOSTAT" and writes it to a global
variable for the set point with an equally clever name
of "THERMOSTAT_SP".
Back to Top View nadler's Profile Search for other posts by nadler
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 21:20 | IP Logged Quote GadgetGuy

You are doing exactly the same thing I am. I don't have
any problem setting the GLOBAL. All my indications are
that all data is OK.

My issue is that I cannot seem to use the GLOBAL var
successfully.

In the CODE example I gave above, only the TEMPNOW
setting of the AnalogOut works! Although the other two
code lines seem identical and have valid GLOBAL data,
they result in errors when attempting to use them to set
the AnalogOut presentation that Dave worked with me to
set up for auto display in the Device Status window, as
well as available for use on my web page.

I can't figure out why only one of three seemingly
identical code lines should work!

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 10 2009 at 10:36 | IP Logged Quote GadgetGuy

Got them all working at last.

Was a combination of subtle typos and the use of an un-
initialized [TEMP] that got me in trouble.

Dave - if you're listening, it sure would be nice to
have a single step capability in the macros for
debugging purposes, especially when branching decisions
are reached. If you could single step and move the line
focus along by highlighting the macro line number cell,
it would be mighty awesome!

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: January 10 2009 at 11:51 | IP Logged Quote nadler

For debugging I usually use a pop up message box to show
me the variables as the macro moves from line to line.
I either delete those lines when I'm done or more likely
check the disable box for that line so they don't
execute when the macro is finished.
Back to Top View nadler's Profile Search for other posts by nadler
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 10 2009 at 15:02 | IP Logged Quote GadgetGuy

Yep. Agreed. The msgbox is the only tool I've discovered
and I just leave them in place too and check the SKIP
box in case I need them later.

But that said, it's a bit of a pain.

Even a breakpoint would be handy to stop execution at a
specific point. At least the TEMP and LOCAL variables
would be intact and one could use the Formula Validate
feature to see what happened next.

As I said "Dave, if you're listening....."

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum