Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

Problem With If Statement
 Moderated by: slychiu
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Friday Apr 16th, 2010 10:15 pm
   PM  Quote  Reply 
1st Post
Podro
Member
 

Joined: Sunday Sep 14th, 2008
Location: Sheffield, United Kingdom
Posts: 33
Status: 
Offline

  back to top

I am trying to simulate responding to a perimeter alarm by turning on lights in a sequence.  I am having problems getting the reponse to work.  Everything works fine until I add the third 'Do' command line, it even works if I remove the 'After 7 Seconds Using Perimeter03' from that line of code.

If NightTime <> 0 Then
    If AlarmState <> Idle Then
        Do 1stLandingOn After 3 Seconds Using Perimeter01
        Do HallLightOn After 5 Seconds Using Perimeter02
        Do KitchenSpotOn After 7 Seconds Using Perimeter03
    End If
End If

I have moved the 'Do' lines around and each work in combinations of two, but as soon as I go to 3 'Do' commands I get the following error on execution of the response:

"The responses in this configuration may not have been written to comfort.  Do you want to do this before executing this response?"

If I click yes I get the following exception code:

Unhandled exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Comfort.Form1.CommonDownload(List`1 rangeList)
   at Comfort.Form1.ExecuteResponse(Response response)
   at Comfort.Form1.ExecuteResponse_Click(Object sender, EventArgs e)
   at Comfort.Form1.propertyGridResponse_HyperLinkPropertyClicked(Object sender, PropertyHyperLinkClickedEventArgs e)
   at VisualHint.SmartPropertyGrid.PropertyGrid.OnHyperLinkPropertyClicked(PropertyHyperLinkClickedEventArgs e)
   at VisualHint.SmartPropertyGrid.PropertyHyperLink.OnPropertyClicked(PropertyEnumerator enumSelf, Point point, Rectangle itemRect)
   at ឆ.ᜀ(MouseEventArgs A_0)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at ឆ.ᜀ(Message& A_0)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

What am I doing wrong?



 Posted: Saturday Apr 17th, 2010 02:03 am
   PM  Quote  Reply 
2nd Post
admin
Administrator


Joined: Saturday Mar 3rd, 2007
Location: Singapore
Posts: 1200
Status: 
Offline

  back to top

I believe this is a problem with executing a Response in Comfigurator rather than a problem with Comfort executing the Response.

The exception is caused by Coomfigurator not handling something in the Response. Which version of Comfigurator are you using? Please upgrade to the latest, Comfigurator 3.19, see http://www.comfortforums.com/forum20/1798.html which fixes some situations causing exceptions. Even through 3.19 is still considered beta, it is quite stable in testing so far and with better functionality

If this still occurs please send your cclx file to support@cytech.biz



 Posted: Saturday Apr 17th, 2010 08:19 am
   PM  Quote  Reply 
3rd Post
Podro
Member
 

Joined: Sunday Sep 14th, 2008
Location: Sheffield, United Kingdom
Posts: 33
Status: 
Offline

  back to top

Great - that's fixed it!

Thanks.



 Current time is 08:18 am
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems