Hi
I wonder if somebody can tell me what is wrong with the following code::sign0085:
Sub Button2_Click
If Button2.Text="Read" Then
Label70.Left=3
DoEvents
If Main.PortOpen=0 Then
OpenPort
End If
If Main.PortOpen=1 Then
Button2.Text="Stop"
ReadStation("u")
End If
Else
Label70.Left=300
Button2.Text="Read"
End If
End Sub
Sub Button1_Click
Label70.Left=300
PolarFix.Close
End Sub
#End Region
#Region *********************************** Read Total Stations
Sub OpenPort
WaitCursor(True)
EndLine=Chr(13) & Chr(10)
su(1)="t" :su(2)="u" :su(3)="c" :su(4)=""
Serial1.New1
If Main.DF(3)=1 Then
'Leica
ErrorLabel(ConnectGPS_Err)
If Main.DF(4)<9 Then
Serial1.New2(Main.DF(32),2400,"E",7,2)
Else
Serial1.New2(Main.DF(32),2400,"E",7,1)
End If
End If
Serial1.PortOpen = True
Main.PortOpen=1
IntPort
Return
ConnectGPS_Err:
WaitCursor(False)
Msgbox("Error Opening Port: " & Main.DF(32),"Port Error",cMsgboxOK,cMsgboxHand)
Main.PortOpen=0
Label70.Left=300
End Sub
Sub IntPort
If Main.DF(3)=1 Then
'Leica Total Station
Serial1.Output("a" & EndLine)
Serial1.Output("?" & EndLine)
Serial1.Output("DSP/0/0/$METERS" & EndLine)
Serial1.Output("SET/476/2" & EndLine)
Serial1.Output("DSP/0/0/$SERIAL" & EndLine)
End If
WaitCursor(False)
End Sub
Sub ReadStation(R)
Dim Stcm
If Main.DF(3)=1 Then
'Leica Total Station
If Main.DF(4)>=3 Then ' t500,t1010,t1610
If R="u" Then
stcm="GET/M/WI11/WI21/WI22/WI31"
Else If R="t" Then
stcm="GET//WI11/WI21/WI22"
If Main.DF(4)=3 OR Main.DF(4)=9 Then
Serial1.Output("SET/160/0" & EndLine)
End If
End If
Serial1.Output(stcm & EndLine)
Else
Serial1.Output(R & EndLine)
End If
End If
End Sub
These are codes that I am trying to send to a Total Station (Survey Equipment) to read the angles and distance to a prism. I use the same code on a Workabout (from Psion) and it works! But on my Recon it does nothing! It does not even turn the total station on:sign0148:
Regards
Michael
I wonder if somebody can tell me what is wrong with the following code::sign0085:
Sub Button2_Click
If Button2.Text="Read" Then
Label70.Left=3
DoEvents
If Main.PortOpen=0 Then
OpenPort
End If
If Main.PortOpen=1 Then
Button2.Text="Stop"
ReadStation("u")
End If
Else
Label70.Left=300
Button2.Text="Read"
End If
End Sub
Sub Button1_Click
Label70.Left=300
PolarFix.Close
End Sub
#End Region
#Region *********************************** Read Total Stations
Sub OpenPort
WaitCursor(True)
EndLine=Chr(13) & Chr(10)
su(1)="t" :su(2)="u" :su(3)="c" :su(4)=""
Serial1.New1
If Main.DF(3)=1 Then
'Leica
ErrorLabel(ConnectGPS_Err)
If Main.DF(4)<9 Then
Serial1.New2(Main.DF(32),2400,"E",7,2)
Else
Serial1.New2(Main.DF(32),2400,"E",7,1)
End If
End If
Serial1.PortOpen = True
Main.PortOpen=1
IntPort
Return
ConnectGPS_Err:
WaitCursor(False)
Msgbox("Error Opening Port: " & Main.DF(32),"Port Error",cMsgboxOK,cMsgboxHand)
Main.PortOpen=0
Label70.Left=300
End Sub
Sub IntPort
If Main.DF(3)=1 Then
'Leica Total Station
Serial1.Output("a" & EndLine)
Serial1.Output("?" & EndLine)
Serial1.Output("DSP/0/0/$METERS" & EndLine)
Serial1.Output("SET/476/2" & EndLine)
Serial1.Output("DSP/0/0/$SERIAL" & EndLine)
End If
WaitCursor(False)
End Sub
Sub ReadStation(R)
Dim Stcm
If Main.DF(3)=1 Then
'Leica Total Station
If Main.DF(4)>=3 Then ' t500,t1010,t1610
If R="u" Then
stcm="GET/M/WI11/WI21/WI22/WI31"
Else If R="t" Then
stcm="GET//WI11/WI21/WI22"
If Main.DF(4)=3 OR Main.DF(4)=9 Then
Serial1.Output("SET/160/0" & EndLine)
End If
End If
Serial1.Output(stcm & EndLine)
Else
Serial1.Output(R & EndLine)
End If
End If
End Sub
These are codes that I am trying to send to a Total Station (Survey Equipment) to read the angles and distance to a prism. I use the same code on a Workabout (from Psion) and it works! But on my Recon it does nothing! It does not even turn the total station on:sign0148:
Regards
Michael