loading

Logout succeed

Logout succeed. See you again!

ebook img

What Is Data Acquisition Toolbox? PDF

pages744 Pages
release year2007
file size4.05 MB
languageEnglish

Preview What Is Data Acquisition Toolbox?

Data Acquisition Toolbox 2 User’s Guide How to Contact The MathWorks www.mathworks.com Web comp.soft-sys.matlab Newsgroup www.mathworks.com/contact_TS.html Technical Support [email protected] Productenhancementsuggestions [email protected] Bug reports [email protected] Documentationerrorreports [email protected] Orderstatus,licenserenewals,passcodes [email protected] Sales,pricing,andgeneralinformation 508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 Forcontactinformationaboutworldwideoffices,seetheMathWorksWebsite. DataAcquisitionToolboxUser’sGuide ©COPYRIGHT1999–2007byTheMathWorks,Inc. Thesoftwaredescribedinthisdocumentisfurnishedunderalicenseagreement.Thesoftwaremaybeused orcopiedonlyunderthetermsofthelicenseagreement. Nopartofthismanualmaybephotocopiedor reproducedinanyformwithoutpriorwrittenconsentfromTheMathWorks,Inc. FEDERALACQUISITION:ThisprovisionappliestoallacquisitionsoftheProgramandDocumentation by,for,orthroughthefederalgovernmentoftheUnitedStates. ByacceptingdeliveryoftheProgramor Documentation,thegovernmentherebyagreesthatthissoftwareordocumentationqualifiesascommercial computersoftwareorcommercialcomputersoftwaredocumentationassuchtermsareusedordefined inFAR12.212,DFARSPart227.72,andDFARS252.227-7014. Accordingly,thetermsandconditionsof thisAgreementandonlythoserightsspecifiedinthisAgreement,shallpertaintoandgoverntheuse, modification,reproduction,release,performance,display,anddisclosureoftheProgramandDocumentation bythefederalgovernment(orotherentityacquiringfororthroughthefederalgovernment)andshall supersedeanyconflictingcontractualtermsorconditions. IfthisLicensefailstomeetthegovernment’s needsorisinconsistentinanyrespectwithfederalprocurementlaw,thegovernmentagreestoreturnthe ProgramandDocumentation,unused,toTheMathWorks,Inc. Trademarks MATLAB,Simulink,Stateflow,HandleGraphics,Real-TimeWorkshop,SimBiology, SimHydraulics, SimEvents, andxPCTargetBoxareregisteredtrademarksandThe MathWorks, theL-shapedmembranelogo,EmbeddedMATLAB,andPolySpaceare trademarksofTheMathWorks,Inc. Otherproductorbrandnamesaretrademarksorregisteredtrademarksoftheirrespective holders. Patents The MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patentsformoreinformation. Revision History May1999 Firstprinting NewforVersion1 November2000 Secondprinting RevisedforVersion2(Release12) June2001 Thirdprinting RevisedforVersion2.1(Release12.1) July2002 Onlineonly RevisedforVersion2.2(Release13) June2004 Onlineonly RevisedforVersion2.5(Release14) October2004 Onlineonly RevisedforVersion2.5.1(Release14SP1) March2005 Onlineonly RevisedforVersion2.6(Release14SP2) September2005 Onlineonly RevisedforVersion2.7(Release14SP3) October2005 Reprint Version2.1(Noticeupdated) November2005 Onlineonly RevisedforVersion2.8(Release14SP3+) March2006 Fourthprinting RevisedforVersion2.8.1(Release2006a) September2006 Onlineonly RevisedforVersion2.9(Release2006b) March2007 Onlineonly RevisedforVersion2.10(Release2007a) May2007 Fifthprinting MinorrevisionforVersion2.10 September2007 Onlineonly RevisedforVersion2.11(Release2007b) Contents Introduction to Data Acquisition 1 WhatIsDataAcquisitionToolbox? .................. 1-3 UnderstandingTheDataAcquisitionToolbox .......... 1-3 ExploringtheToolbox .............................. 1-4 SupportedHardware ............................... 1-4 AnatomyofaDataAcquisitionExperiment .......... 1-5 SystemSetup ..................................... 1-5 Calibration ....................................... 1-5 Trials ........................................... 1-6 DataAcquisitionSystem ........................... 1-7 Overview ........................................ 1-7 DataAcquisitionHardware ......................... 1-9 Sensors .......................................... 1-11 SignalConditioning ............................... 1-15 TheComputer .................................... 1-17 Software ......................................... 1-17 AnalogInputSubsystem ........................... 1-20 FunctionoftheAnalogInputSubsystem .............. 1-20 Sampling ........................................ 1-20 Quantization ..................................... 1-24 ChannelConfiguration ............................. 1-28 TransferringDatafromHardwaretoSystemMemory ... 1-31 MakingQualityMeasurements ...................... 1-34 WhatDoYouMeasure? ............................. 1-34 AccuracyandPrecision ............................. 1-34 Noise ........................................... 1-38 MatchingtheSensorRangeandA/DConverterRange ... 1-40 HowFastShouldaSignalBeSampled? ............... 1-40 GettingCommand-LineFunctionHelp .............. 1-45 v SelectedBibliography .............................. 1-46 Getting Started Using Data Acquisition Toolbox 2 InstallationInformation ........................... 2-2 BeforeYouInstall ................................. 2-2 ToolboxInstallation ................................ 2-2 HardwareandDriverInstallation .................... 2-3 ToolboxComponents ............................... 2-4 ToolboxComponents: InformationandInteraction ...... 2-4 M-FileFunctions .................................. 2-6 DataAcquisitionEngine ............................ 2-6 HardwareDriverAdaptor ........................... 2-9 SupportedHardware ............................... 2-9 UnsupportedHardware ............................ 2-11 AccessingYourHardware .......................... 2-12 ConnectingtoYourHardware ....................... 2-12 AcquiringData ................................... 2-12 OutputtingData .................................. 2-13 ReadingandWritingDigitalValues .................. 2-14 AcquiringDatainaLoop ........................... 2-16 UnderstandingtheToolboxCapabilities ............. 2-17 ContentsM-File ................................... 2-17 DocumentationExamples ........................... 2-17 QuickReferenceGuide ............................. 2-18 Demos .......................................... 2-18 ExaminingYourHardwareResources ............... 2-19 UsingthedaqhwinfoFunction ....................... 2-19 GeneralToolboxInformation ........................ 2-19 Adaptor-SpecificInformation ........................ 2-20 DeviceObjectInformation .......................... 2-21 GettingHelp ...................................... 2-23 vi Contents ThedaqhelpFunction .............................. 2-23 ThepropinfoFunction .............................. 2-23 Data Acquisition Session 3 UnderstandingtheDataAcquisitionSession ......... 3-2 Overview ........................................ 3-2 Example: TheDataAcquisitionSession ............... 3-3 CreatingaDeviceObject ........................... 3-5 UnderstandingDeviceObjects ....................... 3-5 CreatinganArrayofDeviceObjects .................. 3-6 WhereDoDeviceObjectsExist? ...................... 3-7 HardwareChannelsorLines ....................... 3-9 AddingChannelsandLines ......................... 3-9 MappingHardwareChannelIDstoMATLABIndices .... 3-10 ConfiguringandReturningProperties .............. 3-13 Overview ........................................ 3-13 PropertyTypes ................................... 3-13 ReturningPropertyNamesandPropertyValues ........ 3-15 ConfiguringPropertyValues ........................ 3-19 SpecifyingPropertyNames ......................... 3-21 DefaultPropertyValues ............................ 3-21 ThePropertyInspector ............................. 3-22 AcquiringandOutputtingData ..................... 3-23 DeviceObjectStates ............................... 3-23 StartingtheDeviceObject .......................... 3-24 LoggingorSendingData ........................... 3-24 StoppingtheDeviceObject .......................... 3-25 CleaningUp ....................................... 3-27 vii Getting Started with Analog Input 4 CreatinganAnalogInputObject .................... 4-3 AddingChannelstoanAnalogInputObject .......... 4-5 ChannelGroup ................................... 4-5 ReferencingIndividualHardwareChannels ............ 4-7 Example: AddingChannelsforaSoundCard ........... 4-8 ConfiguringAnalogInputProperties ................ 4-10 AnalogInput: BasicProperties ...................... 4-10 TheSamplingRate ................................ 4-11 TriggerTypes .................................... 4-12 TheSamplestoAcquireperTrigger .................. 4-13 AcquiringData .................................... 4-15 StartingtheAnalogInputObject ..................... 4-15 LoggingData ..................................... 4-15 StoppingtheAnalogInputObject .................... 4-16 AnalogInputExamples ............................ 4-17 BasicStepsforAcquiringData ...................... 4-17 AcquiringDatawithaSoundCard ................... 4-17 AcquiringDatawithaNationalInstrumentsBoard ..... 4-21 EvaluatingtheAnalogInputObjectStatus ........... 4-25 StatusProperties .................................. 4-25 TheDisplaySummary ............................. 4-26 Doing More with Analog Input 5 ConfiguringandSamplingInputChannels .......... 5-2 PropertiesAssociatedwithConfiguringandSamplingInput Channels ...................................... 5-2 InputChannelConfiguration ........................ 5-2 viii Contents SamplingRate .................................... 5-5 ChannelSkew .................................... 5-6 ManagingAcquiredData ........................... 5-8 AnalogInputDataManagementProperties ............ 5-8 PreviewingData .................................. 5-8 RulesforUsingpeekdata ........................... 5-9 ExtractingDatafromtheEngine ..................... 5-11 ReturningTimeInformation ........................ 5-16 ConfiguringAnalogInputTriggers .................. 5-19 AnalogInputTriggerProperties ..................... 5-19 DefiningaTrigger: TriggerTypesandConditions ....... 5-20 ExecutingtheTrigger .............................. 5-25 TriggerDelays .................................... 5-26 RepeatingTriggers ................................ 5-30 HowManyTriggersOccurred? ....................... 5-35 WhenDidtheTriggerOccur? ........................ 5-36 Device-SpecificHardwareTriggers ................... 5-37 EventsandCallbacks .............................. 5-45 UnderstandingEventsandCallbacks ................. 5-45 EventTypes ...................................... 5-45 RecordingandRetrievingEventInformation ........... 5-48 CreatingandExecutingCallbackFunctions ............ 5-52 Examples: UsingCallbackPropertiesandFunctions .... 5-54 LinearlyScalingtheData: EngineeringUnits ........ 5-57 AnalogInputEngineeringUnitsProperties ............ 5-57 Example: PerformingaLinearConversion ............. 5-59 LinearConversionwithAsymmetricData ............. 5-60 Analog Output 6 GettingStartedwithAnalogOutput ................. 6-2 CreatinganAnalogOutputObject ................... 6-2 AddingChannelstoanAnalogOutputObject .......... 6-3 ConfiguringAnalogOutputProperties ................ 6-5 ix OutputtingData .................................. 6-7 AnalogOutputExamples ........................... 6-9 EvaluatingtheAnalogOutputObjectStatus ........... 6-12 ManagingOutputData ............................. 6-16 TheAnalogOutputSubsystem ...................... 6-16 QueuingDatawithputdata ......................... 6-16 Example: QueuingDatawithputdata ................. 6-18 ConfiguringAnalogOutputTriggers ................ 6-20 AnalogOutputTriggerProperties .................... 6-20 DefiningaTrigger: TriggerTypes .................... 6-21 ExecutingtheTrigger .............................. 6-22 HowManyTriggersOccurred? ....................... 6-22 WhenDidtheTriggerOccur? ........................ 6-23 Device-SpecificHardwareTriggers ................... 6-24 EventsandCallbacks .............................. 6-26 UnderstandingEventsandCallbacks ................. 6-26 EventTypes ...................................... 6-26 RecordingandRetrievingEventInformation ........... 6-29 Examples: Using Callback Properties and Callback Functions ...................................... 6-32 LinearlyScalingtheData .......................... 6-35 EngineeringUnits ................................. 6-35 Example: PerformingaLinearConversion ............. 6-36 StartingMultipleDeviceObjects .................... 6-38 Digital Input/Output 7 DigitalI/OObjects ................................. 7-3 CreatingaDigitalI/OObject ........................ 7-3 TheParallelPort .................................. 7-4 AddingLinestoaDigitalI/OObject ................. 7-6 x Contents

See more

The list of books you might like