📄 frmfunchead.frm
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form FrmFuncHead
BackColor = &H8000000A&
BorderStyle = 3 'Fixed Dialog
Caption = "Reprot Head"
ClientHeight = 5640
ClientLeft = 45
ClientTop = 330
ClientWidth = 7395
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "FrmFuncHead.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5640
ScaleWidth = 7395
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton CmdNo
Caption = "No"
Height = 375
Left = 6000
TabIndex = 15
Top = 120
Width = 1095
End
Begin VB.CommandButton CmdYes
Caption = "Yes"
Height = 375
Left = 4440
TabIndex = 14
Top = 120
Width = 1215
End
Begin TabDlg.SSTab SSTab1
Height = 4695
Left = 120
TabIndex = 3
Top = 840
Width = 7215
_ExtentX = 12726
_ExtentY = 8281
_Version = 393216
Style = 1
Tabs = 1
TabsPerRow = 4
TabHeight = 520
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
TabCaption(0) = "Test Report"
TabPicture(0) = "FrmFuncHead.frx":030A
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Label2(0)"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "Label2(1)"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Label2(2)"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "Label2(3)"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "Label2(4)"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "Label2(5)"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).Control(6)= "TextID"
Tab(0).Control(6).Enabled= 0 'False
Tab(0).Control(7)= "TextWO"
Tab(0).Control(7).Enabled= 0 'False
Tab(0).Control(8)= "TextDate"
Tab(0).Control(8).Enabled= 0 'False
Tab(0).Control(9)= "TextVersion"
Tab(0).Control(9).Enabled= 0 'False
Tab(0).Control(10)= "TextType"
Tab(0).Control(10).Enabled= 0 'False
Tab(0).Control(11)= "TextEquipID"
Tab(0).Control(11).Enabled= 0 'False
Tab(0).ControlCount= 12
Begin VB.TextBox TextEquipID
Appearance = 0 'Flat
Height = 360
Left = 4080
TabIndex = 13
Top = 3360
Width = 2415
End
Begin VB.TextBox TextType
Appearance = 0 'Flat
Enabled = 0 'False
Height = 360
Left = 720
TabIndex = 11
Text = "Smart J"
Top = 3360
Width = 2415
End
Begin VB.TextBox TextVersion
Appearance = 0 'Flat
Enabled = 0 'False
Height = 360
Left = 4080
TabIndex = 8
Text = "V1.0"
Top = 2520
Width = 2415
End
Begin VB.TextBox TextDate
Appearance = 0 'Flat
Enabled = 0 'False
Height = 360
Left = 720
TabIndex = 5
Top = 2520
Width = 2415
End
Begin VB.TextBox TextWO
Appearance = 0 'Flat
Height = 360
Left = 720
MaxLength = 7
TabIndex = 1
Top = 1680
Width = 2415
End
Begin VB.TextBox TextID
Appearance = 0 'Flat
Height = 360
Left = 720
MaxLength = 3
TabIndex = 0
Top = 840
Width = 2415
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Test equipment ID:"
ForeColor = &H00C00000&
Height = 240
Index = 5
Left = 4080
TabIndex = 12
Top = 3000
Width = 1785
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Type of tested product:"
ForeColor = &H00C00000&
Height = 240
Index = 4
Left = 720
TabIndex = 10
Top = 3000
Width = 2205
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Test software version:"
ForeColor = &H8000000C&
Height = 240
Index = 3
Left = 4080
TabIndex = 9
Top = 2160
Width = 2085
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Tester date and test time:"
ForeColor = &H8000000C&
Height = 240
Index = 2
Left = 720
TabIndex = 7
Top = 2160
Width = 2430
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Tester product internal work order number:"
ForeColor = &H00FF0000&
Height = 240
Index = 1
Left = 720
TabIndex = 6
Top = 1320
Width = 4065
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Tester Id:"
ForeColor = &H00FF0000&
Height = 240
Index = 0
Left = 720
TabIndex = 4
Top = 480
Width = 900
End
End
Begin VB.Label Label3
Caption = "Label3"
Height = 375
Left = 3120
TabIndex = 16
Top = 840
Visible = 0 'False
Width = 855
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Function Test Info"
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 120
TabIndex = 2
Top = 120
Width = 2130
End
Begin VB.Line Line1
BorderColor = &H8000000C&
BorderWidth = 2
X1 = 120
X2 = 7200
Y1 = 600
Y2 = 600
End
End
Attribute VB_Name = "FrmFuncHead"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Function bolWritePlcB_05(ByVal iDeviceID As Integer, ByVal iAddr As Integer, ByVal iSetValue As Integer) As Boolean
'作者:Henry
'目的:
' 写入传入字符串至Plc,可选定地址
'传入:
' iFuncIndex:功能号
' iAddr:欲写入数据的起始地址
' iSetValue:欲强制的状态(&HFF or &H00)
'传回:
' True:成功
' False:失败
' 有应答正确性检核
Dim sTime, cTime As Single
Dim Dummy As Integer
Dim vSndAry As Variant
Dim iSndLen As Integer
Dim vRetAry As Variant
Dim vCrcAry As Variant
Dim i As Integer
Dim bHeadAry(5) As Byte
Dim k As Long, m As Long
On Error GoTo WritePlcErr
bHeadAry(0) = iDeviceID
bHeadAry(1) = 5
bHeadAry(2) = iAddr \ 256
bHeadAry(3) = iAddr Mod 256 - 1
bHeadAry(4) = iSetValue
bHeadAry(5) = 0
iSndLen = 8 '9 + iLenB - 1
ReDim vSndAry(0 To iSndLen - 1)
vSndAry = CmbAryB(bHeadAry, CrcB(bHeadAry, 6))
If FrmFuncTest.ReadCom.PortOpen = False Then
FrmFuncTest.ReadCom.PortOpen = True
End If
'clear input/output buffer
FrmFuncTest.ReadCom.InBufferCount = 0
FrmFuncTest.ReadCom.OutBufferCount = 0
'write to output buffer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -