IFIX上位機(jī)添加IP測(cè)試
效果
?
?實(shí)現(xiàn)畫面
實(shí)現(xiàn)腳本
Option Explicit Private Declare Function GetExitCodeProcess Lib "kernel32" ( _ ByVal hProcess As Long, _ lpExitCode As Long) As Long Private Declare Function CloseHandle Lib "kernel32" ( _ ByVal hObject As Long) As Long Private Declare Function OpenProcess Lib "kernel32" ( _ ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long Const PROCESS_QUERY_INFORMATION = &H400Const STILL_ALIVE = &H103Private Sub Text2_Click() Dim pid As Long pid = Shell("cmd.exe /C Ping " & "192.168.0.135" & " > c:/ipaac.txt", vbHide) Dim hProc As Long hProc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid) Dim ExitCode As Long Do Call GetExitCodeProcess(hProc, ExitCode) DoEvents Loop While ExitCode = STILL_ALIVE Text3.Caption = "" Open "c:/ipaac.txt" For Input As #1 Dim strLine As String Do Until EOF(1) Line Input #1, strLine Text3.Caption = Text3.Caption & strLine & vbNewLine Loop Close #1 On Error Resume Next Kill "c:/ipaac.txt" On Error GoTo 0End Sub
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.specialneedsforspecialkids.com/yun/124449.html
摘要:系統(tǒng)資料整理概論系統(tǒng),即數(shù)據(jù)采集與監(jiān)視控制系統(tǒng),發(fā)展到今天已經(jīng)經(jīng)歷了四代。系統(tǒng)的組成從網(wǎng)絡(luò)構(gòu)架來看,系統(tǒng)一般由下位機(jī)上位機(jī)和通信網(wǎng)絡(luò)組成。 SCADA系統(tǒng)資料整理-...
摘要:所以我必須基于自己現(xiàn)在的情況走出一條適合自己情況的成長(zhǎng)路線。下位機(jī)上位機(jī)的思想下位機(jī)上位機(jī)這就是我自己探索出來的技術(shù)成長(zhǎng)路線。對(duì)和嵌入式的朋友感興趣的朋友可以試一下我這條學(xué)習(xí)路線 ...
摘要:但是我對(duì)此協(xié)議并不熟悉,本文便以測(cè)試為目的基于西門子模塊主站,采用通訊協(xié)議與溫濕度傳感器從站通訊獲取數(shù)據(jù)。 文章目錄 前言 一、前期準(zhǔn)備 二、編寫通訊程序 1.通訊測(cè)試工具和軟件 2.編寫TIA Portal程序 三、基于OPC UA的通訊傳輸 總結(jié) 前言 最近作者在...
閱讀 939·2021-11-23 09:51
閱讀 998·2021-11-18 10:02
閱讀 1935·2021-09-10 11:27
閱讀 3151·2021-09-10 10:51
閱讀 788·2019-08-29 15:13
閱讀 2072·2019-08-29 11:32
閱讀 2507·2019-08-29 11:25
閱讀 3053·2019-08-26 11:46