Jump to content

Simple Question about variables


MrBill

Recommended Posts

Curiosity... I added 55 state variables the other day for CAO gadget tags...  My list is now just over 100...  I'm actually going to drop 22 of those because I'll never use some of the functions and why have the tags update something i'l never use... and another 11 could fall into that category too.. it was worth setting up that way to start to understand and experiment.

 

I wonder if I need to be conservative with variable creation, or don't care because I'll never run out.

Link to comment

I also have a ridiculous number of integer variables because I decided to have two per wireless transmitter to count total transmissions and battery days.  That was a nerd curiosity thing since open/close sensors don't send low battery-- i did it for the recessed door sensors tho too... (17 transmitters x 2 variables each = 34)

Link to comment

I don't believe that there's a practical limit. Probably the only concern would be if too many State variables triggered programs concurrently. But that isn't directly related to the actual number of variables. Hey, just go ahead. I'm sure others would like to know if you actually reach a limit B)

Link to comment

I also have a ridiculous number of integer variables because I decided to have two per wireless transmitter to count total transmissions and battery days. That was a nerd curiosity thing since open/close sensors don't send low battery-- i did it for the recessed door sensors tho too... (17 transmitters x 2 variables each = 34)

I try to limit my usage of State variables because I figure somewhere in the trigger engine they all have to be searched every event. I run about 60.

 

However I use about three hundred Integer variables because I figure they just sit and take up space and no CPU power. I have about two hundred used for constants to define colours for five types of RGBW bulbs and strips, as well as True, False and dozens of other constants

 

Sent from my SGH-I257M using Tapatalk

Link to comment

It seems to me that State variables just sit around, too, unless they're woken up. it just doesn't make sense from a programming standpoint, to have to poll anything on a regular basis unless specifically asked to do so.

Link to comment

It seems to me that State variables just sit around, too, unless they're woken up. it just doesn't make sense from a programming standpoint, to have to poll anything on a regular basis unless specifically asked to do so.

I have never received a clear definition of the method used inside ISY for state triggering. I see two different methods and although the table of usages for each element was denied I believe v5 may have changed how it works.

 

1, each element has a list of usages and when that element changes value, all usages of that element are searched for logic results (if sections)

 

2, each time any element changes vslue, every program if section is evaluated

 

3,on a cyclic time clock basis each program logic section is evaluated and executed if necessary.

 

I worked on a real time system using technique 3 for grid protection, but it took many other cpus to digitise all the hundreds of AC waveforms on a 24 samples per 60Hz cycle, for simultaneous harmonic analysis. Using a 8MHz 486 was still plenty fast enough for this big system handling do much processing without hiccoughs.

 

Spreadsheets work on the same technique with multiple pages of calculations

 

Sent from my SGH-I257M using Tapatalk

Link to comment

My first home automation controller back in the 80's, the Hypertek HomeBrain, used a 6502 processor. It literally evaluated "everything" in every loop of its operating system.  It had a whopping 2k of RAM (the OS was indeed 'firmware'-- to update it required burning a new PROM--Not even EEPROM... the PROM the could be erased and reused just a few times by peeling a sticker off the chip and "dosing" it under UV light.)   BUT hey... this modern marvel of the 80's spoke and listened to X10 (then called BSR) on the power lines!!  Memory was very limited, as I recall there were a whopping 32 (or 64 for an upgraded model) memory locations (variables) available for program use.  (I was a dealer at the time--we installed a whopping 5 units in 4 years, I still had 2 new in boxes until about 4 years ago.)

 

Compared to what I once knew about how the HomeBrain OS worked, I know literally nothing about the ISY's OS, but I can't imagine it not using Event based processing where a change in value results in queuing. Anything else is a waste of processing power.

Link to comment

to update it required burning a new PROM--Not even EEPROM... the PROM the could be erased and reused just a few times by peeling a sticker off the chip and "dosing" it under UV light.)

PROMs that can be erased with UV light are EPROMs (Erasable Programmable Read Only Memory)

 

PROMs that can be erased electrically (no need for the UV light) are EEPROMs (Electrically Erasable Programmable Read Only Memory)

 

If it was truly a PROM - they are writable only once. There is no window to erase them.

 

Also, 6592.Cool.. I learned my first assembler programming on 6502... and for sure one of my high school electronics projects I built a switching phone system around a 6502..

Link to comment

PROMs that can be erased with UV light are EPROMs (Erasable Programmable Read Only Memory)

 

PROMs that can be erased electrically (no need for the UV light) are EEPROMs (Electrically Erasable Programmable Read Only Memory)

 

If it was truly a PROM - they are writable only once. There is no window to erase them.

 

Also, 6592.Cool.. I learned my first assembler programming on 6502... and for sure one of my high school electronics projects I built a switching phone system around a 6502..

 

 

I may have the letters mixed up... Haven't touched that level of technology in years.   The chips did have a window and were erased with UV.

 

My college project that almost made me famous (not!) used apple ][ (also 6502 based) and a Novation modem which had the ability to decode DTMF.  It answered a landline, then an external speech synthesizer said "Hello Please enter the codes".  The correct hard coded 4 digit PIN, followed by 2 digit device, followed single digit command would control a light via X10! 

 

That was remote control at it's finest!  You could control a light from anywhere in the world!  (any location that had a touchtone landline phone anyway--many landlines were still rotary dial.)

Link to comment

Funny story about those UV eproms in the late 1970s.

 

I rewrote the bios/os on my 6800 kit and took a chip to a hairdressing school and asked if I could sterilise something in their brush steriliser. My mother went through hairdressing school, decades earlier, and I knew they used them for shared hair equipment.

 

Well it wasn't cleaned off completely and with my tail between my legs I had to go back and ask again. Try explaining an erasable memory chip to a bunch of hairdressers back in about 1976. I didn't dare ever say floppy disk for fear of police action. Of course some hobbiests were only beginning to talk about owning those 8" ones.

 

A few years later my father bought me my own UV eraser lamp for Christmas.

 

IIRC those 1024 byte eproms cost me $100 each and the UV lamp was about the same price.

 

Sent from my SGH-I257M using Tapatalk

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...