这是一个“金钟”电子秤的接口 Public Declare Function commchinit Lib "commdch.dll" (ByVal i_com As Long) As Boolean Public Declare Sub commchend Lib "commdch.dll" (ByVal i_com As Long) Public Declare Function commchread Lib "commdch.dll" (ByVal i_com As Long) As Double Public comch As Long然后设置一个定时器 Private Sub Timer1_Timer() weight = commchread(comch) wstr = Str(weight) lblGross.Caption = wstr End Sub
电子称要看是什么接口。
Public Declare Function commchinit Lib "commdch.dll" (ByVal i_com As Long) As Boolean
Public Declare Sub commchend Lib "commdch.dll" (ByVal i_com As Long)
Public Declare Function commchread Lib "commdch.dll" (ByVal i_com As Long) As Double
Public comch As Long然后设置一个定时器
Private Sub Timer1_Timer()
weight = commchread(comch)
wstr = Str(weight)
lblGross.Caption = wstr
End Sub