I want to control drapes. That requires closing a contact (using an rs232 digital IO unit), sleeping enough time (15 seconds) and releasing the contact.
In order to be able to interrupt that action, I created vb scripts for UP, DOWN and STOP. Each script changes the others' device's state to "stopped" to interrupt the other tasks in case they are running.
IS IT OK TO CHANGE A SCRIPT DEVICE'S STATE TO "STOPPED"?
After making several interrupts, I get error messages on the HB server:
unable to load the script file [my script file]. Error=[The operation completed successfuly].
Unable to compile the script.
After a few more interrupts, the server crashes with error:
AppName: housebotserver.exe AppVer: 2.0.0.0 modName: ntdll.dll
ModVer: 5.1.2600.1217 Offset: 00019ecd
Any suggestions on how else to interrupt tasks or to fix the problem?
Thanks,
Yoram
Interrupting a task - how to?
Re: Interrupting a task - how to?
yaccri wrote:IS IT OK TO CHANGE A SCRIPT DEVICE'S STATE TO "STOPPED"?
Yes... well it should be. Another option would be to add a Property to the Script Device that the script will check and abort itself if changed.
If there was a dump file generated, could you send it to me?
Scott
-
- HouseBot Special Member
- Posts: 304
- Joined: Wed May 07, 2003 2:19 pm
- Location: Tel-Aviv, Israel
- Contact:
Got it done in a different way.
Instead of interrupting the vb script, I created a sleep device and started/stopped it from the vb scripts.
So now the scripts look like:
' =================================
On Error Resume Next
SetPropertyValue "Sleep Timer-Drape.Running", "No"
' close/open contacts here
' ...
' Sleep enough time
SetPropertyValue "Sleep Timer-Drape.Running", "Yes"
Do While True
If (GetPropertyValue("Sleep Timer-Drape.Running") <> "Yes") Then
Exit Do
End If
Loop
' More stuff here
' ...
' =================================
One nice thing about HB (among many others) is that things can be done in different ways.
Scott, I guess that stopping a running vb script manualy may cause crashes.
Yoram.
Instead of interrupting the vb script, I created a sleep device and started/stopped it from the vb scripts.
So now the scripts look like:
' =================================
On Error Resume Next
SetPropertyValue "Sleep Timer-Drape.Running", "No"
' close/open contacts here
' ...
' Sleep enough time
SetPropertyValue "Sleep Timer-Drape.Running", "Yes"
Do While True
If (GetPropertyValue("Sleep Timer-Drape.Running") <> "Yes") Then
Exit Do
End If
Loop
' More stuff here
' ...
' =================================
One nice thing about HB (among many others) is that things can be done in different ways.
Scott, I guess that stopping a running vb script manualy may cause crashes.
Yoram.