LabVIEW使用移位寄存器
前面板
1.
2.
3.

練習(xí)四
流程圖
1.按下圖創(chuàng)建流程圖。

練習(xí)四
2.在流程圖中添加
a.
b.
3.Random
4.Compound
5.除法函數(shù)(Functions»Numeric)——在本練習(xí)中,它用于返回最近四個隨機(jī)數(shù)的平均值。
6.數(shù)值常數(shù)(Functions»Numeric)——在While循環(huán)的每個周期,Random
7.Wait
8.用鼠標(biāo)右鍵單擊Wait
9.將Constant設(shè)置為500。這樣連接到函數(shù)的數(shù)值常數(shù)設(shè)置了500毫秒的等待時間。因此循環(huán)每半秒執(zhí)行一次。注意,VI用一個隨機(jī)數(shù)作為移位寄存器的初始值。如果沒有設(shè)置移位寄存器端子的初始值,它就含有一個默認(rèn)的數(shù)值,或者上次運(yùn)行結(jié)束時的數(shù)值,因此開始得到的平均數(shù)沒有任何意義。
10.執(zhí)行該
11.把該
評論