IF you are going to use a old pc?? what do you need all that other stuff for?? this vb6 program I wrote in 2005 can read with a quadrature encoder (glass scales) or a serial digital caliper..
IF you want to go "blue tooth" and readout on a android bases tablet? I suggest purchasing the $60?? arduino mega 2560 I bought today, has a RN42 bluetooth module socket, and there is communication software on the net, and encoder reading software, and serial software.. and..
At one time, this vb6 software also ran power feed to "point" selected.. no clue which version this is thou. My software is in disarray.. too many pc crashes.
(HOW it works, you can find the communication subroutine with the chinese scales and perhaps adapt it's logic to your arduino) THE forum didn't want me to post the whole program for you.. if you want it, code or compiled and running under windows? lemme know..
'
Private Sub Read_X_scale()
Dim a$
MSComm1.PortOpen = True ' open the port using MSCOMM
a$ = MSComm1.Input
If a$ <> "" Then
X_pos = Val(a$) / 25.4
'ProgressBar1.Value = Val(a$)
End If
MSComm1.PortOpen = False ' close the port using MSCOMM
End Sub
Private Sub Read_Y_scale()
Dim a$
MSComm2.PortOpen = True ' open the port using MSCOMM
a$ = MSComm2.Input
If a$ <> "" Then
X_pos = Val(a$) / 25.4
'ProgressBar1.Value = Val(a$)
End If
MSComm1.PortOpen = False ' close the port using MSCOMM
End Sub
Private Sub end_but_Click() 'end button
pin_output = Out8255(port_address, 0) 'blip A off
Run_Flag = False
End
End Sub
Private Sub delay_mS_time(timetodelay)
Dim time_out As Single
Dim delayinMilliseconds
delayinMilliseconds = HScroll1.Value
' ding
time_out = delayinMilliseconds + timeGetTime()
Do Until time_out <= timeGetTime()
'Text8.Text = delayinMilliseconds
Loop
End Sub
Private Sub run_main() 'this sub reads/writes the io bits
Run_Flag = True
Dim j As Integer
x_pos_txt.Text = X_pos 'write it to the block on the screen before exit sub leaves
Y_pos_txt.Text = Y_pos
If x_target.Text = "" Then x_target.Text = "0"
If x_target.Text >= X_pos Then
X_frame.BackColor = swon
End If
If x_target.Text < X_pos And foot_pedal.Value = False Then
pin_output = Out8255(port_address, 0) 'blip A on/off
Else
pin_output = Out8255(port_address, 1) 'blip A on/off
End If
If x_target.Text < X_pos Then
X_frame.BackColor = swoff
x_pos_txt.Text = X_pos 'write it to the block on the screen before exit sub leaves
End If
If x_target.Text = "" Then x_target.Text = "0"
If y_target.Text = "" Then y_target.Text = "0"
If y_target.Text >= Y_pos Then
Y_frame.BackColor = swon
End If
If y_target.Text < Y_pos And foot_pedal.Value = False Then
pin_output = Out8255(port_address, 0) 'blip A on/off
Else
pin_output = Out8255(port_address, 2) 'blip A on/off
End If
If y_target.Text < Y_pos Then
Y_frame.BackColor = swoff
End If
delay_mS_time (2)
'PortValues(0) = In8255(Port_Address)
PortValues(1) = In8255(port_address + 1)
'PortValues(2) = In8255(Port_Address + 2)
Return_word.Text = PortValues(0) & " " & PortValues(1) & " " & PortValues(2)
' Msg = ""
' For j = 7 To 0 Step -1
' If (PortValues(0) And (2 ^ j)) > 0 Then
' Msg = Msg & "1"
' Else
' Msg = Msg & "0"
' End If
' Next
' Word_A.Text = Msg
Msg = ""
For j = 7 To 0 Step -1
If (PortValues(1) And (2 ^ j)) > 0 Then
Msg = Msg & "1"
Else
Msg = Msg & "0"
End If
Next
Word_B.Text = Msg
' Msg = ""
' For j = 7 To 0 Step -1
' If (PortValues(2) And (2 ^ j)) > 0 Then
' Msg = Msg & "1"
' Else
' Msg = Msg & "0"
' End If
' Next
' Word_C.Text = Msg
foot_pedal.Value = PortValues(1) And (2 ^ 5)
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'00,01,11,10 to right=cw, left = ccw
'****************** Conditional statements, get the bits of encoder************
X_Anew = Left$(Word_B.Text, 2)
'pick two left hand bits MSB?
'if serial box checked then 'do not use this sub.
'If Serial_X.Value = 0 Then
If X_Anew = X_Aold Then Exit Sub
If X_Anew = "00" And X_Aold = "10" Then 'CW
X_pos = X_pos + X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "01" And X_Aold = "00" Then
X_pos = X_pos + X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "11" And X_Aold = "01" Then
X_pos = X_pos + X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "10" And X_Aold = "11" Then
X_pos = X_pos + X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "00" And X_Aold = "01" Then 'ccw
X_pos = X_pos - X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "01" And X_Aold = "11" Then
X_pos = X_pos - X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "11" And X_Aold = "10" Then
X_pos = X_pos - X_incr
X_Aold = X_Anew
GoTo endofx
End If
If X_Anew = "10" And X_Aold = "00" Then
X_pos = X_pos - X_incr
X_Aold = X_Anew
GoTo endofx
End If
' Else
Read_X_scale 'send to subroutine to read the chinese scale
x_pos_txt.Text = X_pos 'set the returned value to reflect scale value
' End If
endofx: