Housebot Crash

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Housebot Crash

Post by jacco van der Ven »

When I running a script Housebot will crash. Can someone explain what I did wrong.


====== Begin Dump - Monday, November 01, 2010 09:21:00 ======
Server Version = 3.30.02
Exception code: C0000005 ACCESS_VIOLATION
Fault address: 7869C8DA 01:000BB8DA C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_405B0943\mfc90.dll

Registers:
EAX:0EDCFE9C
EBX:00000000
ECX:00000001
EDX:0BE67590
ESI:005B7190
EDI:00000000
CS:EIP:001B:7869C8DA
SS:ESP:0023:0EFCF9FC EBP:0EFCFA84
DS:0023 ES:0023 FS:003B GS:0000
Flags:00010286

Call stack:
Address Frame
7869C8DA 0EFCFA84 Ordinal4274+400
73463EF2 0EFCFAC0 0001:00002EF2 C:\WINDOWS\system32\vbscript.dll
73463E62 0EFCFAFC 0001:00002E62 C:\WINDOWS\system32\vbscript.dll
73463F23 0EFCFC10 0001:00002F23 C:\WINDOWS\system32\vbscript.dll
7347989C 0EFCFC34 DllGetClassObject+E02F
734672FB 0EFCFD3C DllCanUnloadNow+27DC
73465576 0EFCFD84 DllCanUnloadNow+A57
734654FA 0EFCFE7C DllCanUnloadNow+9DB
73465988 0EFCFED8 DllCanUnloadNow+E69
73465BEB 0EFCFF28 DllCanUnloadNow+10CC
7347BC89 0EFCFF44 DllGetClassObject+1041C
0046817C 0EFCFFB0 CxIOFile::~CxIOFile+651FC
7854332B 0EFCFFB8 endthread+DA
77E6482F 0EFCFFEC GetModuleHandleA+DF


====== End Dump ======


SCRIPT

Option Explicit
'On Error Resume Next

Dim oldData
Dim Data

oldData = ""

Do
Sleep 5000
Data = GetPropertyValue ("Controller.Received Hex Data")
If oldData <> Data Then
oldData = Data
Call VerwerkData(data)
End If
Loop

Sub VerwerkData(Data)
Select Case Data

Case "00 01"
Setpropertyvalue "Voordeur.Status" , "Open"
Setpropertyvalue "Voordeur.Laatste status" , Now

Case "00 02"
Setpropertyvalue "Voordeur.Status" , "Dicht"
Setpropertyvalue "Voordeur.Laatste status" , Now

Case "00 03"
Setpropertyvalue "Achterdeur.Status" , "Open"
Setpropertyvalue "Achterdeur.Laatste status" , Now

Case "00 04"
Setpropertyvalue "Achterdeur.Status" , "Dicht"
Setpropertyvalue "Achterdeur.Laatste status" , Now


End Select
End Sub
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Re: Housebot Crash

Post by yaccri »

The dump file doesn't help much.

Did you try to mark out some lines and see what happens?

I'm not sure about it, but the SetPropertyValue lines that use the 'Now' look suspicious.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Housebot Crash

Post by Richard Naninck »

At first glance, not much wrong with the script.
If you think 'Now' is is tricky, just replace it with 'Date() & " " & Time()' and see how that works out.

If you set up your script like that, you may end up with a delay in status updates of up to 5 seconds after opening or closing a door. You can set the delay easy to 200ms and it won't cost you any extra noticeable cpu. Furthermore if you use the OldData = Data trick, you can never receive and process the same data twice in a row. Maybe not a big deal here but there are cases where you would like to be able to receive the same data twice and still process it.

Does HB crash only when this script is running?

What kind of property types did you define for Status and Laatste Status? You may want them both to be Alpha Numeric, but I can imagine that you declared the Laatste Status property of type Time. That's can go wrong if the format inputted is wrong.
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Housebot Crash

Post by jacco van der Ven »

Hello Richard,

Yes when this script is running after a few seconds he crash.

I use an General Serial Device to communicate with an PLC (programmable logic controller).

For Status I made an new property named "Deur status", Alpha Numeric for "Laatste Status" I used the "User Alph 6" property, is that the problem
do I have to make an new property for "laatste status"

I build it all now in an Task and that worked also good.
But I like the scripting style more.

Regards,

Jacco
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Housebot Crash

Post by Richard Naninck »

User Alpha 6 is of alpha numeric type so that wouldn't be the problem.
How many scripts have you got running so far?
If this is your first script, it may not be related to your script, but to your script device.

Long ago I had trouble with script errors and did a windows update concerning the scripting part.

I installed: WindowsXP-Windows2000-Script56-KB917344-x86-nld.exe
Maybe that could be your problem.
If you run XP, than you may want to search for the file above and install it.
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Housebot Crash

Post by jacco van der Ven »

For now this is the only script that is running.

Housebot is running on my WHS (Windows Home Server) so that is based on Windows 2003 server.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Housebot Crash

Post by Richard Naninck »

Try to narrow it down by introducing another simple script device and see how if the same error occurs. If so, there is something wrong with your scripthost and you need to figure out if there is an update available for WHS2003. Your script seems fine to me, so try to comment out some lines and go from there. This could very well not be HouseBot related.
Maybe Scott can say something about the dump, but you have many options still to explore to figure this one out.
Post Reply