programming Galil controller

khewes

Member
Join Date
May 2016
Location
New Hampshire
Posts
123
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
 
g.command() returns a string, and will tell you why it isn't working.

The simplest way to see what is going on is to do something like:
Code:
MsgBox(g.command("SH X"))
 
g.command() returns a string, and will tell you why it isn't working.

The simplest way to see what is going on is to do something like:
Code:
MsgBox(g.command("SH X"))

Thanks i figured it out, i was missing my argument in the button click sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
g.command("SB1")
End Sub
 

Similar Topics

Dear all, I have fx2n plc on my hand but I don't have the programming cable sc-09 and it would not be easy for me to get one. I need the cable...
Replies
3
Views
117
Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
20
Views
884
I need to pull the program off of an old 90-30 so I can convert it to Allen Bradley. This is my first time messing with GE and I don't have the...
Replies
2
Views
84
New to vfds. I put in parameters. IP, but I get ethernet flashing and link solid. What did I do wrong?
Replies
9
Views
474
I'm been deciphering a program for a press here. I've gotten most of it deciphered using the manual to understand the instructions (first mitsu...
Replies
11
Views
294
Back
Top Bottom