How to Send Temperature Data to ISY 994i

LarrylLix said:
No! Welcome to the world of integer binary languages.
 
Small controllers such as WC8 have no fractional representation or floating point math.
 
I disagree!!
 
The webcontrol has MOD (modulo), so you CAN do "fractional calculations" by handling the integer part seperate to the fractional part.
Yes, its messy, but it can be done!
 
Through PLC programming and WCx's I2C and SPI bus, ISY can access much larger range of sensors in addition to temperature and humidity.  Most of those sensors read back in integer then shift down in PLC for proper position.  A lot of them has 16 bit or less value. RAM and VAR both are 32bit storage, so that certain calculation can be done before sending it over to ISY.
 
Through the years I find it typically best to send all the resolution you have from the sensor and let the end user (usually a readout or monitor screen) do whatever it wants with it. That way mind changes later  can be done at each end device this is desired.
 
One readout app may want 0.1 degree C (eg. thermostat control of fish tank) and another may only want 1.0 degree C resolution. eg. outdoor temperature readout in your mudroom.
 
This is with the proviso that bandwidth is not a limiting factor in equipment somewhere.
 
randyth said:
The following attempts to explain how to send temperature information from a CAi WebControl board to a Universal Devices ISY 994i home automation system.
 
1.        Ensure you have these three main ingredients:
........

START
      SET RAM1 0
      SETLED 0  
LOOP:
      SET RAM2 T1
      ADD RAM2 5 RAM2
      DIV RAM2 10 RAM2
      TSTEQ RAM1 RAM2
      GOTO LOOP
      SETLED 1
      SET RAM1 RAM2
      WEBSET URL1 RAM1
      DELAY 1000
      SETLED 0
      GOTO LOOP
      END   
 
b.       Click the Send button and stand back in case you did something wrong because one bad character can cause the WebControl to explode.  OK, that last part was a joke.  Worst case, it simply won’t work.
c.      This code constantly polls the temperature sensor looking for changes.  Whenever the temperature changes by 1 degree or more, it sends the new temperature to the ISY device and flashes the WebControl’s green LED.
7.        Verify that it’s all working
a.        Go back to your ISY’s admin console and navigate back to the Programs->Variables->State screen where you created the MyTemp (or whatever you called it) variable to see if it has changed to something resembling a reasonable temperature.
b.        Again, feel free to hyperventilate a bit by “fogging” the sensor with your hot breath and/or blowing on it to see if you can get the temperature to move up and down.
8.        If it works, think nice thoughts about me.  If it doesn’t, please let us know where you think it’s going wrong.
 
Please note that your WebControl talks to your ISY device via your local area network (LAN) so both must remain connected to your LAN for this to work.
 
If anything is going awry, it's probably because there is an error in the Notify Setup data described in section 5.a.  It must be entered exactly right and, because everyone's setup is potentially unique, what's right for you won't be right for most other people.  Any mistake here will cause the ISY to ignore you.
 
Please reply with any additions or corrections you might have and I'll do my best to keep this initial post up to date.
 
Good luck,
-Randy
 
 
RANDY.. THANK YOU THANK YOU THANK YOU!!  I have searched hard to come up with an easy way to add temperatures to my ISY. At first I was a bit overwhelmed by all the "pieces" of information out there, but than saw your post. I have now successfully set up my CAI controller, and have 2 test temps reporting.. I had to play with your programming a bit to be able to accomplish the same concept --> report only when changed,, when using 8 probes and came up with this in case others are stumped by it at all.... Cheers and THANKS AGAIN!!!
START
SET RAM1L 0
SET RAM1H 0  
SET RAM2L 0
SET RAM2H 0  
SETLED 0   
LOOP:
      SET RAM1H T1
      ADD RAM1H 5 RAM1H
      DIV RAM1H 10 RAM1H
      TSTNE RAM1L RAM1H
      WEBSET URL1 RAM1H
      SET RAM1L RAM1H
      SET RAM2H T2
      ADD RAM2H 5 RAM2H
      DIV RAM2H 10 RAM2H
      TSTNE RAM2L RAM2H
      WEBSET URL2 RAM2H
      SET RAM2L RAM2H
      SETLED 1
      DELAY 1000
      SETLED 0
      DELAY 1000
      GOTO LOOP
      END
 
Dbwarner5 said:
RANDY.. THANK YOU THANK YOU THANK YOU!!  I have searched hard to come up with an easy way to add temperatures to my ISY. At first I was a bit overwhelmed by all the "pieces" of information out there, but than saw your post. I have now successfully set up my CAI controller, and have 2 test temps reporting.. I had to play with your programming a bit to be able to accomplish the same concept --> report only when changed,, when using 8 probes and came up with this in case others are stumped by it at all.... Cheers and THANKS AGAIN!!!
START
SET RAM1L 0
SET RAM1H 0  
SET RAM2L 0
SET RAM2H 0  
SETLED 0   
LOOP:
      SET RAM1H T1
      ADD RAM1H 5 RAM1H
      DIV RAM1H 10 RAM1H
      TSTNE RAM1L RAM1H
      WEBSET URL1 RAM1H
      SET RAM1L RAM1H
      SET RAM2H T2
      ADD RAM2H 5 RAM2H
      DIV RAM2H 10 RAM2H
      TSTNE RAM2L RAM2H
      WEBSET URL2 RAM2H
      SET RAM2L RAM2H
      SETLED 1
      DELAY 1000
      SETLED 0
      DELAY 1000
      GOTO LOOP
      END
 
So glad you found my post useful.  Thanks for sharing your improvements/modifications.
 
-Randy
 
Also send a regular heartbeat so that ISY programs can know if the temperature is staledated.

I use the real time clock compacted into one variable every 15 seconds
 
Back
Top