PDA

View Full Version : Girder Vb.net Program



nosage
April 29th, 2005, 05:22 PM
Hello
I am a newbie to girder and to vb.net but I do understand the basics. I am trying to create a program in vb.net that is similar to a remote control. Its going to have buttons to control all of my electronic devices (tv, dvd, etc.). I have done several searchs on here and found out about the event.eve in the girder folder and something about a COM object. I am trying to figure out how I can excute commands in girder to emit the ir from vb.net. I am despirate and looking for anyway for this to happen. Even if I can execute keyboard shortcuts from vb.net that emit the ir from girder. Like i said i am a newbie, I am working on this for a school project. Anything that anyone can explain to me would be greatly appreciated. Thank you in advance.

Promixis
April 29th, 2005, 05:36 PM
You can use the Girder COM object or execute the event.exe program in Girder's directory (easiest). Just type event.exe for help.

Pass an eventstring that you want Girder to execute, attach it to the command you want to send.

nosage
May 3rd, 2005, 05:41 PM
Thank you for your reply. I have done research on event.exe and I guess I can go in that direction. I can get Eventstrings attached to the IR signals in Girder. I am using Tira 2.1 USB emitter/receiver. I am confused on what exactly the eventstrings are and how they work. When I click learn girder seems to want another ir code. Am I suppose to learn the same code over again. For instance, if its a play button relearn that very same play button from that remote control. I have looked up the girder help file and FAQ but I am still confused on how these eventstrings work. Again, anyway anyone can help would be greatly appreciated and as soon as I get something working I will post my program up here for other to use or become inspired by.

Promixis
May 3rd, 2005, 08:15 PM
You can set Girder in the learn mode and then send the event using event.exe. Girder will learn that command. The eventstring must match exactly. You can also install the logger plugin which will help better understand eventstrings and payloads.

Mark F
May 4th, 2005, 08:58 AM
Be sure to disable the TaskSwitch and TaskCreate plugins, if they are enabled, before trying to learn an event from event.exe.

nosage
May 5th, 2005, 11:59 AM
So just to make sure I am doing this right then. I should create an eventstring for each ir command I already learned. Then relearn each command with the eventstrings. At that point i should be able to trigger them from event.exe using my vb.net program. You guys said something about the code having to be the same. Are you guys talking about the first learned ir code has to be the same as the one for the eventstring that is going to be learned below that code? Again you guys have been great thanks alot. I will be sure to post our program when it is finished in case someone else is looking to acomplish what we are.

nosage
May 10th, 2005, 03:45 PM
.NET includes functions to call external programs using the system.diagnostics.process command.

http://www.devx.com/dotnet/Article/7914

This is a great article that explains it. So in VB I have to open Girder and Event.exe. Then in VB I have to call the event.exe functions using eventstrings. Sounds simple, the only thing I need to find out it how to call event strings in event.exe using VB.



Dim myProcess1 As Process = System.Diagnostics.Process.Start
("C:\Program Files\girder\Girder.exe")

Dim myProcess2 As Process = System.Diagnostics.Process.Start
("C:\Program Files\girder\Event.exe")

birty
May 10th, 2005, 04:19 PM
just call


Dim myProcess2 As Process = System.Diagnostics.Process.Start
&#40;"C&#58;\Program Files\girder\Event.exe <eventstring>"&#41;
where <eventstring> is the event string you want girder to receive

nosage
May 10th, 2005, 07:16 PM
Thanks for your reply, I tried exactly what you said and an error box pops up and says.

"An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll

Additional information: The system cannot find the file specifie"

Which does not make any sense because I have it pointing to the right directory which event.exe is located.

So the eventstring is that the hex code for the IR or is that the label for the eventstring?

Rob H
May 11th, 2005, 04:48 AM
From looking at MSDN it seems that you need to pass the eventString as a second parameter


Dim myProcess2 As Process = System.Diagnostics.Process.Start
&#40;"C&#58;\Program Files\girder\Event.exe", eventstring&#41;

And substitute eventString with a string that specifies the girder event you want to call.

nosage
May 17th, 2005, 03:46 PM
From looking at MSDN it seems that you need to pass the eventString as a second parameter


Dim myProcess2 As Process = System.Diagnostics.Process.Start
&#40;"C&#58;\Program Files\girder\Event.exe", eventstring&#41;

And substitute eventString with a string that specifies the girder event you want to call.

yeah, i seen that internet explorer example too, but that just shows how to pass arguments to internet explorer, not sure if event.exe works the same.


Public Sub OpenWithArguments&#40;&#41;
Process.Start&#40;"IExplore.exe", "www.northwindtraders.com"&#41;


i tryed
Process.Start&#40;"Event.exe", "54352D490000"&#41;

and got nothing

Rob H
May 17th, 2005, 05:01 PM
You'll only get a response if event.exe is on the path. Try specifying the full path. You can get the Girder directory from the registry if you need it.

blyons
May 18th, 2005, 11:51 PM
It seems to me that trying to call event.exe is overcomplicating it. It is very simple to directly send a COM event to Girder from VB.

This thread: http://www.promixis.com/phpBB2/viewtopic.php?t=9773
Has the following simple VB script that works fine from Word or Excel:

Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.Device = 18
GirderEvent.EventString = "MyEvent"
GirderEvent.Payload(1) = payload
GirderEvent.Send()

a simplified version would be:
Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.SendEventSimple("MyEvent", 18)

A simple VB.NET equivalent is:
Dim GirderEvent As New GIRDERLib.GirderEvent
GirderEvent.SendEventSimple("MyEvent", 18)

In C# it would be:
private GIRDERLib.GirderEvent oGirder = new GIRDERLib.GirderEvent();
oGirder.SendEventSimple("MyEvent",18);

Of course, in VisualStudio you'll need to set a Reference to the Girder COM object library to be able to use it successfully.

bl

Rob H
May 19th, 2005, 05:11 AM
That's a good point! I'd completely forgotten that Girder was a COM server!

nosage
May 21st, 2005, 05:46 AM
A simple VB.NET equivalent is:
Dim GirderEvent As New GIRDERLib.GirderEvent
GirderEvent.SendEventSimple("MyEvent", 18)

Of course, in VisualStudio you'll need to set a Reference to the Girder COM object library to be able to use it successfully.

Thank you very much. This section of the software HAS to be done the 24th. So from where I am standing now I will be using brute force to get this working. I will try this hopefully today (Saturday). Thank everyone again for help.

nosage
May 22nd, 2005, 05:50 PM
awesome, it worked! you have to go to Project->Add reference then on the COM tab click on Girder 1.0 Type Library and add it.


Dim GirderEvent As New GIRDERLib.GirderEvent
GirderEvent.SendEventSimple&#40;"830218000A00", 18&#41;

thats the exact code for a xbox remote control display button.

only stuff left in the project is add macros, a timer, and hotkeys, but thats all on the vb side.

thank you everyone that helped!

nosage
May 23rd, 2005, 07:44 PM
OK, finally got around to testing it and the girder led shows yellow, meaning the event string was received. Is there a function in the COM object that can emit the ir code? or is there a way for girder to automatically send the ir code once received? thank you for your help!

blyons
May 24th, 2005, 10:38 AM
This is basic Girder stuff:
1. Create a Girder command containing the IR code. Test it to be sure it works properly using the "Test Command" function.
2. With that command highlighted, with the event type set to "All", click "Learn Event".
3. Send your event from VB.

The VB event will then be learned and attached to the Girder IR command. Sending the VB event will trigger the Girder IR command.

I hope that helps.

bl