PROTECTiconworkshop

iconworkshop  时间:2021-05-21  阅读:()
LabVIEWTMDataPluginSDKUserManualLabVIEWDataPluginSDKJuly2012372601D-01SupportWorldwideTechnicalSupportandProductInformationni.
comWorldwideOfficesVisitni.
com/niglobaltoaccessthebranchofficeWebsites,whichprovideup-to-datecontactinformation,supportphonenumbers,emailaddresses,andcurrentevents.
NationalInstrumentsCorporateHeadquarters11500NorthMopacExpresswayAustin,Texas78759-3504USATel:5126830100Forfurthersupportinformation,refertotheTechnicalSupportandProfessionalServicesappendix.
TocommentonNationalInstrumentsdocumentation,refertotheNationalInstrumentsWebsiteatni.
com/infoandentertheInfoCodefeedback.
2008–2012NationalInstruments.
Allrightsreserved.
ImportantInformationWarrantyThemediaonwhichyoureceiveNationalInstrumentssoftwarearewarrantednottofailtoexecuteprogramminginstructions,duetodefectsinmaterialsandworkmanship,foraperiodof90daysfromdateofshipment,asevidencedbyreceiptsorotherdocumentation.
NationalInstrumentswill,atitsoption,repairorreplacesoftwaremediathatdonotexecuteprogramminginstructionsifNationalInstrumentsreceivesnoticeofsuchdefectsduringthewarrantyperiod.
NationalInstrumentsdoesnotwarrantthattheoperationofthesoftwareshallbeuninterruptedorerrorfree.
AReturnMaterialAuthorization(RMA)numbermustbeobtainedfromthefactoryandclearlymarkedontheoutsideofthepackagebeforeanyequipmentwillbeacceptedforwarrantywork.
NationalInstrumentswillpaytheshippingcostsofreturningtotheownerpartswhicharecoveredbywarranty.
NationalInstrumentsbelievesthattheinformationinthisdocumentisaccurate.
Thedocumenthasbeencarefullyreviewedfortechnicalaccuracy.
Intheeventthattechnicalortypographicalerrorsexist,NationalInstrumentsreservestherighttomakechangestosubsequenteditionsofthisdocumentwithoutpriornoticetoholdersofthisedition.
ThereadershouldconsultNationalInstrumentsiferrorsaresuspected.
InnoeventshallNationalInstrumentsbeliableforanydamagesarisingoutoforrelatedtothisdocumentortheinformationcontainedinit.
EXCEPTASSPECIFIEDHEREIN,NATIONALINSTRUMENTSMAKESNOWARRANTIES,EXPRESSORIMPLIED,ANDSPECIFICALLYDISCLAIMSANYWARRANTYOFMERCHANTABILITYORFITNESSFORAPARTICULARPURPOSE.
CUSTOMER'SRIGHTTORECOVERDAMAGESCAUSEDBYFAULTORNEGLIGENCEONTHEPARTOFNATIONALINSTRUMENTSSHALLBELIMITEDTOTHEAMOUNTTHERETOFOREPAIDBYTHECUSTOMER.
NATIONALINSTRUMENTSWILLNOTBELIABLEFORDAMAGESRESULTINGFROMLOSSOFDATA,PROFITS,USEOFPRODUCTS,ORINCIDENTALORCONSEQUENTIALDAMAGES,EVENIFADVISEDOFTHEPOSSIBILITYTHEREOF.
ThislimitationoftheliabilityofNationalInstrumentswillapplyregardlessoftheformofaction,whetherincontractortort,includingnegligence.
AnyactionagainstNationalInstrumentsmustbebroughtwithinoneyearafterthecauseofactionaccrues.
NationalInstrumentsshallnotbeliableforanydelayinperformanceduetocausesbeyonditsreasonablecontrol.
Thewarrantyprovidedhereindoesnotcoverdamages,defects,malfunctions,orservicefailurescausedbyowner'sfailuretofollowtheNationalInstrumentsinstallation,operation,ormaintenanceinstructions;owner'smodificationoftheproduct;owner'sabuse,misuse,ornegligentacts;andpowerfailureorsurges,fire,flood,accident,actionsofthirdparties,orothereventsoutsidereasonablecontrol.
CopyrightUnderthecopyrightlaws,thispublicationmaynotbereproducedortransmittedinanyform,electronicormechanical,includingphotocopying,recording,storinginaninformationretrievalsystem,ortranslating,inwholeorinpart,withoutthepriorwrittenconsentofNationalInstrumentsCorporation.
NationalInstrumentsrespectstheintellectualpropertyofothers,andweaskouruserstodothesame.
NIsoftwareisprotectedbycopyrightandotherintellectualpropertylaws.
WhereNIsoftwaremaybeusedtoreproducesoftwareorothermaterialsbelongingtoothers,youmayuseNIsoftwareonlytoreproducematerialsthatyoumayreproduceinaccordancewiththetermsofanyapplicablelicenseorotherlegalrestriction.
End-UserLicenseAgreementsandThird-PartyLegalNoticesYoucanfindend-userlicenseagreements(EULAs)andthird-partylegalnoticesinthefollowinglocations:Noticesarelocatedinthe\_LegalInformationanddirectories.
EULAsarelocatedinthe\Shared\MDF\Legal\licensedirectory.
Review\_LegalInformation.
txtformoreinformationonincludinglegalinformationininstallersbuiltwithNIproducts.
TrademarksDIAdem,LabVIEW,NationalInstruments,NI,ni.
com,theNationalInstrumentscorporatelogo,andtheEaglelogoaretrademarksofNationalInstrumentsCorporation.
RefertotheTrademarkInformationatni.
com/trademarksforotherNationalInstrumentstrademarks.
Otherproductandcompanynamesmentionedhereinaretrademarksortradenamesoftheirrespectivecompanies.
MembersoftheNationalInstrumentsAlliancePartnerProgramarebusinessentitiesindependentfromNationalInstrumentsandhavenoagency,partnership,orjoint-venturerelationshipwithNationalInstruments.
PatentsForpatentscoveringNationalInstrumentsproducts/technology,refertotheappropriatelocation:HelpPatentsinyoursoftware,thepatents.
txtfileonyourmedia,ortheNationalInstrumentsPatentNoticeatni.
com/patents.
ExportComplianceInformationRefertotheExportComplianceInformationatni.
com/legal/export-compliancefortheNationalInstrumentsglobaltradecompliancepolicyandhowtoobtainrelevantHTScodes,ECCNs,andotherimport/exportdata.
WARNINGREGARDINGUSEOFNATIONALINSTRUMENTSPRODUCTS(1)NATIONALINSTRUMENTSPRODUCTSARENOTDESIGNEDWITHCOMPONENTSANDTESTINGFORALEVELOFRELIABILITYSUITABLEFORUSEINORINCONNECTIONWITHSURGICALIMPLANTSORASCRITICALCOMPONENTSINANYLIFESUPPORTSYSTEMSWHOSEFAILURETOPERFORMCANREASONABLYBEEXPECTEDTOCAUSESIGNIFICANTINJURYTOAHUMAN.
(2)INANYAPPLICATION,INCLUDINGTHEABOVE,RELIABILITYOFOPERATIONOFTHESOFTWAREPRODUCTSCANBEIMPAIREDBYADVERSEFACTORS,INCLUDINGBUTNOTLIMITEDTOFLUCTUATIONSINELECTRICALPOWERSUPPLY,COMPUTERHARDWAREMALFUNCTIONS,COMPUTEROPERATINGSYSTEMSOFTWAREFITNESS,FITNESSOFCOMPILERSANDDEVELOPMENTSOFTWAREUSEDTODEVELOPANAPPLICATION,INSTALLATIONERRORS,SOFTWAREANDHARDWARECOMPATIBILITYPROBLEMS,MALFUNCTIONSORFAILURESOFELECTRONICMONITORINGORCONTROLDEVICES,TRANSIENTFAILURESOFELECTRONICSYSTEMS(HARDWAREAND/ORSOFTWARE),UNANTICIPATEDUSESORMISUSES,ORERRORSONTHEPARTOFTHEUSERORAPPLICATIONSDESIGNER(ADVERSEFACTORSSUCHASTHESEAREHEREAFTERCOLLECTIVELYTERMED"SYSTEMFAILURES").
ANYAPPLICATIONWHEREASYSTEMFAILUREWOULDCREATEARISKOFHARMTOPROPERTYORPERSONS(INCLUDINGTHERISKOFBODILYINJURYANDDEATH)SHOULDNOTBERELIANTSOLELYUPONONEFORMOFELECTRONICSYSTEMDUETOTHERISKOFSYSTEMFAILURE.
TOAVOIDDAMAGE,INJURY,ORDEATH,THEUSERORAPPLICATIONDESIGNERMUSTTAKEREASONABLYPRUDENTSTEPSTOPROTECTAGAINSTSYSTEMFAILURES,INCLUDINGBUTNOTLIMITEDTOBACK-UPORSHUTDOWNMECHANISMS.
BECAUSEEACHEND-USERSYSTEMISCUSTOMIZEDANDDIFFERSFROMNATIONALINSTRUMENTS'TESTINGPLATFORMSANDBECAUSEAUSERORAPPLICATIONDESIGNERMAYUSENATIONALINSTRUMENTSPRODUCTSINCOMBINATIONWITHOTHERPRODUCTSINAMANNERNOTEVALUATEDORCONTEMPLATEDBYNATIONALINSTRUMENTS,THEUSERORAPPLICATIONDESIGNERISULTIMATELYRESPONSIBLEFORVERIFYINGANDVALIDATINGTHESUITABILITYOFNATIONALINSTRUMENTSPRODUCTSWHENEVERNATIONALINSTRUMENTSPRODUCTSAREINCORPORATEDINASYSTEMORAPPLICATION,INCLUDING,WITHOUTLIMITATION,THEAPPROPRIATEDESIGN,PROCESSANDSAFETYLEVELOFSUCHSYSTEMORAPPLICATION.
NationalInstruments|vContentsConventionsChapter1AnIntroductiontotheLabVIEWDataPluginSDKDataPluginOverview1-2LabVIEWDataPluginTypes.
1-4One-ShotDataPlugins1-4On-DemandDataPlugins.
1-4One-ShotversusOn-DemandDataPlugins1-4Chapter2CreatingDataPluginswithLabVIEWLabVIEWProjectFolders2-1DebuggingandTestingYourLabVIEWDataPlugin.
2-2AdaptingtheLabVIEWProjectBuild.
2-3DataPluginParameterization2-3BuildConfiguration.
2-4Chapter3ConstraintsChannelLengthLimitation.
3-1SupportedDataTypesandConversions.
3-1NameConventions3-2SupportedLabVIEWVersions.
3-3AppendixATechnicalSupportandProfessionalServicesNationalInstruments|viiConventionsThefollowingconventionsareusedinthismanual:Anglebracketsthatcontainnumbersseparatedbyanellipsisrepresentarangeofvaluesassociatedwithabitorsignalname—forexample,AO.
Thesymbolleadsyouthroughnestedmenuitemsanddialogboxoptionstoafinalaction.
ThesequenceOptionsSettingsGeneraldirectsyoutopulldowntheOptionsmenu,selecttheSettingsitem,andselectGeneralfromthelastdialogbox.
Thisicondenotesatip,whichalertsyoutoadvisoryinformation.
Thisicondenotesanote,whichalertsyoutoimportantinformation.
boldBoldtextdenotesitemsthatyoumustselectorclickinthesoftware,suchasmenuitemsanddialogboxoptions.
Boldtextalsodenotesparameternames.
italicItalictextdenotesvariables,emphasis,cross-references,oranintroductiontoimportantconcepts.
monospaceTextinthisfontdenotestextorcharactersthatyoushouldenterfromthekeyboard,suchassectionsofcode,programmingexamples,andsyntaxexamples.
Thisfontisalsousedforthepropernamesofdiskdrives,paths,folders,programs,subprograms,subroutines,devicenames,functions,operations,commands,variables,controls,events,methods,filenamesandextensions,andcodeexcerpts.
NationalInstruments|1-11AnIntroductiontotheLabVIEWDataPluginSDKTheLabVIEWDataPluginSDKenablesyoutocreateDataPluginsfromscratchusing100%LabVIEWG-code.
TheSDKalsoenablesyoutocreateaninstallerinordertoinstallthenewDataPluginonanyWindowscomputer.
Refertothereadme_DataPlugin_SDK.
htmlforsystemandsoftwarerequirements.
Visitwww.
ni.
com/datapluginsforthelistofallfreelydownloadableDataPluginsandformoreinformationaboutDataPlugins.
Visitwww.
ni.
com/tdmformoreinformationabouttheTDMdatamodel,theTDMfileformat,andassociatedTDMtools.
Visitthefollowingwebsitesformoreinformationabouttheserelatedsoftwarepackages:LabVIEW:www.
ni.
com/labviewDIAdem:www.
ni.
com/diademDataFinderServerEdition:www.
ni.
com/datafinder1-2|ni.
comChapter1AnIntroductiontotheLabVIEWDataPluginSDKDataPluginOverviewADataPluginisencapsulatedcodethatunderstandshowtoreadandtointerpretthedatacontainedinaspecificdatafileformatbymappingittotheTDMdatamodel.
TheTDMdatamodelarrangesthedatainrootelement,channelgroups,andchannels.
TheTDMdatamodelhasthefollowingstructure:Figure1-1.
TDMDataModelInitiallyDataPluginscouldonlybecreatedbyusingC++orVBScriptprogramminglanguages,buttheLabVIEWDataPluginSDKgivesyou,theLabVIEWprogrammer,theabilitytocreateDataPluginsusingLabVIEW.
DataPluginscreatedwiththeLabVIEWDataPluginSDKcanonlyreaddata.
ThisisthecaseformostDataPluginspubliclypostedatwww.
ni.
com/dataplugins.
DataPlugins"pluginto"asoftwarelayercalledUSI(UniversalStorageInterface),whichinstallswithLabVIEW,DIAdem,andDataFinderServerEdition.
OnceanewDataPluginisregisteredonacomputer,anyinstalledLabVIEW,DIAdem,orDataFinderapplicationonthatcomputerisabletousethatnewlyregisteredDataPlugintoloaddatafilesinthefileformatthenewDataPluginsupports.
InLabVIEWthishappensviaasetofExpressVIscalledthe"StorageVIs".
InDIAdemtheDataPlugincanbeusedbysimplyinteractivelydraggingadatafileofthesupportedfileformatfromtheNAVIGATORwindowintotheDataPortal,oralternatively,byusingcommandslikeDataFileLoad()inaDIAdemscript.
TheDataFinderusestheDataPluginforindexingthefilesofthisspecificfileformat.
NationalInstruments|1-3LabVIEWDataPluginSDKThemainadvantageofcreatingaDataPluginwiththeLabVIEWDataPluginSDKistoleverageLabVIEWG-codetogivenewfileformatreadingcapabilitytoDIAdemand/ortheDataFinder.
WhentheLabVIEWDataPlugininstallerruns,norecordofitappearsin"AddandRemovePrograms",insteadtheDataPluginisregisteredwiththeUSIlayerit"plugsinto".
YoumayruntheLabVIEWDataPlugininstallerasmanytimesasyouwant,andeachtimetheDataPluginregisteredwithUSIissimplyupdated.
SotoinstallanewerversionoftheDataPluginontopofanolderversion,youjustrunthenewerLabVIEWDataPlugininstalleronthatcomputer.
TogetanoverviewoftheinstalledDataPluginsusethe"DataPluginSettings"dialogboxinDIAdemorDataFinderServerEdition.
UsethesamedialogboxtouninstallLabVIEWDataPlugins.
InLabVIEWyoucanusetheStorageVIstoenumerate,register,orderegisterDataPlugins.
Figure1-2.
OverviewofInstalledDataPluginsNoteTheLabVIEWDataPluginexampleprojectscontainaFortestingprojectfolderwithaVIyoucanusetodebugyourLabVIEWDataPluginfromwithinLabVIEW,withoutneedingtofirstbuildtheDataPluginDLLandinstaller.
RefertoLabVIEWProjectFoldersinChapter2,CreatingDataPluginswithLabVIEWforfurtherinformationonDataPlugins.
1-4|ni.
comChapter1AnIntroductiontotheLabVIEWDataPluginSDKLabVIEWDataPluginTypesTherearetwotypesofLabVIEWDataPlugins,One-ShotandOn-Demand.
YouneedtochoosebetweenimplementingaOne-ShotoranOn-DemandDataPluginbasedonthestructureofthedatafileandyourlevelofLabVIEWprogrammingexperience,asdescribedbelow.
One-ShotDataPluginsTheone-shotDataPlugin,isthesimplest.
Theone-shotDataPluginhasonecallbackVIthatyouprogram,yourCodeHere.
vi.
ThisVIiscalledexactlyonceanytimetheDataPluginisused.
Theone-shotDataPluginpassesallthedescriptiveinformation(meta-data,groupandchannelhierarchy)aswellasallthedatavaluesforallthechannels.
ThistypeofDataPluginagreeswellwiththewayLabVIEWprogrammersareusedtooperating,becausetheVIrunsexactlyoncewhenloadingdatawiththeDataPlugin.
On-DemandDataPluginsTheon-demandDataPluginismorecomplicatedandlesscomfortablefortheLabVIEWprogrammer,butingeneralthisisstilltherightchoiceforverylargedatafiles.
Theon-demandDataPluginhastwocallbacks,theyourCodeHere_meta.
viwhichiscalledexactlyonceanytimetheDataPluginruns,andtheyourCodeHere_raw.
viwhichcanbecalledoneormoretimesbutisonlycalledwhendatavaluesarerequested.
TheyourCodeHere_meta.
videclareson-demanddatachannelswhichspecify,forexample,thedatatype,name,length,descriptiveproperties,butwhichcontainnodatavalues.
ThentheyourCodeHere_raw.
viiscalledindividuallyforeachon-demanddatachannel.
One-ShotversusOn-DemandDataPluginsTheadvantagesoftheone-shotDataPluginarethatitissimpletoprogramandoftenloadsallthevaluesfromallthechannelsfasterthananon-demandDataPlugin.
Theone-shotDataPluginisanexcellentchoicewhenthedatafilesyouneedtoloadarealwayssmallenoughtofitinRAM.
Ifitonlytakesafewsecondstoloadallthevaluesofallthechannels,thisisthewaytogo.
If,though,youknowthatsomeormostofyourdatafileswillbetoobigtoloadintoRAM,thenyoushouldseriouslyconsiderthemorecomplicatedon-demandDataPlugin.
NotethatwhenloadingdatavaluesintoDIAdem,thevaluesarealwaysconvertedtoDBLsinDIAdem'sinternalmemory(notthecaseforLabVIEW),sointhatcaseyoushouldestimateyourfile'seffectivesizeinDBLswhendeterminingifitfitsinRAM.
Thedownsidetotheone-shotDataPluginisthatyouloadallthedatavaluesanytimetheDataPluginiscalled.
IftheDataPluginisbeingcalledbytheDataFinderinordertoindexthefile(whichneedsonlythedescriptiveinformation),thistakesmuchlongerthannecessarybecausetheone-shotDataPluginloadsallthedatavalueseventhoughtheyarenotneededinthatcase.
Incaseoftheon-demandDataPluginwhentheDataFinderisindexingthefile,theon-demandDataPluginonlyreturnsthedescriptiveinformation—itdoesnotwasteunnecessarytimereadingallthedatavalues.
NationalInstruments|1-5LabVIEWDataPluginSDKIftheOne-ShotDataPluginisbeingcalledbyDIAdemtoloadonly1outof200channels,itloadsthedatamuchslower,becauseitisloadingallthedatavaluesforall200channels,eventhoughonlythedatavaluesfor1channelwererequested.
Similarly,ifonlythefirst100valuesfroma100millionvaluelongdatachannelarebeingrequested,theone-shotDataPluginloadsall100millionvaluesanywayandthenonlyreturnsthefirst100ofthem.
Ontheotherhand,ifyourdatafilecontains20channels,andanon-demandDataPluginiscalledtoloadallthedatavaluesfromall20channels,theyourCodeHere_raw.
viiscalled20times,onceforeachseparateon-demandchannel.
Ifyouaredealingwithabinaryfilethathasexcellentrandomaccess,andyouknowexactlyatwhichbytepositioneachchannelstarts,thisdoesnotslowyoudownatall.
If,however,youhaveadatalogfilewithanarrayofclusterswhereeachclusterhas20elements,thiscausesyoutoreadthefile20timesinordertoloadallthedatavaluesfromallthechannels.
Thisishowtheone-shotDataPlugincanbefasterifyoucanfityourdatafileintoRAM(includingLabVIEWcopiesandDataPlugincopies).
Atthatpointyouhavetoweighhowmuchvirtualmemorywillslowyoudownversustheinefficiencyofloadingthefilemultipletimes.
Anotherdistinctionofon-demandDataPluginsandon-demandchannelsisthatthedatavaluesareingeneralloadedinbuffers.
Whenanon-demandDataPluginiscalledtoloadallthedatafromagivenon-demandchannel,theDataPluginengineusuallycallstheyourCodeHere_raw.
vimultipletimestoloadthedatavaluesbufferbybufferforthatchannel.
TheDataPluginenginedecideswhatbuffersizetouseandhowmanytimestocalltheyourCodeHere_raw.
vi,soyouneitherhavetoworryaboutthatnorcanyouaffectthebuffersizeyourself.
ThisiswhytheyourCodeHere_raw.
vihas"Offset"and"Count"inputs,sothattheDataPluginenginecantellyouwhichdatabuffertoloadfromtherequestedchannel.
Thisalsomeansthatwhentheon-demandDataPluginiscalledtoloadthefirst100valuesfroma100,000valueon-demandchannel,thattheDataPlugincanveryefficientlyjustloadtheneededvaluesandnothavetoprocessall100,000unnecessarily.
Again,forverylargefileswithadatafileformatthatoffersexcellentrandomaccess,thisisanidealfit.
ASCIIfiles,however,areparticularlybadfortheon-demandDataPlugins,becauseinordertoforwardthefilecursortothecorrect"Offset"position,youhavetoparsealltheendlinecharactersinthefileuptothatpoint,andthisyoumustdoalloveragainforeverysuccessivebufferread.
InthisparticularcaseyoumightwanttothinkofusingVBSDataPluginsastheyprovidebuilt-inoptimizedon-demandASCII(andbinary)readers.
Onemorescenariowhereon-demandDataPluginsshine(providedafileformatwithreasonablerandomaccess)iswhentheDataPluginiscalledtoloadallthevaluesfromonlyonechanneloutof,forexample,200.
InthiscaseyoucanreadthewholefilemuchfasterandonlystoredatainLabVIEWmemoryfromonechannelinsteadofall200.
Furthermorethereistheadvantagethatyoudonotunnecessarilyloaddatavalueswhenonlydescriptiveinformationisbeingrequested.
Insummary,thetypeofDataPluginyouchoosedependspartlyonyourfileformat,partlyonyouraveragefilesizerelativetoRAM,andpartlyonyourtypicalloading/indexingusecases.
NationalInstruments|2-12CreatingDataPluginswithLabVIEWInthischapteryouwilllearnhowtoadaptpredefinedLabVIEWprojects,howtotestyourDataPlugin,andhowtosettheDataPluginparameters.
LabVIEWProjectFoldersLabVIEWDataPluginsarebuiltbyadaptingpredefinedLabVIEWprojectstoyourspecificneeds.
UsetheProjectExplorertoloadsuchapredefinedproject.
Youcanalsoaccesstheseexamplesbybrowsingtothefolderlabviewexamplesfiledataplugin.
Figure2-1.
LabVIEWProjectLayoutforOn-DemandDataPluginsTheLabVIEWprojectfolderAdaptthistoyourfileformatcontainsyouractualfile-format-specificsourcecodetoreadthedatafromtheparticulardatafilethatyourDataPluginsupports.
Intheone-shotcasethisistheyourCodeHere.
vi,whileintheon-demandcasethisisboththeyourCodeHere_meta.
viandthe2-2|ni.
comChapter2CreatingDataPluginswithLabVIEWyourCodeHere_raw.
vi.
YoushouldadaptthecodeinthisprojectfolderfromoneoftheLabVIEWDataPluginexamples,sincetheinputandoutputterminalsoftheseVIsmustremainthesamefortherestoftheDataPluginarchitecturetocallyourVIscorrectly.
RefertoLabVIEWDataPluginTypesinChapter1,AnIntroductiontotheLabVIEWDataPluginSDKforinformationaboutthecorrectDataPlugintype,andthusthecorrectexampleprojecttostartwith.
ThisprojectfolderalsoincludesarequiredRegisterLabVIEWDataPlugin.
inifile,whichyouneedtoeditinordertomatchtheexpectedfileextension,programmingnameoftheDataPlugin,associatedDataPluginiconfile,andsoon.
Theoptional.
icofilethatisassociatedwiththeDataPluginisthelastresourcefileinthisprojectfolder.
RefertoAdaptingtheLabVIEWProjectBuildinthischapterforfurtherinformation.
TheLabVIEWprojectfolderDon'tchangethiscontainsseveralfileswhichcomprisetheheartoftheLabVIEWDataPluginarchitectureandshouldneverbeeditednordeletedinyourDataPluginproject.
TheLabVIEWprojectfolderFortestingcontainsseveralcompletelyoptionalfileswhichshouldbeusefultoyouindebuggingandtestingyourDataPlugin.
RefertoDebuggingandTestingYourLabVIEWDataPlugininthischapterforfurtherinformation.
TheLabVIEWprojectfolderDependenciescontainsfilesorfilereferenceswhichneedtobeincludedinthebuiltsourcedistributionthatgoesintheinstaller—ingeneralyoushouldnotneedtochangeanythingbyhandhere.
ThelistofincludedVIsbeginswithallthevi.
libfilesusedinyourproject.
AnyadditionallyincludedsubVIscanshowuphere,andanyincludedDLLs,suchasthelvStorage.
dll(always)orthelvanlsis.
dllalsoappearhere.
TheLabVIEWprojectfolderBuildSpecificationscontainstheconfigurationsforcreatingtheDataPluginDLLandforbuildingtheLabVIEWDataPlugininstaller.
AlltheLabVIEWcodeintheDataPluginisbuiltintotheDataPluginDLL,andtheinstallerorchestratestheinstallationoftheDataPluginDLLandafewotherresourcefiles,aswellasthesubsequentregistrationoftheDataPluginwiththehostcomputer.
IngeneralyoushouldnotneedtochangeanythingintheDataPluginDLLconfiguration,exceptperhapsthetargetnameoftheDLL.
TheDataPlugininstallerisanothermatter.
RefertoAdaptingtheLabVIEWProjectBuildinthischapterforfurtherinformation.
DebuggingandTestingYourLabVIEWDataPluginTheLabVIEWprojectfolderFortestingcontainsseveralcompletelyoptionalfileswhichshouldbeusefultoyouintestingyourDataPlugin.
ThefirstoftheseisanexampleTestDataFile.
xxxxxforyoutotrytoloadwiththeDataPlugincode.
ThisisusefultoyouonlyifyouaregettingfamiliarwithLabVIEWDataPluginarchitectureandusingoneoftheexampleswithoutanyedits.
Itisagoodpractice,though,toaddasampledatafiletothisprojectfoldersothatyouorothershaveaneasywaytotest/editthesourcecodelateron.
NationalInstruments|2-3LabVIEWDataPluginSDKThesecondfileisaCreateTestDataFile.
viwithwhichyoucancreateadditionaltestdatafileswithdifferenttypesofdataand/ordifferentfilesizes.
Again,thisisonlyusefulintheuneditedexamples,andhereyoushouldonlyincludeoneforyourDataPluginifyouhappentohaveithandy.
ThethirdfileisaCreateDataPluginOutputFile.
vi,whichenablesyoutotestyourDataPlugincode,priortobuildingandrunningtheDataPlugininstallerandwhilestillinLabVIEW.
ThisVIsimulatesthewaytheDataPluginarchitecturecallstheyourCodeHere…viyouedited,andthendisplaystheresultingloadeddatainapop-up,interactiveVI.
YoushouldusethisVItodebugyourcode,priortobuildingtheinstaller,sothatyoucanuseLabVIEWdebuggingtoidentifythesourceofanyerrorsorincorrectdataloading.
FeelfreetolookatthisVI'sblockdiagramtogainaclearerunderstandingofwhattheDataPluginarchitectureisdoingwithyourcode.
UsetheDataFileViewer.
viintheFileI/OStorageVIs/DataPluginspalettetotestthebuiltandinstalledDataPluginfromwithinLabVIEW.
AdaptingtheLabVIEWProjectBuildInthissectionyouwilllearnhowtosettheDataPluginparameterssuchastheDataPluginnameandthesupportedfileextensions.
Additionallyyouwilllearnhowtochangethebuildconfiguration.
DataPluginParameterizationTopersonalizeyourLabVIEWDataPlugin,youneedtoeditthecontentoftheRegisterLabVIEWDataPlugin.
inifromtheAdaptthistoyourfileformatprojectfolder.
BelowisthecontentoftheRegisterLabVIEWDataPlugin.
inifileintheLabVIEWDataPluginexample"DatalogDataPluginondemand":[LVDataPluginDatalog]Name=LVDataPluginDatalogFileExtension=*.
lvlogPluginFileName=LabVIEWDataPluginDatalog.
dllIconFileName=Datalog.
icoThefirstlinesetstheNameoftheDataPlugin,asitislistedintheUSIconfigurationfileandhowitshowsupintheuserdialogboxesinDIAdemandtheDataFinder.
ItisalsotheprogrammaticnameoftheDataPluginforLabVIEWVIsandDIAdemscripts.
Youjustneedtomakesureyoupickauser-friendlynamethatisdifferentfromallotherDataPluginswhichmightbeonyourtargethostcomputers.
TheFileExtensionoftheDataPluginisthedefaultfileextensionorextensionsthatareassociatedwiththisDataPlugininDIAdemandtheDataFinder.
Multipleextensionscanbespecifiedbyusingsemicolonasaseparatorbetweeneachextension.
2-4|ni.
comChapter2CreatingDataPluginswithLabVIEWNotePleasenotethatDataPluginswithwildcardsasextensions,forexample*.
*or*.
lvog,arenotusedbyDataFinderforindexing.
ThePluginFileNameoftheDataPluginisthenameoftheDataPluginDLL–makesureitmatchesthenamelistedintheDataPluginDLLconfigurationdialogboxaswellasthenameintheinstallerconfigurationdialogbox.
TheIconFileNameoftheDataPluginisthe.
icofilewhichisassociatedwithyourDataPlugin—makesurethismatchestheactualnameoftheiconfileintheAdaptthistoyourfileformatprojectfolder.
IfyouchoosetotakethedefaultDataPluginicon,youcanendthislinewiththe"="sign.
Youalsoneedtochangethenameoftheassociated.
icofileintheSourceFilesDestinationViewtomatchyouractualiconfile,orelsedeletetheiconfilefromtheSourceFilesDestinationViewifyouchoosenottohaveone.
NoteTocreateyourowniconfilesyoumustuseanappropriategraphicsprogram,forexampleyoucouldbuyAxialisIconWorkshop(www.
axialis.
com).
Theiconsizeshouldbe16*16pixels.
BuildConfigurationTheDataPluginDLLconfigurationdoesnotrequirechanges,becauseitalwaysbuildstheDLLstartingwiththeDataPluginarchitecturecodeintheDon'tchangethisprojectfolder,whichyouneverneedtoedit.
Youwill,however,probablychoosetochangethetargetnameoftheDataPluginDLLtobetterreflectthenameofyourparticularDataPlugin.
YoushouldsimilarlychangetheProductInformationProductNameintheinstallerconfiguration.
TheDataPlugininstallerincludestheresultingDataPluginDLLaswellastheRegisterLabVIEWDataPlugin.
exefromtheDon'tchangethisprojectfolderandtheRegisterLabVIEWDataPlugin.
iniplusanyassociatediconfilefromtheAdaptthistoyourfileformatprojectfolder.
IfyouchangethenameoftheDataPluginDLLintheDLLbuildconfiguration,youhavetomakecorrespondingnamechangestotheresulting.
dll,.
h,.
ini,.
libfilesintheSourceFilesDestinationView.
Youmaywanttoremovethe"NILabVIEWRun-TimeEngine"fromthe"AdditionalInstallers"sectiontoreducethesizeoftheresultinginstaller.
Ifyoudothis,youareassumingthatalltheclientsthatwilleverinstallyourDataPluginwillpreviouslyandseparatelyhaveinstalledthesameLabVIEWRun-TimeEngineversionthattheDataPluginisusing.
IngeneralitissafertoincludetheLabVIEWRun-TimeEngineintheDataPlugininstaller.
Somethingelseyoudonotneedtochangebutshouldbeawareof,isthatthelaststepofyourDataPlugininstallerkicksoffanadditionalinstallercalledRegisterLabVIEWDataPlugin.
exe,whichislocatedintheDon'tchangethisprojectfolder.
Thisadditionalinstallermustbeselectedtoruninthe"Advanced"sectionoftheinstallerconfiguration,becausethisiswhatregisterstheDataPluginwiththehostcomputeraftertheDataPluginhassuccessfullyinstalledontothehostcomputer.
NationalInstruments|3-13ConstraintsInthischapteryouwilllearnwhichdatatypesDataPluginssupport,andwhichchannellengthlimitationandnameconventionsyouhavetoconsider.
ChannelLengthLimitationDataPluginscurrentlycanonlydeclarechannelstohavealengthfrom0to231.
Ifyoupassmorethan231valuestoaDataPluginchannel,theDataPluginthrowsanerror.
SupportedDataTypesandConversionsYoucanimportthefollowingdatatypeswithaDataPlugin:Time,U8,I8,I16,U16,I32,U32,I64,U64,SGL,DBLOnlythefollowingdatatypesarenativelysupportedbyDataPlugins:Time,U8,I16,I32,SGL,DBLAllotherdatatypesaretypeconvertedwhenpassedtotheDataPlugin.
ThefinalconvertedtypecandependonwhichVIyouusetopassthedatatotheDataPlugin.
IfyouusethestandardWriteData.
viexpressVIfromtheStorageVIpalette,thefollowingtypeconversionsautomaticallyoccur:I8I16U16I32U32I32I64DBLWaveformU64DBLWaveform3-2|ni.
comChapter3ConstraintsIfyouarereadingU32,U64,orI64data,youshouldusetheWriteChannelValues.
viinstead(seebelow).
IfyouuseinsteadtheWriteChannelValues.
vi(whichyoucanfindintheDatalogexampleproject),thefollowingtypeconversionsautomaticallyoccur:NoteEvenherethe64bitintegerconversionsstillinsomecasesresultinlossofdata,soifyouaredealingwithdigitalports,forexample,youmightwanttomapaU64intofourseparateU16DataPluginchannels(whichwouldautomaticallybeconvertedtoI32internally).
NoteNoneofthefollowingdatatypesaresupportedatallinDataPlugins:Booleans,Clusters,extendeddatatypes,orarraysofgreaterdimensionalitythan1D.
NameConventionsAllchannelgroupswithinaLabVIEWDataPluginandallchannelswithinaspecificchannelgroupshouldhaveauniquename.
Thesameappliestocustompropertiesaddedtothefile,channelgrouporchannellevel.
Additionallysomecharactersmaynotbeusedinnames.
Pleasefindbelowatablelistingthosespecialcharacters.
ThefollowingpropertynamesforfilehaveaspecialmeaningintheTDMdatamodel:author,datestring,datetime,description,name,mime_type,registertxt1,registertxt2,registertxt3,timestring,title,wf_create_time.
I8I16U16I32U32DBLI64DBLU64DBLAreaofUsageForbiddenCharactersFilenames(Datasetnames)ChannelgroupnamesChannelnamesPropertynamesandaspaceNationalInstruments|3-3LabVIEWDataPluginSDKThefollowingpropertynamesforfilearereservedforinternaluse:channelgroups,children,environment,external_references,id,instance_attributes,objecttype,parent,registercomments,version,version_date.
ThefollowingpropertynamesforchannelgroupshaveaspecialmeaningintheTDMdatamodel:description,measurement_begin,measurement_end,mime_type,name,registertxt1,registertxt2,registertxt3.
Thefollowingpropertynamesforchannelgroupsarereservedforinternaluse:channels,children,equipments,external_references,id,index,instance_attributes,measurement_quantities,objecttype,parent,root,sequences,submatrices,test,units_under_test,version,version_date.
ThefollowingpropertynamesforchannelshaveaspecialmeaningintheTDMdatamodel:description,displaytype,maximum,mime_type,minimum,monotony,name,novaluekey,registerint1,registerint2,registerint3,registerint4,registerint5,registerint6,registertxt1,registertxt2,registertxt3,registerval1,registerval2,registerval3,registerval4,registerval5,registerval6,unit_string,wf_increment,wf_samples,wf_start_offset,wf_start_time,wf_xnametype,wf_xunit_string.
Thefollowingpropertynamesforchannelsarereservedforinternaluse:average,channel,children,datatype,deletebehaviour,dimension,empty,external_references,flagkey,group,groupindex,id,implicit_increment,implicit_start,instance_attributes,internal_params,internal_res1,internal_res2,interpolation,is_scaled_by,length,lengthmax,local_columns,measurement,number,objecttype,parent,quantity,rank,representation,scales,sourcedatafilename,sourcedatafilepath,sourcegenparam1,sourcegenparam2,sourcehandle,sourceinstancekey,sourcename,sourceparentname,sourcerepresentation,sourcetype,sourcevalue,standard_deviation,status,type_size,unit,valuetype,version,version_date,waveform,writeprotection.
SupportedLabVIEWVersionsDataPluginshavebeensupportedinLabVIEWStorageVIssinceLabVIEW2010.
InearlierversionsDataPluginscouldbeusedbyaworkaround.
NoteUseaDataPluginbuiltwiththeLabVIEWDataPluginSDKonlywiththesameLabVIEWversionwithwhichyoucreatedthisDataPlugin.
ThesameappliesifthisDataPluginisusedtogetherwiththeLabVIEWDataFinderToolkit.
NationalInstruments|A-1ATechnicalSupportandProfessionalServicesLogintoyourNationalInstrumentsni.
comUserProfiletogetpersonalizedaccesstoyourservices.
Visitthefollowingsectionsofni.
comfortechnicalsupportandprofessionalservices:Support—Technicalsupportatni.
com/supportincludesthefollowingresources:–Self-HelpTechnicalResources—Foranswersandsolutions,visitni.
com/supportforsoftwaredriversandupdates,asearchableKnowledgeBase,productmanuals,step-by-steptroubleshootingwizards,thousandsofexampleprograms,tutorials,applicationnotes,instrumentdrivers,andsoon.
RegisteredusersalsoreceiveaccesstotheNIDiscussionForumsatni.
com/forums.
NIApplicationsEngineersmakesureeveryquestionsubmittedonlinereceivesananswer.
–StandardServiceProgramMembership—ThisprogramentitlesmemberstodirectaccesstoNIApplicationsEngineersviaphoneandemailforone-to-onetechnicalsupport,aswellasexclusiveaccesstoeLearningtrainingmodulesatni.
com/elearning.
Allcustomersautomaticallyreceiveaone-yearmembershipintheStandardServiceProgram(SSP)withthepurchaseofmostsoftwareproductsandbundlesincludingNIDeveloperSuite.
NIalsooffersflexibleextendedcontractoptionsthatguaranteeyourSSPbenefitsareavailablewithoutinterruptionforaslongasyouneedthem.
Visitni.
com/sspformoreinformation.
Forinformationaboutothertechnicalsupportoptionsinyourarea,visitni.
com/services,orcontactyourlocalofficeatni.
com/contact.
TrainingandCertification—Visitni.
com/trainingfortrainingandcertificationprograminformation.
Youcanalsoregisterforinstructor-led,hands-oncoursesatlocationsaroundtheworld.
SystemIntegration—Ifyouhavetimeconstraints,limitedin-housetechnicalresources,orotherprojectchallenges,NationalInstrumentsAlliancePartnermemberscanhelp.
Tolearnmore,callyourlocalNIofficeorvisitni.
com/alliance.
YoualsocanvisittheWorldwideOfficessectionofni.
com/niglobaltoaccessthebranchofficeWebsites,whichprovideup-to-datecontactinformation,supportphonenumbers,emailaddresses,andcurrentevents.

AlphaVPS(€3.99/月)VPS年付15欧,AMD EYPC+NVMe系列起

AlphaVPS是一家保加利亚本土主机商(DA International Group Ltd),提供VPS主机及独立服务器租用等,数据中心包括美国(洛杉矶/纽约)、德国、英国和保加利亚等,公司办公地点跟他们提供的保加利亚数据中心在一栋楼内,自有硬件,提供IPv4+IPv6,支持PayPal或者信用卡等方式付款。商家提供的大硬盘VPS主机,提供128GB-2TB磁盘,最低年付15欧元起,也可以选择...

EtherNetservers年付仅10美元,美国洛杉矶VPS/1核512M内存10GB硬盘1Gpbs端口月流量500GB/2个IP

EtherNetservers是一家成立于2013年的英国主机商,提供基于OpenVZ和KVM架构的VPS,数据中心包括美国洛杉矶、新泽西和杰克逊维尔,商家支持使用PayPal、支付宝等付款方式,提供 60 天退款保证,这在IDC行业来说很少见,也可见商家对自家产品很有信心。有需要便宜VPS、多IP VPS的朋友可以关注一下。优惠码SUMMER-VPS-15 (终身 15% 的折扣)SUMMER-...

轻云互联,香港云服务器折后22元/月 美国云服务器 1核 512M内存 15M带宽 折后19.36元/月

轻云互联成立于2018年的国人商家,广州轻云互联网络科技有限公司旗下品牌,主要从事VPS、虚拟主机等云计算产品业务,适合建站、新手上车的值得选择,香港三网直连(电信CN2GIA联通移动CN2直连);美国圣何塞(回程三网CN2GIA)线路,所有产品均采用KVM虚拟技术架构,高效售后保障,稳定多年,高性能可用,网络优质,为您的业务保驾护航。官方网站:点击进入广州轻云网络科技有限公司活动规则:1.用户购...

iconworkshop为你推荐
关于上报下学期所需教学软件的通知combininggoogle巧摄专业版使用指南微信群里正在组织赌博支持ipad支持ipad支持ipadxp如何关闭445端口Windows XP 怎么关闭445端口,我是电脑小白,求各位讲详细点联通iphone4北京 朝阳区 哪家联通店可以卖Iphone4的,本周周末过去买谷歌sb为什么搜索SB第一个是google?
广州主机租用 3322动态域名 html空间 qingyun 数字域名 hostloc 域名接入 免费asp空间 东莞服务器托管 lamp兄弟连 阵亡将士纪念日 网络速度 免费赚q币 免费获得q币 winserver2008r2 hosts文件 西部数码主机 美国达拉斯 ddos攻击软件 56折扣网 更多