mainfrm.frm
来自「16 relay output channels and 16 isolated」· FRM 代码 · 共 780 行 · 第 1/2 页
FRM
780 行
VERSION 5.00
Begin VB.Form MainForm
Caption = "DIO_SOFT_PORTS"
ClientHeight = 8055
ClientLeft = 60
ClientTop = 450
ClientWidth = 4275
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 8055
ScaleWidth = 4275
StartUpPosition = 3 'Windows Default
Begin VB.Frame Group_DOState
Caption = "DO Ports State: "
Height = 1935
Left = 120
TabIndex = 27
Top = 6000
Width = 3975
Begin VB.CommandButton BtnGetDOState
Caption = "Get DO State"
Enabled = 0 'False
Height = 495
Left = 2520
TabIndex = 31
Top = 360
Width = 1215
End
Begin VB.TextBox DOSPortCount
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 285
Left = 1080
TabIndex = 30
Text = "1"
Top = 720
Width = 1095
End
Begin VB.TextBox DOSPortStart
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 285
Left = 1080
TabIndex = 29
Text = "0"
Top = 360
Width = 1095
End
Begin VB.TextBox DOSData
BackColor = &H8000000F&
Height = 285
Left = 840
Locked = -1 'True
TabIndex = 28
Top = 1200
Width = 2535
End
Begin VB.Label Labe1
Caption = "Ports Count:"
Height = 255
Left = 120
TabIndex = 36
Top = 720
Width = 975
End
Begin VB.Label Labe2
Caption = "Start Port: "
Height = 255
Left = 120
TabIndex = 35
Top = 360
Width = 975
End
Begin VB.Label Labe3
Caption = "DOState: "
Height = 255
Left = 120
TabIndex = 34
Top = 1200
Width = 735
End
Begin VB.Label Labe4
Caption = "Hex"
Height = 255
Left = 3480
TabIndex = 33
Top = 1320
Width = 375
End
Begin VB.Label Labe5
Caption = "Start ----------------------> Start + Count"
Height = 255
Left = 840
TabIndex = 32
Top = 1560
Width = 2535
End
End
Begin VB.Frame Group_DO
Caption = "Write Ports: "
Height = 1935
Left = 120
TabIndex = 18
Top = 3960
Width = 3975
Begin VB.CommandButton BtnWrite
Caption = "Wrtie"
Enabled = 0 'False
Height = 495
Left = 2520
TabIndex = 22
Top = 360
Width = 1215
End
Begin VB.TextBox DOPortCount
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 285
Left = 1080
TabIndex = 21
Text = "1"
Top = 720
Width = 1095
End
Begin VB.TextBox DOPortStart
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 285
Left = 1080
TabIndex = 20
Text = "0"
Top = 360
Width = 1095
End
Begin VB.TextBox DOData
Height = 285
Left = 840
TabIndex = 19
Text = "AA"
Top = 1200
Width = 2535
End
Begin VB.Label Label18
Caption = "Start ----------------------> Start + Count"
Height = 255
Left = 840
TabIndex = 37
Top = 1560
Width = 2535
End
Begin VB.Label Labe6
Caption = "Ports Count:"
Height = 255
Left = 120
TabIndex = 26
Top = 720
Width = 975
End
Begin VB.Label Labe7
Caption = "Start Port: "
Height = 255
Left = 120
TabIndex = 25
Top = 360
Width = 975
End
Begin VB.Label Labe8
Caption = "DOData: "
Height = 255
Left = 120
TabIndex = 24
Top = 1200
Width = 615
End
Begin VB.Label Labe9
Caption = "Hex"
Height = 255
Left = 3480
TabIndex = 23
Top = 1320
Width = 375
End
End
Begin VB.Frame Group_DI
Caption = "Read Ports: "
Height = 1935
Left = 120
TabIndex = 8
Top = 1920
Width = 3975
Begin VB.TextBox DIData
BackColor = &H8000000F&
Height = 285
Left = 840
Locked = -1 'True
TabIndex = 15
Top = 1200
Width = 2535
End
Begin VB.TextBox DIPortStart
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 285
Left = 1080
TabIndex = 11
Text = "0"
Top = 360
Width = 1095
End
Begin VB.TextBox DIPortCount
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 285
Left = 1080
TabIndex = 10
Text = "1"
Top = 720
Width = 1095
End
Begin VB.CommandButton BtnRead
Caption = "Read"
Enabled = 0 'False
Height = 495
Left = 2520
TabIndex = 9
Top = 360
Width = 1215
End
Begin VB.Label Label0
Caption = "Start ----------------------> Start + Count"
Height = 255
Left = 840
TabIndex = 17
Top = 1560
Width = 2535
End
Begin VB.Label Label1
Caption = "Hex"
Height = 255
Left = 3480
TabIndex = 16
Top = 1320
Width = 375
End
Begin VB.Label Label2
Caption = "DIData: "
Height = 255
Left = 240
TabIndex = 14
Top = 1200
Width = 615
End
Begin VB.Label Label3
Caption = "Start Port: "
Height = 255
Left = 120
TabIndex = 13
Top = 360
Width = 975
End
Begin VB.Label Label4
Caption = "Ports Count:"
Height = 255
Left = 120
TabIndex = 12
Top = 720
Width = 975
End
End
Begin VB.Frame Group_Dev
Caption = "Device Setting: "
Height = 1695
Left = 120
TabIndex = 0
Top = 120
Width = 3975
Begin VB.CommandButton BtnOpenDev
Caption = "Open Device"
Height = 495
Left = 2520
TabIndex = 7
Top = 840
Width = 1215
End
Begin VB.TextBox DOPorts
BackColor = &H8000000F&
Height = 285
Left = 1080
Locked = -1 'True
TabIndex = 6
Top = 1200
Width = 1095
End
Begin VB.TextBox DIPorts
BackColor = &H8000000F&
Height = 285
Left = 1080
Locked = -1 'True
TabIndex = 5
Top = 840
Width = 1095
End
Begin VB.ComboBox CmbDevList
Height = 315
Left = 840
TabIndex = 2
Top = 360
Width = 3015
End
Begin VB.Label Label5
Caption = "DOPorts:"
Height = 255
Left = 240
TabIndex = 4
Top = 1200
Width = 735
End
Begin VB.Label Label6
Caption = "DI Ports: "
Height = 255
Left = 240
TabIndex = 3
Top = 840
Width = 615
End
Begin VB.Label Label7
Caption = "Device: "
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 615
End
End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'declare the variables
'The program supports only 255 devices. If you have more devices, please modify the const variable.
Const MAX_ENTRIES = 255
Private m_lDIPortCount As Long
Private m_lDOPortCount As Long
Private m_DevNumList(0 To MAX_ENTRIES) As Integer
Private m_lDevHandle As Long
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?