Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: C# .Net 2.0 TriggerEvent Problem.

  1. #1
    Join Date
    Dec 2005
    Posts
    5

    Question C# .Net 2.0 TriggerEvent Problem.

    I have been using Girder Pro 4.0 (Beta) with C#, .Net 2.0 for about 6 months with no real problems. The system, to meet customer specs, uses a Windows, C#, .Net 2.0 front end to control a variety of x10 and IR devices and MM apps.

    I recently downloaded Girder 4-0-4-11 to take advantage of what I thought would be a cleaner build. Since then, a host of problems. The major problem is that triggerevent call does not generate an event in Girder. That is the logger does not record an event.

    What is curious however is that event.exe works from a command line, with the same parameters I am attempting to use in TriggerEvent, and it does show up properly in the logger.

    I have completely uninstalled Girder, Completely cleansed my c# app of references, Interops, etc. to insure clean new links, and reinstalled Girder.

    But the problem persists.

    Any thoughts would be appreciated.
    Alba Redneck

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    please show us you lua code.

  3. #3
    Join Date
    Dec 2005
    Posts
    5

    Question

    Mike C,
    Here is a part of the Lua code for X10.

    Please note that
    A. My setup did work with before, with the only change being Girder Beta to 4-0-4-11.
    B. The command line use of event.exe does work, showing an event in the logger and executing the lua code properly.
    C. What doesn't work for me is triggerevent.

    I don't understand what the lua code has to do with it, as the logger does not see the event, but here it is.

    For reference, the other parameters to a call are:
    eventdevice is a text string, "x10Out"
    eventnumber is the integer, 7777 (my arbitrary choice)
    with the payloads being the parameters for the cm11 plugin.

    So, event.exe x10Out 7777 A 2 ON 0 works from the command line,
    but, the equivalent code for TriggerEvent, which used to work, now doesn't.


    if (pld3=="ON")
    then cm11.On(pld1,pld2)

    elseif(pld3=="OFF")
    then cm11.Off(pld1,pld2)

    elseif(pld3=="DEVICESTATUS")
    then cm11.DeviceStatus(pld1,pld2)

    elseif(pld3=="ALLUNITSOFF")
    then cm11.AllUnitsOff (pld1)

    elseif(pld3=="ALLLIGHTSON")
    then cm11.AllLightsOn (pld1)

    elseif(pld3=="ALLLIGHTSOFF")
    then cm11.AlLightsOff (pld1)

    else
    --if here, not a valid x10 command
    --raise event?

    end


    --DIM and BRIGHT need another parameter, or a quess see page
    --89 in lua library reference.

    If I am not to use forum for "technical support", what is the correct path?

    AlbaRedneck

  4. #4
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    oh, sorry, I thought you were using the lua gir.TriggerEvent function.

    are you using the G4 COM object?

  5. #5
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,349

    Default

    What is your exact code that you are using to do the 'triggerevent'.
    Ron
    No support through PM

  6. #6
    Join Date
    Dec 2005
    Posts
    5

    Post

    Ron,
    Rather than explain a bunch of object typing and validity checking to set up the parameters for the call, below is a simple test I ran to try to sort out my problem.

    The development platform is Visual Studio 2005, and I am using c#.
    The PC is a rock solid Intel based system with an uptodate XP-SP2.
    When I run the test, I disconnect from the Internet, and disable all
    firewalls and antivirus to avoid any possibility of a conflict.

    The test code is a simple Windows Form application, -- single button, click it,
    and the event should be triggered, registered in the logger, and turn on A 2, which just happens to be a lamp next to my PC for easy testing.

    c# code follows.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using GIRDERXLib;

    namespace NewGirderTest
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }

    private void button1_Click(object sender, EventArgs e)
    {
    GirderClass GirderEvent = new GirderClass();
    GirderEvent.TriggerEvent("x10Out",7777,"A","2","ON ",0);
    }
    }
    }

    To repeat, using the command line version, event.exe x10Out 7777 A 2 ON 0
    does work... I do get an event in the log as below, and the light turns on.


    18:25:37:984 5/22/2006
    Scripting Lua Success (Nothing Triggered)

    play.gml:\7777 device, from Cap, x10Out\x10Out\Scripting
    18:25:37:968 5/22/2006
    x10Out A 2 ON


    Hope this helps,
    Albaredneck

  7. #7
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,349

    Default

    ah I think I know what is wrong...
    Ron
    No support through PM

  8. #8
    Join Date
    Dec 2005
    Posts
    5

    Post

    Mike C,

    Yes Mike, I am using the G4 Com object via .Net 2.0.

    Please see my response to Ron.

    Thank you
    Albaredneck

  9. #9
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,349

    Default

    here is the fix. Let me know if it works for you. Replace the girderx.dll file in your girder directory with this one.
    Attached Files Attached Files
    Ron
    No support through PM

  10. #10
    Join Date
    Dec 2005
    Posts
    5

    Thumbs up

    Ron,

    The fix appears to be working fine.

    I have tested the fix with a variety of c#, .Net 2.0 programs as well as from the command line. So far, all results are coming in as expected, with no side effects.

    Just as a note, I do understand that .Net 2.0 is currently one of the bleeding edges of programming, especially when interfacing with products not produced by Microsoft. Even Microsoft is not free of problems in this regard.

    And, I have the wounds to prove it.

    But, I must say, that you win the prize for the fastest bandaid!

    With more and more of Microsoft's stuff requiring .Net 2.0, I expect you will be seeing more related issues, especially as the VS Express Editions are currently free.

    While I hope I don't experience further problems with G4, it would not surprise me if I did. As I am new to your forums, if the unexpected happens, where should I post them?

    With the greatest of thanks,
    Albaredneck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •