?? do.frm
字號:
VERSION 5.00
Object = "{DD19B926-A6A4-11D2-AA04-002018650913}#1.1#0"; "Addout.ocx"
Begin VB.Form DAQForm
BackColor = &H00E0E0E0&
BorderStyle = 3 'Fixed Dialog
Caption = "數字量輸出"
ClientHeight = 2655
ClientLeft = 870
ClientTop = 945
ClientWidth = 4650
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2655
ScaleWidth = 4650
ShowInTaskbar = 0 'False
Begin VB.CommandButton Cmdclose
Caption = "關閉指示燈"
Height = 375
Left = 3195
TabIndex = 4
Top = 930
Width = 1140
End
Begin VB.CommandButton Cmdopen
Caption = "打開指示燈"
Height = 375
Left = 3195
TabIndex = 3
Top = 315
Width = 1140
End
Begin VB.Frame Frame2
Caption = "控制指示"
Height = 2265
Left = 180
TabIndex = 2
Top = 210
Width = 2580
Begin VB.TextBox Text2
Height = 345
Left = 1440
TabIndex = 9
Top = 1740
Width = 855
End
Begin VB.TextBox Text1
Height = 345
Left = 1440
TabIndex = 8
Top = 1200
Width = 855
End
Begin VB.Label Label3
Caption = "關閉次數:"
Height = 285
Left = 240
TabIndex = 7
Top = 1830
Width = 1005
End
Begin VB.Label Label2
Caption = "打開次數:"
Height = 285
Left = 240
TabIndex = 6
Top = 1290
Width = 1005
End
Begin VB.Label Label1
Caption = "信號指示燈:"
Height = 285
Left = 240
TabIndex = 5
Top = 570
Width = 1215
End
Begin VB.Shape alarm
BackColor = &H00FFFFFF&
BorderColor = &H00404040&
FillColor = &H0080FF80&
FillStyle = 0 'Solid
Height = 675
Left = 1530
Shape = 2 'Oval
Top = 270
Width = 645
End
End
Begin VB.CommandButton Cmdquit
Caption = "關閉程序"
Height = 375
Left = 3195
TabIndex = 1
Top = 1560
Width = 1140
End
Begin DAQDOLib.DAQDO DAQDO1
Height = 495
Left = 3540
TabIndex = 0
Top = 2010
Width = 495
_Version = 65537
_ExtentX = 864
_ExtentY = 864
_StockProps = 0
MaxPortNumber = 0
End
End
Attribute VB_Name = "DAQForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'定義變量
Dim num1 As Integer '打開次數
Dim num2 As Integer '關閉次數
Dim zt As Integer '開關狀態
'程序初始化
Private Sub Form_Load()
DAQDO1.SelectDevice '選擇數字量輸出設備
DAQDO1.OpenDevice '打開數字量輸出端口
alarm.FillColor = QBColor(10) '報警指示燈初始顏色
zt = 1
End Sub
'打開指示燈
Private Sub Cmdopen_Click()
If zt = 1 Then
alarm.FillColor = QBColor(12)
DAQDO1.Bit = 1
DAQDO1.BitOutput (1)
num1 = num1 + 1
Text1.Text = Str(num1)
zt = 2
End If
End Sub
'關閉指示燈
Private Sub Cmdclose_Click()
If zt = 2 Then
alarm.FillColor = QBColor(10)
DAQDO1.Bit = 1
DAQDO1.BitOutput (0)
Text2.Text = Str(num2)
zt = 1
End If
End Sub
'關閉程序
Private Sub Cmdquit_Click()
DAQDO1.CloseDevice '關閉板卡數字量輸出端口
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -