VB.NET Programming GC-IRL and GC-100

iostream212

Active Member
I was very excited to receive my new Global Cache infared learner and GC-100, but was frustrated at trying to get the thing to work. It seemed like the included testing applications were just not working, especially the ir functions. After weeks of research I got the thing up and running and am sharing my findings for others who may be in the same situation.

First off if you just want to get the GC-100 up and running right out of the box download the trial of chipmunk av at www.chipmunkav.com. I had my GC-100 working in minutes with this program.

Second, I am just a hobbyist programmer. I am sure my code isn't the most correct, but it works!

For this program the vb.net form is just two text boxes and a send button. The first box is to type the commands in, the other to receive replies from the gc-100. The send button sends the typed command. Right now the code is for ir functions as it connects to port 4998. The biggest problem I had in sending ir is that I forgot to add the carriage return line feed at the end of the ir command, and thus my commands never completed. The code line in blue shows how I corrected this issue.

All you need to get this program working is to define your gc-100 ip address and port (shown in red). Paste the ir code from the gr-irl ir learner utility (make sure the right module and connector is chosen), and send.

Programming the GC-100
Imports System.Net.Sockets
Imports System.Text
Public Class Form1

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim client As New TcpClient
Dim stream As NetworkStream
Try
client.Connect("192.168.1.150", 4998)
Catch ex As Exception

End Try

stream = client.GetStream()
Dim myBytes() As Byte = Encoding.ASCII.GetBytes(txtSend.Text + vbCrLf)
stream.Write(myBytes, 0, myBytes.Length)
Dim bufferSize As Integer = client.ReceiveBufferSize
Dim myBufferBytes(bufferSize) As Byte
stream.Read(myBufferBytes, 0, bufferSize)
txtReceived.Text = (Encoding.ASCII.GetString(myBufferBytes, 0, bufferSize))
stream.Close()
End Sub
End Class

Well I hope this helps someone and I would also welcome any programming pointers to improve this crude application. :angry2:
 
the GC website has a finder utility also if you have trouble getting the GC ip. also they say that the are going modular in the future so it will be interesting to see how it changes. i find some codes are hard to learn for the leaner even with a blaster.
 
Back
Top