📄 frmio.frm
字号:
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 18
Left = 5760
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 17
Left = 5160
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 16
Left = 4560
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 15
Left = 3960
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 14
Left = 3360
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 13
Left = 2760
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 12
Left = 2160
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 11
Left = 1560
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 10
Left = 960
Shape = 3 'Circle
Top = 1560
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 9
Left = 6360
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 8
Left = 5760
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Label Label1
Caption = "23 路输入SD1 EL1- EL1+ ORG1 SD2 EL2- EL2+ ORG2 SD3 EL3-"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 6585
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 0
Left = 960
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 1
Left = 1560
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 2
Left = 2160
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 3
Left = 2760
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 4
Left = 3360
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 5
Left = 3960
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 6
Left = 4560
Shape = 3 'Circle
Top = 720
Width = 255
End
Begin VB.Shape shpMainIN
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 255
Index = 7
Left = 5160
Shape = 3 'Circle
Top = 720
Width = 255
End
End
Begin VB.Timer Timer1
Interval = 100
Left = 6960
Top = 3120
End
Begin VB.Label Label11
Caption = "号卡"
Height = 255
Left = 2400
TabIndex = 39
Top = 75
Width = 495
End
Begin VB.Label Label10
Caption = "演示卡号:"
Height = 255
Left = 480
TabIndex = 38
Top = 75
Width = 975
End
Begin VB.Label Label9
Caption = "说明:绿色--低电平;红色--高电平;蓝色--错误"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 12
Top = 9000
Width = 6375
End
Begin VB.Line Line1
X1 = 240
X2 = 7080
Y1 = 1440
Y2 = 1440
End
End
Attribute VB_Name = "frmIO"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim CurBoardNum As Long
'Dim IOSignal(40) As Long
Dim MainIn(100) As Long '原为25
Dim ExIn(80) As Long '原为15
Dim Out(100) As Long '原为23
Private Sub UpdateInterface()
Dim i As Long
For i = 0 To 22
If MainIn(i) = 0 Then
shpMainIN(i).FillColor = vbGreen
ElseIf MainIn(i) = 1 Then
shpMainIN(i).FillColor = vbRed
Else
shpMainIN(i).FillColor = vbBlue
End If
Next i
For i = 0 To 18
If ExIn(i) = 0 Then
shpExIN(i).FillColor = vbGreen
ElseIf ExIn(i) = 1 Then
shpExIN(i).FillColor = vbRed
Else
shpExIN(i).FillColor = vbBlue
End If
Next i
'IOOutSignal
End Sub
Private Sub IOInSignal()
Dim i As Long
For i = 0 To 22
MainIn(i) = check_sfr_bit(CurBoardNum, i + 1)
Next i
For i = 0 To 18
ExIn(i) = checkin_bit(CurBoardNum, i + 1)
Next i
End Sub
Public Sub IOOutSignal()
Dim i As Long
Dim iOut(23) As Long
For i = 0 To 23
iOut(i) = Out((CurBoardNum - 1) * 24 + i)
Next i
For i = 0 To 23
outport_bit CurBoardNum, i + 1, iOut(i)
If iOut(i) = 0 Then
cmdOut(i).BackColor = vbGreen
ElseIf iOut(i) = 1 Then
cmdOut(i).BackColor = vbRed
Else
cmdOut(i).BackColor = vbBlue
End If
Next i
End Sub
Private Sub cmbTestBoardID_Click()
Dim i As Long
If cmbTestBoardID.ListIndex = 0 Then
CurBoardNum = 1
Else
CurBoardNum = cmbTestBoardID.Text
End If
IOOutSignal
End Sub
Private Sub cmdOut_Click(Index As Integer)
Out((CurBoardNum - 1) * 24 + Index) = 1 - Out((CurBoardNum - 1) * 24 + Index)
IOOutSignal
End Sub
Private Sub Form_Load()
Dim i As Long
cmbTestBoardID.Clear
If glTotalCards < 1 Then
cmbTestBoardID.AddItem 0
Else
For i = 1 To glTotalCards
cmbTestBoardID.AddItem i
Next i
'If CurBoardNum > 0 Then cmbTestBoardID.ListIndex = 0
End If
cmbTestBoardID.ListIndex = 0
CurBoardNum = 1
For i = 0 To 100 '15
Out(i) = 1
Next i
IOOutSignal
End Sub
Private Sub Timer1_Timer()
IOInSignal
UpdateInterface
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -