请问这段代码什么意思? 点击:304 | 回复:0



luoyuanhong1986

    
发表于:2009-04-07 20:59:28
楼主

Private Sub Timer1_Timer()

Dim ChByte As Byte
Dim zerobyte
Dim zerotemp
Dim chbyte1 ‘As Byte
Dim ChByte2 ‘ As Byte
Dim ChByte3
mAddr = CLng(hextobcd("C6"))
mVal = hextobcd("60")
temp = CH365WriteIoByte(mAddr, mVal)

‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘
‘XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘
iAddr = hextobcd("81")
temp = CH365ReadIoByte(iAddr, chbyte1)

‘ Text1(0) = " " + str(ChByte)
iAddr = hextobcd("82")
temp = CH365ReadIoByte(iAddr, ChByte2)

‘ Text1(0) = Text1(0) + str(ChByte)
iAddr = hextobcd("83")
temp = CH365ReadIoByte(iAddr, ChByte3)

‘ Text1(0) = Text1(0) + str(ChByte)
xled = (chbyte1) + (ChByte2) * 256 + (ChByte3) * 256 * 256
If xled > 2000000 Then
xled = (chbyte1 - 255) + (ChByte2 - 255) * 256 + (ChByte3 - 255) * 256 * 256
End If
xled = xled * 0.001
Text1(0) = Format(xled - xabs, "0.000")


‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘
‘YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘
iAddr = hextobcd("84")
temp = CH365ReadIoByte(iAddr, chbyte1)
iAddr = hextobcd("85")
temp = CH365ReadIoByte(iAddr, ChByte2)
iAddr = hextobcd("86")
temp = CH365ReadIoByte(iAddr, ChByte3)

yled = (chbyte1) + (ChByte2) * 256 + (ChByte3) * 256 * 256
If yled > 2000000 Then
yled = (chbyte1 - 255) + (ChByte2 - 255) * 256 + (ChByte3 - 255) * 256 * 256
End If
Text1(1) = Format((yled - yabs) * 0.001, "0.000")

这是一段有关光栅尺的编程,请高人指点一下怎么理解?怎样读取光栅尺的位置啊,它的位置信息是放在哪个位置啊?



楼主最近还看过

SSI ļʱ