labview编程技巧-----labview与INI文件
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
FPFont="0" 18
BDFont="0" 18
toolPaletteLoc=494,22,645,100
LVLibraryThemeColor=006699FF
评论