khewes
Member
Good morning everyone,
I'm working on programming a galil controller using galil tools and a panel pc. I want to interface the HMI with the galil controller using windows form in visual basic format. The form connects to the controller but the controller does not respond to commands when a button is pressed. can anyone see any errors in my code? I added a galil reference to the form. The code is below, and attached is the project.
Public Class Form1
WithEvents g As New Galil.Galil
Private Sub Form1_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
g.address = "10.50.200.231"
Me.Text = g.connection
End Sub
'when button1 is clicked perform galil command
Private Sub button1_Click() Handles Button1.Click
'SET INPUT 1 HIGH ALL OTHER INPUTS LOW
g.command("SH X")
g.command("PR 1")
g.command("BG X")
End Sub
'when button2 is clicked perform galil command
Private Sub button2_Click() Handles Button2.Click
'SET INPUT 2 HIGH ALL OTHER INPUTS LOW
g.command("JP #DOORS")
End Sub
'when button3 is clicked perform galil command
Private Sub button3_Click() Handles Button3.Click
'Connect server and start motion
g.command("TI 04")
End Sub
'when button4 is clicked perform galil command
Private Sub button4_Click() Handles Button4.Click
'Connect server and start motion
g.command("TI 08 = 0")
End Sub
'when RESUME is clicked perform galil command
Private Sub button5_Click() Handles Button5.Click
'RESUME CODE WHERE LEFT OFF AFTER STOP COMMAND
g.command("BG XY")
End Sub
'when STOP is clicked perform galil command
Private Sub button6_Click() Handles Button6.Click
'STOP MOTION
g.command("ST")
End Sub
End Class
I'm working on programming a galil controller using galil tools and a panel pc. I want to interface the HMI with the galil controller using windows form in visual basic format. The form connects to the controller but the controller does not respond to commands when a button is pressed. can anyone see any errors in my code? I added a galil reference to the form. The code is below, and attached is the project.
Public Class Form1
WithEvents g As New Galil.Galil
Private Sub Form1_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
g.address = "10.50.200.231"
Me.Text = g.connection
End Sub
'when button1 is clicked perform galil command
Private Sub button1_Click() Handles Button1.Click
'SET INPUT 1 HIGH ALL OTHER INPUTS LOW
g.command("SH X")
g.command("PR 1")
g.command("BG X")
End Sub
'when button2 is clicked perform galil command
Private Sub button2_Click() Handles Button2.Click
'SET INPUT 2 HIGH ALL OTHER INPUTS LOW
g.command("JP #DOORS")
End Sub
'when button3 is clicked perform galil command
Private Sub button3_Click() Handles Button3.Click
'Connect server and start motion
g.command("TI 04")
End Sub
'when button4 is clicked perform galil command
Private Sub button4_Click() Handles Button4.Click
'Connect server and start motion
g.command("TI 08 = 0")
End Sub
'when RESUME is clicked perform galil command
Private Sub button5_Click() Handles Button5.Click
'RESUME CODE WHERE LEFT OFF AFTER STOP COMMAND
g.command("BG XY")
End Sub
'when STOP is clicked perform galil command
Private Sub button6_Click() Handles Button6.Click
'STOP MOTION
g.command("ST")
End Sub
End Class