- Install GalilTools version 126.96.36.199 or newer on Windows XP or newer. Lite is free of charge, the full version required a purchased password. Either is fine for this walkthrough.
- Connect to the controller using GalilTools
- Open Microsoft Visual Basic .Net 2010 Express, select File | New Project | Windows Forms Application and type "Hello_Galil" for the name. Click OK.
- Add a Label to the form by double clicking "Label" under "All Windows Forms" in the Toolbox.
- In the Solution Explorer window, right click "Hello_Galil" and choose "Add Reference". The Reference dialog may take a few moments to populate.
- Click the COM tab. Find "Galil" in the list. Highlight it and click OK.
- Double click on the title bar of the form to enter the code section.
- Enter the following code in the public Class Form1:
Dim WithEvents g As New Galil.Galil
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = g.libraryVersion() + vbCrLf
g.address = ""
Label1.Text = Label1.Text + g.connection() + vbCrLf
Label1.Text = Label1.Text + "MG TIME " + g.commandValue("MG TIME").ToString + vbCrLf
Catch ex As Runtime.InteropServices.COMException
Label1.Text = Label1.Text + ex.Message
- Push F5 to compile and run the application. The program will display the connections dialog, identical to GalilTools. Choose the same controller you connected to in step (2). The output should be similar to:
192.168.1.155, RIO47100 Rev 1.0c1, 1155, IHA IHB
MG TIME 4799941
The Form 1 output shows:
This indicates that the connection was successful.
On earlier times, the Windows Firewall screen also showed up. I gave it full privileges, then the next time, the screen did not appear when running the program.