⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rt3dim.bas

📁 实现图像控制,云台解码器控制,站点选择(配有Access数据库).
💻 BAS
字号:
Attribute VB_Name = "Module1"
Global DB1 As Database
Global db1RS1 As Recordset
Global db1RS2 As Recordset
Global db1RS3 As Recordset
Global db1RS4 As Recordset
Global db1RS5 As Recordset
Global db1RS6 As Recordset
Global db1RS7 As Recordset
Global db1RS8 As Recordset
Global db1RS9 As Recordset
Global a(10) As Byte
Global ck As Integer
Global ckr As Integer
Global station As Integer
Global controller As Integer
Global camera As Integer
Global inrt As Integer
Global flagdelay As Integer
Global flagm As Integer
Global flagkey01(7) As Boolean
Global flaghuifu As Boolean
Global tm1(7) As Byte
Global tmindex(7) As Byte
Global tm2 As Byte
Global f(1 To 16) As Byte      'change to two dimension
Global mcu(7, 16) As Byte
Global mcur(7, 1 To 16) As Byte
Global cmrsta(1 To 16, 4, 16) As Byte
Global yt(1 To 16, 4, 1 To 16) As Byte
Global kstr123(1 To 16, 4, 1 To 16) As String

Public strLogFilePath As String

Public LastUserName As String
Public regTitle As String
Public regSection As String


Sub Sendcommand2d()                         '设定某相机参与自动巡显的定时器值
    a(0) = &HFD
    a(1) = &H7
    a(2) = CByte(station)
    a(3) = CByte(controller)
    a(4) = &H2
    a(5) = CByte(camera)
'    a(6) = CByte(tm2)
    ck = (256 - a(0) - a(1) - a(2) - a(3) - a(4) - a(5) - a(6)) Mod 256
    If ck < 0 Then ck = ck + 256
    a(7) = CByte(ck)
    FrmRt3.Comm1.Output = a()
'    FrmRt3.Text1.Text = Str(a(0)) & Str(a(1)) & Str(a(2)) & Str(a(3)) & Str(a(4)) & Str(a(5)) & Str(a(6)) & Str(a(7))
End Sub

Sub Sendcommand2e()
    a(0) = &HFE
    a(1) = &H6
    a(2) = CByte(station)
    a(3) = &H2
    a(4) = CByte(camera)
'    a(5) = CByte(tm2)
    ck = (256 - a(0) - a(1) - a(2) - a(3) - a(4) - a(5)) Mod 256
    If ck < 0 Then ck = ck + 256
    a(6) = CByte(ck)
    FrmRt3.Comm1.Output = a()
'    FrmRt3.Text1.Text = Str(a(0)) & Str(a(1)) & Str(a(2)) & Str(a(3)) & Str(a(4)) & Str(a(5)) & Str(a(6))
End Sub

Sub sendcommand1m(ByVal nowroute As Integer, ByVal e1 As Integer)
    a(0) = &HFF
    a(1) = 6
    a(2) = 1
    a(3) = 1
    a(4) = nowroute + 1
    a(5) = e1
    ck = (256 - a(0) - a(1) - a(2) - a(3) - a(4) - a(5)) Mod 256
    If ck < 0 Then ck = ck + 256
    a(6) = CByte(ck)
    FrmRt3.Comm1.Output = a()
    
'    FrmRt3.Text1.Text = Str(a(0)) & Str(a(1)) & Str(a(2)) & Str(a(3)) & Str(a(4)) & Str(a(5)) & Str(a(6))
End Sub
Sub sendcommand3mon(ByVal nowroute As Integer)
    a(0) = &HFF
    a(1) = 6
    a(2) = 1
    a(3) = 3
    a(4) = nowroute + 1
    a(5) = 1
    ck = (256 - a(0) - a(1) - a(2) - a(3) - a(4) - a(5)) Mod 256
    If ck < 0 Then ck = ck + 256
    a(6) = CByte(ck)
    FrmRt3.Comm1.Output = a()
'    FrmRt3.Text1.Text = Str(a(0)) & Str(a(1)) & Str(a(2)) & Str(a(3)) & Str(a(4)) & Str(a(5)) & Str(a(6))
End Sub
Sub sendcommand3moff(ByVal nowroute As Integer)
    a(0) = &HFF
    a(1) = 6
    a(2) = 1
    a(3) = 3
    a(4) = nowroute + 1
    a(5) = 2
    ck = (256 - a(0) - a(1) - a(2) - a(3) - a(4) - a(5)) Mod 256
    If ck < 0 Then ck = ck + 256
    a(6) = CByte(ck)
    FrmRt3.Comm1.Output = a()
'    FrmRt3.Text1.Text = Str(a(0)) & Str(a(1)) & Str(a(2)) & Str(a(3)) & Str(a(4)) & Str(a(5)) & Str(a(6))
End Sub

Sub sendcommand4m(ByVal nowroute As Integer)
'    Dim jnn As Integer
    a(0) = &HFF
    a(1) = &HA
    a(2) = 1
    a(3) = 4
    a(4) = nowroute + 1
    a(5) = tm1(nowroute)
'    FrmRt3.Text1.Text = a(5)
    a(6) = 0
    For jnn = 1 To 4
    If mcu(nowroute, jnn) <> 0 Then a(6) = a(6) + 2 ^ (jnn - 1)
    Next jnn
    a(7) = 0
    For jnn = 5 To 8
    If mcu(nowroute, jnn) <> 0 Then a(7) = a(7) + 2 ^ (jnn - 5)
    Next jnn
    a(8) = 0
    For jnn = 9 To 12
    If mcu(nowroute, jnn) <> 0 Then a(8) = a(8) + 2 ^ (jnn - 9)
    Next jnn
    a(9) = 0
    For jnn = 13 To 16
    If mcu(nowroute, jnn) <> 0 Then a(9) = a(9) + 2 ^ (jnn - 13)
    Next jnn
    ck = (256 - a(0) - a(1) - a(2) - a(3) - a(4) - a(5) - a(6) - a(7) - a(8) - a(9)) Mod 256
    If ck < 0 Then ck = ck + 256
    a(10) = CByte(ck)
    FrmRt3.Comm1.Output = a()
'    FrmRt3.Text1.Text = Str(a(0)) & Str(a(1)) & Str(a(2)) & Str(a(3)) & Str(a(4)) & Str(a(5)) & Str(a(6)) & Str(a(7)) & Str(a(8)) & Str(a(9)) & Str(a(10))
End Sub

Sub delay()
    flagdelay = 0
    FrmRt3.Timer1.Enabled = True
    Do
    DoEvents
    Loop Until flagdelay = 1
    FrmRt3.Timer1.Enabled = False
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -