VB程序详细的解释说明(数据采集卡的VB编程)
DimCh0AsStringDimAmAsIntegerDimT(31)AsDoubleDimChNAsStringPrivateSubCommand1_Click()C...
Dim Ch0 As String
Dim Am As Integer
Dim T(31) As Double
Dim ChN As String
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Dim retval As Integer
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Combo1_Click()
Select Case Combo1.ListIndex
Case 0
Am = 0
Case 1
Am = 1
Case 2
Am = 2
Case 3
Am = 3
Case 4
Am = 4
End Select
End Sub
Private Sub Command2_Click()
Call AM9110_WR8254(hPLX9052, 3, &H37&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 3, &H77&)
Call AM9110_WR8254(hPLX9052, 1, &H4&) '&H0&)
Call AM9110_WR8254(hPLX9052, 1, &H0&) '&H1&)
Call AM9110_WR8254(hPLX9052, 3, &HB6&) '&HB7&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H2&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H0&)
Timer2.Interval = 100
Timer2.Enabled = True
Command1.Enabled = False
Command9.Enabled = False
Command6.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command7.Enabled = False
Command5.Enabled = True
End Sub
Private Sub Command3_Click()
Dim data As Integer
data = Val("&H" + Text17.Text)
Call AM9110_DA(hPLX9052, 1, data)
End Sub
Private Sub Command4_Click()
Dim data As Integer
data = Val("&H" + Text24.Text)
Call AM9110_DA(hPLX9052, 0, data)
End Sub 展开
Dim Am As Integer
Dim T(31) As Double
Dim ChN As String
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Dim retval As Integer
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Combo1_Click()
Select Case Combo1.ListIndex
Case 0
Am = 0
Case 1
Am = 1
Case 2
Am = 2
Case 3
Am = 3
Case 4
Am = 4
End Select
End Sub
Private Sub Command2_Click()
Call AM9110_WR8254(hPLX9052, 3, &H37&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 3, &H77&)
Call AM9110_WR8254(hPLX9052, 1, &H4&) '&H0&)
Call AM9110_WR8254(hPLX9052, 1, &H0&) '&H1&)
Call AM9110_WR8254(hPLX9052, 3, &HB6&) '&HB7&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H2&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H0&)
Timer2.Interval = 100
Timer2.Enabled = True
Command1.Enabled = False
Command9.Enabled = False
Command6.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command7.Enabled = False
Command5.Enabled = True
End Sub
Private Sub Command3_Click()
Dim data As Integer
data = Val("&H" + Text17.Text)
Call AM9110_DA(hPLX9052, 1, data)
End Sub
Private Sub Command4_Click()
Dim data As Integer
data = Val("&H" + Text24.Text)
Call AM9110_DA(hPLX9052, 0, data)
End Sub 展开
2个回答
展开全部
Dim Ch0 As String ’定义字符串ch0
Dim Am As Integer 定义整数变量 am
Dim T(31) As Double '定义双精度数组
Dim ChN As String ’定义字符串chn
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False ’以上激活command1~7控件
Dim retval As Integer
Timer1.Interval = 1000 '时间控件间隔时间设为1000ms,也就是1s
Timer1.Enabled = True '激活控件timer1
End Sub
Private Sub Combo1_Click()
Select Case Combo1.ListIndex ’判断下拉列表框显示的是几号元素
Case 0 '如果是0号执行下面语句
Am = 0
Case 1
Am = 1
Case 2
Am = 2
Case 3
Am = 3
Case 4
Am = 4
End Select ’结束判断
End Sub
Private Sub Command2_Click()
'下面调用这个函数AM9110_WR8254()通过给不同的参数
Call AM9110_WR8254(hPLX9052, 3, &H37&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 3, &H77&)
Call AM9110_WR8254(hPLX9052, 1, &H4&) '&H0&)
Call AM9110_WR8254(hPLX9052, 1, &H0&) '&H1&)
Call AM9110_WR8254(hPLX9052, 3, &HB6&) '&HB7&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H2&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H0&)
Timer2.Interval = 100 ’同上
Timer2.Enabled = True
Command1.Enabled = False '使控件失效
Command9.Enabled = False
Command6.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command7.Enabled = False
Command5.Enabled = True
End Sub
Private Sub Command3_Click()
Dim data As Integer
data = Val("&H" + Text17.Text) ’把Text17中输入的数据当做16进制来处理
Call AM9110_DA(hPLX9052, 1, data) '调用子程序
End Sub
Private Sub Command4_Click()
Dim data As Integer
data = Val("&H" + Text24.Text)
Call AM9110_DA(hPLX9052, 0, data)
End Sub
Dim Am As Integer 定义整数变量 am
Dim T(31) As Double '定义双精度数组
Dim ChN As String ’定义字符串chn
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False ’以上激活command1~7控件
Dim retval As Integer
Timer1.Interval = 1000 '时间控件间隔时间设为1000ms,也就是1s
Timer1.Enabled = True '激活控件timer1
End Sub
Private Sub Combo1_Click()
Select Case Combo1.ListIndex ’判断下拉列表框显示的是几号元素
Case 0 '如果是0号执行下面语句
Am = 0
Case 1
Am = 1
Case 2
Am = 2
Case 3
Am = 3
Case 4
Am = 4
End Select ’结束判断
End Sub
Private Sub Command2_Click()
'下面调用这个函数AM9110_WR8254()通过给不同的参数
Call AM9110_WR8254(hPLX9052, 3, &H37&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 0, &H0&)
Call AM9110_WR8254(hPLX9052, 3, &H77&)
Call AM9110_WR8254(hPLX9052, 1, &H4&) '&H0&)
Call AM9110_WR8254(hPLX9052, 1, &H0&) '&H1&)
Call AM9110_WR8254(hPLX9052, 3, &HB6&) '&HB7&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H2&)
Call AM9110_WR8254(hPLX9052, 2, &HFF&) '&H0&)
Timer2.Interval = 100 ’同上
Timer2.Enabled = True
Command1.Enabled = False '使控件失效
Command9.Enabled = False
Command6.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command7.Enabled = False
Command5.Enabled = True
End Sub
Private Sub Command3_Click()
Dim data As Integer
data = Val("&H" + Text17.Text) ’把Text17中输入的数据当做16进制来处理
Call AM9110_DA(hPLX9052, 1, data) '调用子程序
End Sub
Private Sub Command4_Click()
Dim data As Integer
data = Val("&H" + Text24.Text)
Call AM9110_DA(hPLX9052, 0, data)
End Sub
2009-10-12
展开全部
其实,看看 数据采集卡 的说明书,看看 MSDN
什么都不是问题了
祝你顺利
什么都不是问题了
祝你顺利
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询