|
does anyone have any idea on how to control the movements of a stepper motor interfaced into the computer's parallel port, through a php dynamic web page? the web server we are using is apache operating under windows xp...
i am going to insert our code...can anyone please help me to fix it:
'Option Explicit
Public checker As Integer Public i As Double Public k As Integer Public counter As Integer Private buffArr(0 To 100) As String Private toBeExec As String
Private Sub Form_Load() timerGetFile.Interval = 1000 timerGetFile.Enabled = True speed.Enabled = True End Sub Private Sub About_Click() msg$ = "Video Surveillance Alpha 1.0 " + Chr$(13) + Chr$(13) msg$ = msg$ + " by" + Chr$(13) msg$ = msg$ + Chr$(13) + "Joanne L. Bato" + Chr$(13) msg$ = msg$ + "Jane Glossil S. Ventorillo" + Chr$(13) MsgBox msg$, vbInformation, "User Guide..." End Sub
Private Sub Command1_Click() 'for clockwise Clockwise
End Sub Private Function Clockwise() Timer4.Interval = 30 Timer4.Enabled = True 'k = 0 'Timer4.Interval = 30 'Timer4.Enabled = True
End Function
Private Sub Command2_Click() 'counterClockwise counterClockwise
End Sub Private Function counterClockwise() Timer3.Interval = 30 Timer3.Enabled = True 'k = 0 'Timer3.Interval = 30 'Timer3.Enabled = True
End Function
Private Sub Command3_Click() 'up uP
End Sub Private Function uP()
Timer1.Interval = 30 Timer1.Enabled = True
End Function Private Sub Command4_Click() ' down DowN
End Sub Private Function DowN()
Timer2.Interval = 30 Timer2.Enabled = True
End Function Private Sub Command5_Click()
Call brake
End Sub
Private Function brake()
Timer2.Enabled = False Timer2.Interval = 0 Timer3.Enabled = False Timer3.Interval = 0 Timer1.Enabled = False Timer1.Interval = 0 Timer4.Enabled = False Timer4.Interval = 0 Out &H378, 2 ^ 0
End Function Private Sub Exit1_Click() Out &H378, 0 End Sub
Private Sub Form_Unload(Cancel As Integer)
MsgBox "Take a Look at this!", vbOKCancel, "taks..Taks!" End Sub
Private Sub speed_Timer()
txtSpeed.Text = getSpeed End Sub
Private Sub Timer1_Timer() Static n As Integer Out &H378, 2 ^ (n) n = n + 1 If n = 4 Then n = 0 End If End Sub
Private Sub Timer2_Timer()
Static n As Integer If n = 0 Then n = 4 End If Out &H378, 2 ^ (n - 1) n = n - 1
'Static n As Integer 'Out &H378, 2 ^ (n - 1) 'n = n - 1 'If n = 0 Then 'n = 4 'End If End Sub
Private Sub Timer3_Timer()
Static n As Integer
Out &H378, 2 ^ (n) If n = 0 Then n = 3 End If n = n + 1 If n = 8 Then n = 4 End If 'Static n As Integer
'If k = 0 Then 'Out &H378, 2 ^ (n) 'k = 3 'n = 4 'End If 'If n < 8 Then 'Out &H378, 2 ^ (n) 'Else 'n = 3 'End If 'n = n + 1 End Sub
Private Sub Timer4_Timer() Static n As Integer If k = 0 Then Out &H378, 2 ^ (n) k = 8 n = 7 End If If n > 3 Then Out &H378, 2 ^ (n) Else n = 8 End If n = n - 1 End Sub
'=================== Private Function getFromTxt() As String
Dim comFrmTxt, comm As String On Error Resume Next
Open "C:\xampp\htdocs\theonlooker\onLooker1.txt" For Input As #1 Input #1, comFrmTxt getFromTxt = comFrmTxt execComm (getFromTxt) 'Label3.Caption = comFrmTxt Close #1 End Function
Private Function getSpeed() As String
Dim comSpeed, sp As String On Error Resume Next
Open "C:\xampp\htdocs\theonlooker\speed.txt" For Input As #1 Input #1, comSpeed getSpeed = comSpeed 'Label3.Caption = comFrmTxt Close #1 End Function Private Function putToBuffer() As String Dim i, y As Integer
For y = 0 To 50 i = UBound(buffArr) buffArr(y) = y + 1 'toBeExec
Next
End Function
Private Sub execComm(exCom As String)
Dim toBeExec As String
toBeExec = exCom If (toBeExec = "down") Then Call DowN Label3.Caption = "Truedown" 'timerGetFile.Enabled = False End If If (toBeExec = "up") Then Call uP Label3.Caption = "upTrue" End If If (toBeExec = "clockwise") Then Call Clockwise Label3.Caption = "clockwise" End If If (toBeExec = "counter clockwise") Then Call counterClockwise Label3.Caption = "counter clockwise" End If If (toBeExec = "") Then Call brake Label3.Caption = "brake" End If End Sub
Private Sub timerGetFile_Timer() getFromTxt
End Sub
Private Sub txtSpeed_Change()
Dim speed As Integer speed = Val(txtSpeed.Text) Timer1.Interval = speed Timer2.Interval = speed Timer3.Interval = speed Timer4.Interval = speed End Sub
|