新聞中心

        EEPW首頁 > 測試測量 > 設計應用 > labview編程技巧-----labview與INI文件

        labview編程技巧-----labview與INI文件

        作者: 時間:2017-01-09 來源:網絡 收藏
        在WIN95以前,WINDOWS還沒有引入注冊表的概念,WINDOWS是利用INI文件來存儲計算機相關配置的,在API里,WINDOWS提供了豐富的API函數來操作INI文件,LV里也專門有個子類別封裝了這些API函數,使用非常方便。


        LV使用INI文件來存儲配置,應用非常廣泛,生成執行文檔后也自動生成一個INI文件。

        LV主要在下列情況下使用INI文件:

        存儲前面板或者前面板特定控件的默認值和當前值

        存儲本次應用的運行結果供下一次啟動是調用

        存儲硬件配置文件

        存儲硬件配置是非常重要的,比如一般的板卡都有16個數字輸出,外部接繼電器來控制外部設備,繼電器是比較容易損壞的,而通常16個繼電器中是有備用的,如何在不改變軟件和硬件的情況下把輸出更改到另外的繼電器上,這樣,只需要簡單地改動一下外部接線就可以了那,使用配置文件可以輕松實現。

        INI文件結構很簡單,裝了多操作系統的人都知道,WINDOWS本身有個BOOT.INI

        [boot loader]
        timeout=30
        default=multi(0)disk(0)rdisk(0)partition(1)WINDOWS
        [operating systems]
        multi(0)disk(0)rdisk(0)partition(1)WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect



        我們看一下LV軟件本身也利用了INI文件來保存配置。

        [LabVIEW]
        server.tcp.port=3363
        server.tcp.enabled=TRUE
        server.tcp.access="+127.0.0.1"
        IsFirstLaunch=False
        PaletteHidddenControlCategories_LocalHost="Modern;System;Classic;Control Design & Simulation;.NET & ActiveX;Addons;"
        PaletteHidddenFunctionlCategories_LocalHost="Programming;Measurement I/O;Instrument I/O;Vision and Motion;Mathematics;Signal Processing;Data Communication;Connectivity;Control Design & Simulation;SignalExpress;Addons;"
        menuSetup="default"
        saveFloaterLocations=True
        find.viListFlags=4
        LastErrorListSize=0,0,379,486
        paletteStyle="NamedIcons"
        NoAdvice070=",CleanUpWire,FlatSequence"
        SaveChanges_ApplyToAll=True
        PropPageBounds="398;181;884;636"
        RecentFiles.pathList="C:Program FilesNational InstrumentsLabVIEW 8.5examplesDAQmxAnalog InMeasure Voltage.llbAcq&Graph Voltage-Int Clk.vi;C:Program FilesNational InstrumentsLabVIEW 8.5examplesDAQmxAnalog InMeasure Voltage.llbAcq&Graph Voltage-Ext Clk-Analog Ref.vi;C:Documents and SettingsAdministratorLocal SettingsTemporary Internet FilesContent.IE57M9NS8HFchart%20right%20to%20left[1].vi;C:Documents and SettingsAdministratorMy Documentswindows_environment_variable_reader_writerWindows Environment Variable Reader Writer.vi;C:Documents and SettingsAdministratorMy DocumentsMDI.llbSimple MDI Demo.vi;D:Control 1.ctl;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libtreeTree Sorter.llbJoin.vi;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilitynotifier.llbCreate Notifier.vi;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilitynotifier.llbWait On Notification.vi;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilityinputDevices.llbAcquire Input Data.vi"
        ShowBufferAllocationsArrays=True
        ShowBufferAllocationsClusters=True
        ShowBufferAllocationsStrings=False
        ShowBufferAllocationsPaths=False
        ShowBufferAllocationsScalars=False
        ShowBufferAllocationsVariants=False
        ShowBufferAllocationsOther=False
        NewDlgRecentMainTemplates.pathList="C:Program FilesNational InstrumentsLabVIEW 8.5templatesFrameworksDesignPatternsProducerConsumerEvents.vit"
        NewDlgBounds="700;480"
        NewDlgRecentTemplates.pathList=""
        NewDlgLastSelected="8E4D36AD-F776-4C48-97C6-C1D85EFE889F"
        NewDlgSmall=False
        NewDlgCollapsed="77E350A8-F9AA-43FF-85E2-454279EBB9A7/Frameworks3F7CF7A8-5E4D-4EDC-AA25-FA4A326988EF8E4D36AD-F776-4C48-97C6-C1D85EFE889F"
        SuperSecretPrivateSpecialStuff=True
        colorHistoryItemA=00000BFF
        RecentFiles.projectPathList="C:Documents and SettingsAdministratorMy Documentsxcontrol eventsxcontrol eventsXControl Events Project.lvproj;C:Program FilesNational InstrumentsLabVIEW 8.5examplesgeneralxcontrolsDual Mode ThermometerSimple Dual Mode Thermometer XControl.lvproj;C:Program FilesNational InstrumentsLabVIEW 8.5exampleslvdscXControlsSpinnerSpinner.lvproj;C:Documents and SettingsAdministratorMy DocumentsLinked_List_ProjectLinked ListLinked_List_Project.lvproj;D:TESTUntitled Project 1.lvproj;C:Documents and SettingsAdministratorMy DocumentsScripting_Tools_0.16.02Scripting ToolsScripting Tools.lvproj;C:Documents and SettingsAdministratorMy DocumentsIconEditor_85_V2.2IconEditor.lvproj;C:Documents and SettingsAdministratorMy Documents第一名_何凌_公司問題第一名 何凌 公司問題SrcVI company.lvproj"
        ProjectExplorer.ClassicPosition=143,53,543,415
        colorHistoryItemB=009A8574
        editRecentPaths="C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilitysysinfo.llb;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilitysemaphor.llb;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilitymiscctls.llb;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilityGetType.llb;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilityinputDevices.llb;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libUtilitynotifier.llb;C:Program FilesNational InstrumentsLabVIEW 8.5vi.libtreeTree Sorter.llb"
        LLBMgr_ActivePlugins=""
        LLBMgr_RecentPath="C:Documents and SettingsAdministratorMy DocumentsMDI.llb"
        colorHistoryItemC=00FF8242
        autoerr=2
        colorHistoryItemD=00000FDC
        colorHistoryItemE=003100DC
        colorHistoryItemF=00FFFFFF
        colorHistoryItemG=00FF3D00
        colorHistoryItemH=000F00DC
        colorHistoryItemI=004AFF42
        colorHistoryItemJ=00C88E00
        colorHistoryItemK=000025FF
        exoticControls=TRUE
        NoAdvice080=",ClassBrowser"
        SuperPrivateScriptingFeatureVisible=True
        SuperSecretPrivateSpecialStuff=True
        superPrivateScriptingFeatureSichtbar=True

        本文引用地址:http://www.104case.com/article/201701/337269.htm

        FPFont="0" 18
        BDFont="0" 18
        toolPaletteLoc=494,22,645,100
        LVLibraryThemeColor=006699FF


        上一頁 1 2 下一頁

        評論


        技術專區

        關閉
        主站蜘蛛池模板: 灵山县| 林甸县| 明溪县| 鄂州市| 密云县| 弥勒县| 象州县| 灯塔市| 桂东县| 梧州市| 高邑县| 兴城市| 苍山县| 吴旗县| 鄯善县| 鲁甸县| 白河县| 左贡县| 鄂温| 娱乐| 西青区| 芷江| 文昌市| 海宁市| 三都| 田东县| 鄂托克旗| 虎林市| 潼南县| 吴江市| 和静县| 德化县| 吴旗县| 海门市| 五莲县| 乐山市| 新津县| 会宁县| 北票市| 盱眙县| 昌图县|