universal1 Posted July 22, 2018 Posted July 22, 2018 Is there a way to flush all running programs programatically? I have programs with REPEAT EVERY statements that misbehave.
paulbates Posted July 22, 2018 Posted July 22, 2018 You can use ISY program statements to individually stop / run and enable / disable programs, but that requires more programs to manage that. Seeing the problem program(s) would help. Can you post an example program and describe the misbehaving? Paul
universal1 Posted July 22, 2018 Author Posted July 22, 2018 programs are simple basically: If $int_1=1 then repeat every 1 minute x10 A 1 On Wait 5 seconds x10 A 1 off then another program controls $int_1 If (blank) then $int_1=1 wait 1 hour $int_1=0 but this doesn't work to stop other program after 1 hour it just keeps going and i cant figure out how to stop it "STOP" and "DISABLE" don't work or are VERY slow... would be nice to just stop any running program without powering off ISY... is there a REST option to reboot?
paulbates Posted July 22, 2018 Posted July 22, 2018 I'm not sure if by $int_1, you've defined an integer variable. State variables need to be used for "if" logic in the ISY. If its an Integer variable, this explains the behavior you're describing.
universal1 Posted July 22, 2018 Author Posted July 22, 2018 confused... if it doesn't "work" then why does console allow integer variable in IF section? My understanding is state variable are used for program initiation. I don't want control program to start the first program. I just want it to control behavior of first program if first program ever runs. Otherwise I don't understand the purpose of integer variable.
paulbates Posted July 22, 2018 Posted July 22, 2018 Integer variables are primarily for tallying and reporting. Out of my 78 variables, only 3 are integer, that tally up total seasonal rainfall and the number of sprinkler cycles I avoided with my rain sensor. I manually reset those at the end of each season. I use mostly state variables for the reasons I posted above. I would create a state variable and retest the program
oberkc Posted July 22, 2018 Posted July 22, 2018 I understood same as universal1...integer variables can be used as part of a condition, but thier presence would not trigger a program.
larryllix Posted July 22, 2018 Posted July 22, 2018 6 hours ago, universal1 said: confused... if it doesn't "work" then why does console allow integer variable in IF section? My understanding is state variable are used for program initiation. I don't want control program to start the first program. I just want it to control behavior of first program if first program ever runs. Otherwise I don't understand the purpose of integer variable. Integer variables are used where triggers are not wanted in If sections. Integer variables are used for temporary calculation registers or anywhere else program triggers are not needed or wanted. I use a few hundred Integer variables for constants. eg. $cRED.HUE_BULB, $cBLUE.LED_STRIP, $cRED.HUE_BLOOM, $cTRUE, $cFALSE. I avoid flooding my ISY trigger engine with too many State variables where they are never required for those functions.
oberkc Posted July 23, 2018 Posted July 23, 2018 Of course, in your case, this program WOULD continue to run unless you extrnally triggered the program. Do you? As discussed, integer varialble conditions would NOT trigger the program, and that is the only condition you have.
universal1 Posted July 23, 2018 Author Posted July 23, 2018 I start the process by running the control program from the HTML interface which sets $int_1 to 1. The I start the repeat program with the REPEAT from the HTML interface which should execute the REPEAT in the THEN section since IF is true. I have assumed when the control program completes in an hour it will set $int_1 to 0 and then the repeat program will test the IF at the end of the next REPEAT iteration and go to ELSE and stop. It don't.
MWareman Posted July 23, 2018 Posted July 23, 2018 I start the process by running the control program from the HTML interface which sets $int_1 to 1. The I start the repeat program with the REPEAT from the HTML interface which should execute the REPEAT in the THEN section since IF is true. I have assumed when the control program completes in an hour it will set $int_1 to 0 and then the repeat program will test the IF at the end of the next REPEAT iteration and go to ELSE and stop. It don't. If you are triggering ‘Then’ from the HTML interface, hen IF is not even evaluated. And yes, if it’s an ‘Integer’ (as opposed to a ‘State’ variable) changing its value will not force a re-evaluation of the first program.Best solution is to change the variable to a State one. Changing the value to 1 will start your repeat without needing to separately run it. Changing it to 0 will immediately stop the first program.
MWareman Posted July 23, 2018 Posted July 23, 2018 Also, if ‘Stop’ and ‘Disable’ are very slow, then you likely have programs in a tight loop on your system. ISY is an event driven system. You have to follow the event driven rules of the system. You appear to be thinking like a flow logic programmer.
oberkc Posted July 23, 2018 Posted July 23, 2018 14 hours ago, universal1 said: I start the process by running the control program from the HTML interface which sets $int_1 to 1. The I start the repeat program with the REPEAT from the HTML interface which should execute the REPEAT in the THEN section since IF is true. I have assumed when the control program completes in an hour it will set $int_1 to 0 and then the repeat program will test the IF at the end of the next REPEAT iteration and go to ELSE and stop. It don't. And that is exactly the difference between integer and state variables. An integer variable, when it changes, will NOT force a test of the condition. A state variable WILL.
universal1 Posted July 23, 2018 Author Posted July 23, 2018 the documentation states that IF contitions are tested at end of every REPEAT iteration. I do not want IF re-evaluated when value changes. Only when REPEAT iteration is finished. But it doesn't seem to work all the time. Hmmm... maybe it is possible that sometimes i click on THEN instead of IF in HTML interface... Will this cause REPEAT not to check IF at end of iteration?
oberkc Posted July 23, 2018 Posted July 23, 2018 I would lke to see that documentation reference. It is my understanding that IF conditions are tested only upon a triggering event. The REPEAT allows an opportunity for a triggered program to redirect or restart a program, but it must first be triggered. If not triggered, thr repeat will continue. I do not believe that calling on THE rather than IF will make any difference.
universal1 Posted July 23, 2018 Author Posted July 23, 2018 from: https://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order "The program's conditions are reevaluated each time a Wait or Repeat statement is encountered, and at the end of each iteration of a Repeat loop. "
larryllix Posted July 23, 2018 Posted July 23, 2018 5 hours ago, universal1 said: from: https://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order "The program's conditions are reevaluated each time a Wait or Repeat statement is encountered, and at the end of each iteration of a Repeat loop. " It is possible that the statement is true but I doubt it works that way. What would cause evaluation of the other 300 programs I have when a Wait is encountered in an unrelated program? It doesn't seem logically probable. Either way, we are guessing about semantics. Whether the ISY engine "re-evaluates the IF trigger conditions on every repeat or wait" or the ISY engine "re-evaluates the IF section due to an event trigger when a Wait or Repeat is encountered" makes no difference to the ISY user programs or programmer.
oberkc Posted July 24, 2018 Posted July 24, 2018 Unfortunately, the wiki is not written as I understood it. Perhaps I have misunderstood this whole time. Still, I think your experience suggest otherwise. when I read that wiki section, I cannot help but suspect the intention was to differentiate between “atomic” execution and those that can be interrupted (waits, repeats,etc...) should a triggering event occurs. BTW, I really admire your willingness to actually read the wiki.
universal1 Posted July 24, 2018 Author Posted July 24, 2018 1. write the specification. 2. write the documentation. 3. create the system.
kclenden Posted July 24, 2018 Posted July 24, 2018 8 hours ago, universal1 said: from: https://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order "The program's conditions are reevaluated each time a Wait or Repeat statement is encountered, and at the end of each iteration of a Repeat loop. " Without manual intervention an ISY program will run until one of the following occurs: It runs out of instructions in the THEN or ELSE section It is stopped by another program It allows itself to be interrupted by an event that causes it to start again What the wiki refers to about the WAIT and REPEAT statements is really just telling you when a program will allow itself to be interrupted by an event that causes it to start again. It's up to you to create that event by using a state variable in the IF clause per the wiki: https://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Variable_Details "Identical to an Integer variable except that changes to the value do cause an event to be sent, causing programs to run"
Recommended Posts
Archived
This topic is now archived and is closed to further replies.