I have a task that checks for a property value for one of three values and based on that finding does one thing. Pretty simple steps: an IF test, followed by an ELSE IF, and a final ELSE. And with a positive match is just executing a task that turns on a light. Nothing exotic here. But it SEEMS to be missing the change in the property value occasionally. I got to wondering if I coded the equivalent in a short VBScript whether it would "run faster", i.e. be more reliable. I could try it, obviously. But I thought it was a decent gee whiz question that, until now, I never thought about.
Full disclosure: The failure to turn on the light may be elsewhere though, due to what else is involved "downstream": external GPIO board, relays, switches, etc. But if I can prove that the task is reliable, then I can focus on the downstream stuff.
Processing speed: task or VBscript equivalent?
-
- HouseBot Guru
- Posts: 750
- Joined: Wed Apr 02, 2003 8:10 pm
- Location: Pelham AL
Re: Processing speed: task or VBscript equivalent?
Steve,
A HouseBot Task should be faster than a VB Script. Although VB Scripting is pretty fast, it still has to load the VB engine, load the script, and finally, interpret and execute the script.
Anything is possible, but it's doubtful that the task is missing a change. When you save a Task, it will register itself with each Property that is part of it's condition. When a Property changes, it will run thought the list of registered Tasks and evaluate them. So if it works right for one PV change, it should be working the same for all.
As a side note, the next version will have a Task condition option for each Property to allow you to exclude it from task evaluation. This can be helpful for things like when you have a time property in a condition, but don't want the task evaluated every second (this probably won't make sense unless you have been through it )
A HouseBot Task should be faster than a VB Script. Although VB Scripting is pretty fast, it still has to load the VB engine, load the script, and finally, interpret and execute the script.
Anything is possible, but it's doubtful that the task is missing a change. When you save a Task, it will register itself with each Property that is part of it's condition. When a Property changes, it will run thought the list of registered Tasks and evaluate them. So if it works right for one PV change, it should be working the same for all.
As a side note, the next version will have a Task condition option for each Property to allow you to exclude it from task evaluation. This can be helpful for things like when you have a time property in a condition, but don't want the task evaluated every second (this probably won't make sense unless you have been through it )
Scott
-
- HouseBot Guru
- Posts: 750
- Joined: Wed Apr 02, 2003 8:10 pm
- Location: Pelham AL
Re: Processing speed: task or VBscript equivalent?
Good to know... And intersting. I would have bet just the opposite. Now I can look at the the other glue needed to turn on the light. Thanks!
Steve
Re: Processing speed: task or VBscript equivalent?
Wow that really simple and interesting .