发表于:2004-03-18 19:27:00
2楼
Private Sub Command1_Click
gszSend = Space(100)
gszReceive = Space(100)
gw7000(0) = gcPort
gw7000(1) = Val("&H" & addressText.Text)
gw7000(2) = Val("&H" + cbModuleID.Text)
If chksumOption(0).Value Then
gw7000(3) = 1
Else
gw7000(3) = 0
End If
gw7000(4) = 1000
gw7000(5) = 0
Ret = AnalogInAll(gw7000(0), gf7000(0), gszSend, gszReceive)
If Ret <> 0 Then
Beep
A$ = "The Error Code:" + Str$(Ret) + Chr(13) + IGetErrorString(Ret)
MsgBox A$, 0, "AnalogIn8() error !!!"
End If
Text1.Text = Format$(gf7000(0), "0.###")
Text2.Text = Format$(gf7000(1), "0.###")
Text3.Text = Format$(gf7000(2), "0.###")
Text4.Text = Format$(gf7000(3), "0.###")
Text5.Text = Format$(gf7000(4), "0.###")
Text6.Text = Format$(gf7000(5), "0.###")
Text7.Text = Format$(gf7000(6), "0.###")
Text8.Text = Format$(gf7000(7), "0.###")
End Sub