下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、Lesson 5Timing an FPGA VITiming Express VIsImplementing Loop Execution RatesCreating Delays Between EventsMeasuring Time Between EventsBenchmarking Loop PeriodsA. Timing Express VIsLoop Timer Express VIImplementing Loop RatesWait Express VICreating Delays Between EventsTick Count Express VIBenchmark
2、ingB. Implementing Loop Execution RatesUse the Loop Timer Express VIWaits the value you specify in Count between loop iterationsControls the period of a loopPlace the Loop Timer Express VI inside a loopPerform I/O operations at a specific frequencyControl loop execution rateConfigure Loop TimerCount
3、er UnitsTicks clock cyclesSec microsecondsmSec millisecondsSize of Internal Counter32 Bit16 Bit8 BitSize of Internal Counter determines the maximum time a timer can track.To save space on the FPGA, use the smallest Size of Internal Counter possible.Loop Timer Express VI FunctionalityFirst iterationR
4、ecords current time as initial timeImmediately executes the code in the next frame without any delaySecond iterationAdds Count to initial time and waits until Count has elapsed from the initial recorded timeExecutes the code in the next frame after Count has elapsedSubsequent iterationsLoop Timer co
5、ntinues to increment the time record it initiated upon the first callDoes not reset each timeLoop Timer Express VI CaveatIf an execution instance is missed, such as when the logic in the loop takes longer to execute than the specified Count:Loop Timer returns immediately and establishes a new refere
6、nce time stamp for subsequent callsNo delayImplementing Loop Execution RatesWatch out for rolloverSize of Internal Counter determines the maximum time the timer can trackSize of Internal CounterTickssms32-bit1 to 4,294,967,296 ticks1 s to 71 minutes1 ms to 49 days16-bit1 to 65,536 ticks1 s to 65 ms1
7、 ms to 65 seconds8-bit1 to 256 ticks1 s to 256 us1 ms to 256 msTick PeriodTick period is based on the frequency of the FPGA clockIf using a 40MHz FPGA clock, the tick period is 25nsMust use ticks for nanosecond timingSize of Internal CounterTickssms32-bit1 to 4,294,967,296 ticks1 s to 71 minutes1 ms
8、 to 49 days16-bit1 to 65,536 ticks1 s to 65 ms1 ms to 65 seconds8-bit1 to 256 ticks1 s to 256 us1 ms to 256 mscRIO Module Loop Execution RatesSome cRIO modules have configurable timingDo not need to use Loop Timer Express VI to time loop rateExampleNI 9233You can configure the data rate at which the
9、 NI 9233 module acquires and returns dataStatic/Programmatic ConfigurationC-Series Module Properties dialog boxFPGA I/O Property NodeStatic Configuration of NI 9233 Data RateProgrammatic Configuration of NI 9233 Data RatecRIO Module Loop Execution RatesLoop Timer Express VI is not neededWhile Loop r
10、ate is determined by NI 9233 data rateIf other code in the loop executes at a slower rate, the loop rate will be limited by the other codeLoop Conditional TerminalFalse constant is acceptableFPGA logic is often meant to run indefinitely on the FPGAControls and application logic is still acceptableWh
11、ile Loop Iteration Terminal MaximumThe iteration terminal count will keep outputting 2,147,483,647 once it reaches this valueIf you need a counter to rollover when it reaches its maximum value, you should implement your own counterExercise 5-1: While Loop TimingUse the Loop Timer Express VI to time
12、a While Loop running on an FPGA VI.Exercise 5-1: While Loop Timing If the code in the second frame of the Sequence structure takes longer to execute than the value of AI Sample Time control, how long would each iteration of the While loop take?C. Creating Delays Between EventsUse Wait Express VI to
13、create a delay between eventsExamplesCreate delay between a trigger and subsequent outputCreate a series of delaysWait Express VI ConfigurationCounter UnitsSize of Internal CounterDetermines maximum possible wait timeComparing Loop Timer and Wait VIsCode structure is the sameLoop Timer does not wait
14、 the first time it is calledWait Express VI waits every iteration of the While LoopD. Measuring Time Between EventsTick Count Express VIReturns the value of a free-running FPGA counter in the units specifiedUse Tick Count Express VI to measure time between eventsExamplesMeasure the time between edge
15、s on a digital signalDetermine the execution time of a section of codeMeasuring Time Between EventsCalculate the difference between the results of two Tick Count Express VIs to determine the execution timeSubtract one from the result of the calculation to compensate for the execution time of the Tic
16、k Count Express VIE. Benchmarking Loop PeriodsUse Tick Count Express VI to measure loop periodsCalculate the time differenceRemove the benchmarking code laterBenchmarking code executes in parallelDoes not add additional time to the loop periodTick Count RolloverWatch out for rolloverIf the code you
17、are benchmarking takes more than the maximum value Tick Count can handle, the elapsed time will be much lower than expected due to rolloverSize of Internal CounterTickssms32-bit1 to 4,294,967,296 ticks1 s to 71 minutes1 ms to 49 days16-bit1 to 65,536 ticks1 s to 65 ms1 ms to 65 seconds8-bit1 to 256
18、ticks1 s to 256 us1 ms to 256 msExercise 5-2: While Loop BenchmarkingBenchmark the loop period of a While Loop containing code.Exercise 5-2: While Loop Benchmarking If you configured the Tick Count Express VI to use Counter Units of s or ms instead of Ticks, would the benchmarking results in this ex
19、ercise still be reasonable? If the code you want to benchmark executes within nanoseconds, what Counter Unit should you use?SummaryMatching QuizLoop Timer Express VIWait Express VITick Count Express VIUse to create delays between eventsUse to benchmark execution speedsUse to control loop execution r
20、ateSummaryMatching Quiz AnswersLoop Timer Express VIWait Express VITick Count Express VIUse to create delays between eventsUse to benchmark execution speedsUse to control loop execution rateSummaryQuizWhat is a potential drawback of using an 8-bit counter instead of a 32-bit counter?Decreased FPGA resources used32-bit clocks are slowerMaximum time the timer can track is not large enough for the applicationSummaryQuiz AnswerWhat is a potential drawback of using an 8-bit counter instead of a 32-bit counter?Decrea
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026秋招:潞寶集團面試題及答案
- (2025)老年癌癥患者免疫檢查點抑制劑相關毒性管理(2025SIOG建議)
- 2026秋招:遼寧文體旅產業(yè)發(fā)展集團筆試題及答案
- 2026秋招:金峰水泥集團面試題及答案
- 數字產品交互流程管理規(guī)范
- 數據質量評估管理辦法
- 數據備份與恢復管理實施細則
- 2025年數字媒體技術專業(yè)考試卷及答案
- 2026年大學(安全工程)實踐階段測試試題及答案
- 2025年湖北省綜合評標專家?guī)炜荚囶}庫及答案
- DB46-T 481-2019 海南省公共機構能耗定額標準
- 勞動合同【2026版-新規(guī)】
- 電子元器件入廠質量檢驗規(guī)范標準
- 中藥炮制的目的及對藥物的影響
- 688高考高頻詞拓展+默寫檢測- 高三英語
- 學生公寓物業(yè)管理服務服務方案投標文件(技術方案)
- 食品檢驗檢測技術專業(yè)介紹
- 2025年事業(yè)單位筆試-貴州-貴州財務(醫(yī)療招聘)歷年參考題庫含答案解析(5卷套題【單項選擇100題】)
- 二年級數學上冊100道口算題大全(每日一練共12份)
- 空壓機精益設備管理制度
- 國家開放大學《公共政策概論》形考任務1-4答案
評論
0/150
提交評論