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

📄 modfunctions.bas

📁 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
💻 BAS
字号:
Attribute VB_Name = "modFunctions"
Option Explicit

'This Module contains the functions called in the threads.
'They have to be in a module because you have to use the AddressOf-
'function which will only work with public functions
Public ghDriver As Long
Public glDataBuf(10000) As Long
Public Const glBufferSize As Long = 10000# * 4

'API Declarations
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

'Public Function ShowMovingLine()
'    'Displays a line moving from the top of the PictureBox to the bottom
'    'in frmTest
'    Dim PosBuf As Integer
'    Dim TimeBuf As Long
'    Do
'        TimeBuf = timeGetTime
'        'Clear the PictureBox
'        frmTest.picOutput(0).Cls
'        'Paint the line into the PictureBox
'        frmTest.picOutput(0).Line (0, PosBuf)-(frmTest.picOutput(0).Width, PosBuf)
'
'        PosBuf = PosBuf + 1
'        If PosBuf > frmTest.picOutput(0).Height Then
'            'Set position back to the top of the PictureBox
'            PosBuf = 0
'        End If
'
'        'Wait some milliseconds...
'        Do While timeGetTime - TimeBuf < 5
'            Sleep 2
'        Loop
'    Loop
'End Function

Public Function ShowAnimation()
    'Displays a simple Animation using single pictures in frmTest
    Dim PicNumber As Integer
    Dim TimeBuf As Long
    
'''''''''''''''''''''''''''''''''''''''''''''''
' PCI-1755 testing

Dim tCheckEvent As PT_CheckEvent
Dim tEnableEvent As PT_EnableEvent
Dim usEventType As Integer
Dim l As Long, lErrCde As Long

'''''''''''''''''''''''''''''''''''''''''''''''
    
    
'   frmTest.txtGetAddress = DRV_GetAddress(usEventType)
'   l = DRV_GetAddress(usEventType)
'   tCheckEvent.EventType = l
'   tCheckEvent.Milliseconds = 500
   
    
'    Do
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'      lErrCde = DRV_CheckEvent(ghDriver, tCheckEvent)
''      frmTest.txtBufferReady.Text = lErrCde
'      If (usEventType = ADS_EVT_DO_LOBUFTRANS) Then
'        ' Lower half buffer data transferred.
'        frmTest.txtBufferReady = "Lower half buffer"
''        'Clear data ready flag
'        DRV_ClearFlag ghDriver, ADS_EVT_DO_UNDERRUN
'
'      ElseIf (usEventType = ADS_EVT_DO_HIBUFTRANS) Then
'        ' Higher half buffer data transferred.
'        frmTest.txtBufferReady = "Higher half buffer"
''        'Clear data ready flag
'        DRV_ClearFlag ghDriver, ADS_EVT_DO_UNDERRUN
'
'      ElseIf (usEventType = ADS_EVT_DO_UNDERRUN) Then
''        ' Fast DO underrun occur
''        ' Write Underrun counts
''        frmMain.txtOverrunCount.Text = Val(frmMain.txtOverrunCount.Text) + 1
'
''        'Clear Under-run flag
''        DRV_ClearFlag frmMain.ghDriver, ADS_EVT_DO_UNDERRUN
''      ElseIf (usEventType = ADS_EVT_DO_TERMINATED) Then
''        ' Fast DO function terminated.
'        frmTest.txtBufferReady = "Terminated !"
'
'
'      ElseIf (usEventType = ADS_EVT_NO_EVENT) Then
''        ' No any event at this checking event
''      Else
''      ' Non specified Event occured.
''      ' "Not presupposed event occur. Event ID = %xh\n", *tCheckEvent.EventType
'      End If
'
'      frmTest.txtErrCde.Text = frmTest.txtErrCde.Text + 1
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'        TimeBuf = timeGetTime
'        'Put the actual picture into the PictureBox
'        frmTest.picDisplay.Picture = frmTest.imgAnimation(PicNumber).Picture
'
'        PicNumber = PicNumber + 1
'        If PicNumber > 3 Then PicNumber = 0
''        Sleep (100)
'
''        'Wait some milliseconds...
''        Do While timeGetTime - TimeBuf < 5
''            Sleep 100
''        Loop
'    Loop
End Function

⌨️ 快捷键说明

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