亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? frmmain.frm

?? Serial Port Complete, Programming and Circuits for RS-232 and RS-485 Links and Networks
?? FRM
?? 第 1 頁 / 共 2 頁
字號:
End Sub

Sub DisableTransmitter()
'Set RTS true (high) to disable the RS485 transmitter
'by bringing its chip-enable low.
'Assumes that a second RS-232 receiver inverts RTS.
MSComm1.RTSEnable = True
End Sub

Sub EnableTransmitter(EnableDelay As Single)
'Set RTS false (low) to enable the RS485 transmitter.
'Assumes that a second RS-232 receiver has inverted RTS.
'Delay in milliseconds allows remote node to disable its transmitter.
Call Delay(EnableDelay)
MSComm1.RTSEnable = False
'Windows delay:
Call Delay(RTSDelay)
End Sub

Private Sub Form_Load()
Show
Call GetSettings
Call Startup
Load frmPortSettings
Load frmNodes
TransferInProgress = False
tmrTimeout.Interval = ReplyDelay
tmrTransferInterval.Enabled = False
tmrTimeout.Enabled = False
TimedOut = False
Call InitializeDisplayElements
SaveDataInFile = False
Call InitializeNodes
Call GetNewNodeSettings
'The master's transmitter is enabled,
'except when receiving replies.
Call EnableTransmitter(0)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call ShutDown
Unload frmNodes
Unload frmDataFile
Unload frmPortSettings
Close #2
End
End Sub

Private Sub GetDataToSend(NodeNumber As Integer)
'Dummy data for testing: the current hour and minute.
Dim CurrentTime As String
CurrentTime = CStr(Format(Time, "nnss"))
Nodes.DataOut1(NodeNumber) = Val(Left(CurrentTime, 2))
Nodes.DataOut2(NodeNumber) = Val(Right(CurrentTime, 2))
End Sub

Public Sub GetNewNodeSettings()
'Store user changes made on the Nodes form.
Dim Count As Integer
    Nodes.Address(0) = CInt("&h" & frmNodes.cboAddress(0).Text)
For Count = 1 To 7
    Nodes.Cpu(Count) = frmNodes.cboCPU(Count).Text
    Nodes.Address(Count) = CInt("&h" & frmNodes.cboAddress(Count).Text)
    Nodes.Active(Count) = frmNodes.chkNodeActive(Count).Value
Next Count
End Sub

Private Sub InitializeDisplayElements()
optSingleOrContinuous(0).Value = True
optIntervalUnits(0).Value = True
cboIntervalValue.ListIndex = 0
rtxStatus.Locked = True
rtxStatus.Text = ""
DataTransferFormat.IntervalValue = 1
cmdStop.Enabled = False
End Sub

Private Sub InitializeNodes()
Dim Count As Integer
For Count = 0 To HighestNodeNumber
    Nodes.DataIn1(Count) = 0
    Nodes.DataIn2(Count) = 0
    Nodes.Status(Count) = ""
    Nodes.LastAccess(Count) = ""
    Nodes.Cpu(Count) = ""
Next Count
Call UpdateDisplay
End Sub

Private Sub mnuDataFile_Click(Index As Integer)
frmDataFile.Show
End Sub

Private Sub mnuNodes_Click(Index As Integer)
frmNodes.Show
End Sub

Private Sub mnuPortSettings_Click(Index As Integer)
frmPortSettings.Show
End Sub

Private Sub MSComm1_OnComm()
'Handles all Comm events
Dim ErrorMessage As String
Select Case MSComm1.CommEvent
    'Handle each event or error by placing
    'code below each case statement
    
    'Errors
    Case comEventBreak
        ErrorMessage = "A Break was received."
    Case comEventCDTO
        ErrorMessage = "CD (RLSD) Timeout."
    Case comEventCTSTO
        ErrorMessage = "CTS Timeout."
    Case comEventDSRTO
        ErrorMessage = "DSR Timeout."
    Case comEventFrame
        ErrorMessage = "Framing Error"
    Case comEventOverrun
        ErrorMessage = "Overrun; data Lost."
    Case comEventRxOver
        ErrorMessage = "Receive buffer overflow."
    Case comEventRxParity
        ErrorMessage = "Parity Error."
     Case comEventTxFull
        ErrorMessage = "Transmit buffer full."
     Case comEventDCB
        ErrorMessage = "Unexpected error retrieving DCB."

    ' Events
    Case comEvCD
        ErrorMessage = "Change in the CD line."
    Case comEvCTS
        ErrorMessage = "Change in the CTS line."
    Case comEvDSR
        ErrorMessage = "Change in the DSR line."
    Case comEvRing
        ErrorMessage = "Change in the RI line."
     Case comEvReceive
        ErrorMessage = "Receive buffer has RThreshold number of characters."
     Case comEvSend
        ErrorMessage = "Transmit buffer has SThreshold number of characters."
     Case comEvEOF
        ErrorMessage = "EOF character (1Ah) received."
End Select
'Use for debuggging:
'Debug.Print ErrorMessage
End Sub

Private Sub optIntervalUnits_Click(Index As Integer)
'Set the interval combo box to match the units selected.
Dim Maximum As Integer
Dim Count As Integer
Select Case Index
    Case 0
        Maximum = 59
        DataTransferFormat.IntervalUnits = "seconds"
    Case 1
        Maximum = 59
        DataTransferFormat.IntervalUnits = "minutes"
    Case 2
        Maximum = 24
        DataTransferFormat.IntervalUnits = "hours"
End Select
cboIntervalValue.Clear
For Count = 1 To Maximum
    cboIntervalValue.AddItem CStr(Count)
Next Count
cboIntervalValue.ListIndex = 0
End Sub

Private Sub optPollUnits_Click(Index As Integer)
'Set the combo box items to match the units selected.
Dim Maximum As Integer
Dim Count%
Select Case Index
    Case 0, 1
        'seconds, minutes
        Maximum = 59
    Case 2
        'hours
        Maximum = 24
End Select
End Sub

Private Sub optSingleOrContinuous_Click(Index As Integer)
Select Case Index
    Case 0
        DataTransferFormat.SingleOrContinuous = "single"
        'Disable interval selection:
        optIntervalUnits(0).Enabled = False
        optIntervalUnits(1).Enabled = False
        optIntervalUnits(2).Enabled = False
    Case 1
        DataTransferFormat.SingleOrContinuous = "continuous"
        'Enable interval selection:
        optIntervalUnits(0).Enabled = True
        optIntervalUnits(1).Enabled = True
        optIntervalUnits(2).Enabled = True
End Select
End Sub

Private Sub PollSlave()
'Send the node address & wait for Acknowledge.
'If Ack received, send data, wait for reply.
'Store the results.
Dim AckReceived As Boolean
Dim ReplyReceived As Boolean
Dim NumberOfTries As Integer
Dim LastNode As Integer
Dim Count As Integer
Dim MessageToSend As Variant
Dim AttemptNumber As Integer
Dim TransmitFinished As Boolean
Dim Buffer As Variant
TransferInProgress = True
For Count = 1 To HighestNodeNumber
'Skip the node if it isn't selected (Active) on the Nodes form.
    If Nodes.Active(Count) = 1 Then
        'Clear the transmit and receive buffers
        MSComm1.OutBufferCount = 0
        Buffer = MSComm1.Input
        'Create the message from the stored values.
        MessageToSend = fncCreateMessage(Count)
        'Store the time of the poll.
        Nodes.LastAccess(Count) = fncDisplayDateAndTime
        'Send the node address as a text character.
        Buffer = Chr(Nodes.Address(Count))
        'For Stamp and other slaves without input buffers,
        'poll more than once if needed.
        Select Case Nodes.Cpu(Count)
            Case "PC"
                NumberOfTries = 1
            Case "Stamp"
                NumberOfTries = 2
        End Select
        AttemptNumber = 0
        Do
            MSComm1.Output = Buffer
            'Wait for the data to transmit
            Select Case fncConfirmTransmittedData(Buffer)
                Case -1
                    'If success, wait for Acknowledge.
                    AckReceived = fncWaitForAck(Count)
                Case 0
                    Nodes.Status(Count) = "Transmit error"
                Case 1
                    Nodes.Status(Count) = "Ack Timeout"
            End Select
            AttemptNumber = AttemptNumber + 1
        Loop Until AckReceived = True Or AttemptNumber = NumberOfTries
        If AckReceived = True Then
            MSComm1.Output = MessageToSend
            'Delay to let the data transmit
            Select Case fncConfirmTransmittedData(MessageToSend)
                Case -1
                    'Data has transmitted.
                    'Wait for the slave's reply.
                    ReplyReceived = fncWaitForReply(Count)
                Case Else
                    Nodes.Status(Count) = "Transmit error"
            End Select
        End If
        Call UpdateDisplay
    End If
Next Count
If SaveDataInFile = True Then
    Call WriteResultsToFile
End If
TransferInProgress = False
End Sub

Private Sub SaveResults _
    (NodeNumber As Integer, _
    Data1 As Byte, _
    Data2 As Byte, _
    ResultStatus As String)
    Nodes.DataIn1(NodeNumber) = Data1
    Nodes.DataIn2(NodeNumber) = Data2
    Nodes.Status(NodeNumber) = ResultStatus
End Sub

Private Sub WriteResultsToFile()
'Save received data and time in a file.
Dim Count As Integer
For Count = 1 To HighestNodeNumber
    'Skip if the node isn't selected (active) on the Nodes form.
    If Nodes.Active(Count) = 1 Then
        Write #2, _
            Count, _
            Nodes.LastAccess(Count), _
            Nodes.DataOut1(Count), _
            Nodes.DataOut2(Count), _
            Nodes.DataIn1(Count), _
            Nodes.DataIn2(Count), _
            Nodes.Status(Count)
    End If
Next Count
End Sub

Private Sub tmrTransferInterval_Timer()
'See if it's time to do a transfer.
Dim CurrentTime As Date
Dim Units As String
CurrentTime = Now
Select Case DataTransferFormat.IntervalUnits
    Case "seconds"
        Units = "s"
    Case "minutes"
        Units = "n"
    Case "hours"
        Units = "h"
End Select
'If elapsed time since the last transfer is more than
'the selected interval, do a data transfer.
If DateDiff(Units, PreviousTime, CurrentTime) >= _
        DataTransferFormat.IntervalValue Then
    PreviousTime = CurrentTime
    'But don't start a new transfer if one is in progress.
    If TransferInProgress = False Then
        Call PollSlave
    End If
End If
End Sub

Private Sub tmrTimeout_Timer()
tmrTimeout.Enabled = False
TimedOut = True
End Sub

Private Sub UpdateDisplay()
'Show the latest information for all nodes
Dim Column As Integer
Dim DataIn1Display As String
Dim DataIn2Display As String
Dim Count As Integer
'Set up 5 columns
With rtxStatus
        .SelTabCount = 5
        For Column = 0 To .SelTabCount - 1
            .SelTabs(Column) = 1000 * Column
        Next Column
    End With
rtxStatus.Text = "Node #" & Chr(vbKeyTab) _
    & "Data out" & Chr(vbKeyTab) _
    & "Data in" & Chr(vbKeyTab) _
    & "Status" & Chr(vbKeyTab) _
    & "Last Access" & vbCrLf
For Count = 1 To HighestNodeNumber
    'Skip if the node isn't selected (active) on the Nodes form.
    If Nodes.Active(Count) = 1 Then
    Select Case Nodes.Status(Count)
           Case "OK"
                DataIn1Display = _
                    fncByteToAsciiHex(Nodes.DataIn1(Count))
                DataIn2Display = _
                    fncByteToAsciiHex(Nodes.DataIn2(Count))
           Case Else
                DataIn1Display = ""
                DataIn2Display = ""
        End Select
        rtxStatus.SelStart = Len(rtxStatus.Text)
        rtxStatus.SelText = _
             Hex$(Count) & Chr(vbKeyTab) _
            & fncByteToAsciiHex(Nodes.DataOut1(Count)) & "   " _
            & fncByteToAsciiHex(Nodes.DataOut2(Count)) & Chr(vbKeyTab) _
            & DataIn1Display & "  " & DataIn2Display & Chr(vbKeyTab) _
            & Nodes.Status(Count) & Chr(vbKeyTab) _
            & Nodes.LastAccess(Count) & vbCrLf
    End If
Next Count
End Sub

Public Function fncInitializeComPort _
    (BitRate As Long, PortNumber As Integer) As Boolean
'BitRate and PortNumber are passed to this routine.
'All other properties are set explicitly in the code.
Dim ComSettings As String
If MSComm1.PortOpen = True Then
    MSComm1.PortOpen = False
End If
ComSettings = CStr(BitRate) & ",N,8,1"
MSComm1.CommPort = PortNumber
' bit rate, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = ComSettings
'Set to 0 to read entire buffer on Input
MSComm1.InputLen = 0
MSComm1.InBufferSize = 256
'Input and output data are text.
MSComm1.InputMode = comInputModeText
'MSComm does no handshaking.
MSComm1.Handshaking = comNone
MSComm1.OutBufferSize = 256
MSComm1.EOFEnable = False
'No OnComm event on received data.
MSComm1.RThreshold = 0
'No OnComm transmit event.
MSComm1.SThreshold = 0
MSComm1.PortOpen = True
OneByteDelay = fncOneByteDelay(BitRate)
End Function

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级日韩一级| 97超碰欧美中文字幕| 欧美大片在线观看一区| 日韩激情一区二区| 精品国产一二三| 国产传媒一区在线| 中文字幕在线观看一区| 欧美性生活影院| 日日摸夜夜添夜夜添精品视频 | 日本大胆欧美人术艺术动态| 制服丝袜亚洲网站| 极品瑜伽女神91| 日本一区二区久久| 在线精品视频一区二区| 免费久久99精品国产| 国产视频亚洲色图| 91精品91久久久中77777| 无吗不卡中文字幕| 久久久综合九色合综国产精品| 不卡一区二区在线| 日本网站在线观看一区二区三区| 2021中文字幕一区亚洲| 色网综合在线观看| 久久超碰97中文字幕| 国产精品高清亚洲| 欧美一区欧美二区| 成人av免费观看| 欧美bbbbb| 最新久久zyz资源站| 91精品欧美福利在线观看| 成人免费观看视频| 男人操女人的视频在线观看欧美| 国产精品视频第一区| 777奇米成人网| 9久草视频在线视频精品| 蜜桃传媒麻豆第一区在线观看| 国产精品你懂的在线欣赏| 欧美老肥妇做.爰bbww视频| 国产精品一区免费视频| 五月综合激情网| 中文字幕精品一区 | 精品国产污污免费网站入口| 色偷偷久久一区二区三区| 国产在线视频精品一区| 午夜视频在线观看一区| 亚洲色图一区二区三区| 欧美精品一区在线观看| 欧美日韩国产成人在线免费| 成人美女在线视频| 国产一区二区剧情av在线| 无码av免费一区二区三区试看| 1000部国产精品成人观看| 精品国产免费一区二区三区四区| 日本乱码高清不卡字幕| 成人av资源网站| 国产99精品在线观看| 久久99精品久久久久久国产越南| 亚洲成av人综合在线观看| 亚洲日本青草视频在线怡红院| 久久女同互慰一区二区三区| 欧美一区二区三区白人| 精品视频色一区| 色偷偷久久一区二区三区| 成人高清av在线| 色哟哟在线观看一区二区三区| 国产成人午夜片在线观看高清观看| 日本午夜精品视频在线观看| 午夜精品久久久久久| 亚洲超碰97人人做人人爱| 亚洲资源中文字幕| 一区二区高清视频在线观看| 国产精品成人一区二区艾草| 中文字幕不卡的av| 久久久99精品免费观看不卡| 精品99999| 久久精品视频免费| 国产欧美一区二区精品性| 国产香蕉久久精品综合网| 国产亚洲欧美一区在线观看| 久久精品人人做人人综合| 欧美激情一区不卡| 成人免费视频在线观看| 亚洲精品自拍动漫在线| 亚洲一区二区在线免费看| 亚洲国产精品一区二区久久| 亚洲成va人在线观看| 蜜臀久久99精品久久久画质超高清 | 国产精品一区一区| 成人黄色小视频在线观看| 91在线视频播放| 色综合天天综合网天天看片| 欧美视频一区二区| 日韩一区二区不卡| 国产日韩欧美a| 亚洲日本乱码在线观看| 亚洲成a人片综合在线| 欧美aa在线视频| 国产东北露脸精品视频| jlzzjlzz亚洲女人18| 欧美午夜精品久久久久久孕妇 | 亚洲男帅同性gay1069| 亚洲一级片在线观看| 免费观看在线色综合| 国产一区二区久久| 日本韩国一区二区| 日韩欧美一区在线| 亚洲国产成人私人影院tom| 亚洲免费色视频| 青青草一区二区三区| 成人av在线影院| 欧美日韩在线播| 久久先锋影音av鲁色资源网| 亚洲欧美综合另类在线卡通| 天使萌一区二区三区免费观看| 国模娜娜一区二区三区| 一本大道久久a久久精品综合| 欧美日韩国产一区二区三区地区| 久久夜色精品一区| 亚洲在线中文字幕| 国产精品一区二区果冻传媒| 欧美私人免费视频| 国产日产欧产精品推荐色 | 亚洲日本va午夜在线电影| 日韩二区三区在线观看| 成人做爰69片免费看网站| 9191成人精品久久| 亚洲婷婷国产精品电影人久久| 美女在线一区二区| 在线观看亚洲一区| 国产精品无码永久免费888| 天天综合天天综合色| 91在线国产福利| 久久久久久久久伊人| 午夜私人影院久久久久| 91在线porny国产在线看| 一区二区三区欧美亚洲| 国产真实乱子伦精品视频| 欧美日韩一二三区| 最新国产の精品合集bt伙计| 精品一区二区三区免费视频| 欧美三级在线视频| 亚洲另类中文字| 国产精品18久久久久久久久| 日韩一区二区精品| 亚洲成a人v欧美综合天堂下载| 97精品视频在线观看自产线路二| 久久综合色综合88| 免费观看成人av| 欧美日韩大陆在线| 亚洲一区二区三区在线看| av在线一区二区三区| 国产情人综合久久777777| 精品在线观看视频| 日韩三级高清在线| 奇米四色…亚洲| 在线91免费看| 图片区小说区区亚洲影院| 欧美亚洲动漫精品| 亚洲日本在线a| 91视频你懂的| 亚洲激情图片一区| 在线观看免费一区| 亚洲在线视频一区| 欧美体内she精高潮| 亚洲大型综合色站| 欧美猛男gaygay网站| 亚洲电影激情视频网站| 欧美日韩一区中文字幕| 午夜电影网一区| 欧美一区二区在线看| 蜜桃精品视频在线| 精品国产a毛片| 国产成人亚洲综合a∨婷婷| 久久久五月婷婷| 成人av中文字幕| 亚洲人精品午夜| 欧美偷拍一区二区| 日产国产高清一区二区三区| 日韩精品中午字幕| 国产麻豆成人传媒免费观看| 久久久国产精品不卡| 成人永久aaa| 一区二区三区国产| 欧美精品99久久久**| 久久99精品国产麻豆婷婷 | 欧美α欧美αv大片| 国产福利精品导航| 亚洲日本一区二区| 欧美男人的天堂一二区| 精品亚洲免费视频| 国产精品欧美极品| 欧美视频一区在线| 蜜桃91丨九色丨蝌蚪91桃色| 国产亚洲精品7777| 色婷婷激情综合| 另类小说欧美激情| 中文字幕乱码日本亚洲一区二区| 91视频com| 理论电影国产精品| 亚洲欧洲日本在线|