From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
|
所有NI-78xx R系列卡片上的數位通道都是雙向的。就如同一般的TTL和CMOS訊號,Digital Input(DI)為high impedance的電路,不需要使用latch來維持先前的狀態。Digital Output(DO)則為low impedance電路,需要latch來維持要輸出的狀態電壓。為了讓Ditial Input和Digital Output共用同一個數位接腳,因此會採用稱為Digital Enable的switch來作切換的動作。下圖為其內部的線路圖。
使用LabVIEW FPGA來控制數位通道是很容易的一件事,DO函數會將要輸出的狀態寫至Digital Data (DO),然後將Digital Enable的狀態設成true藉而切換switch。因此數位通道若要做輸出的動作,就只需使用DO函數。若要讀回先前的輸出狀態也相當簡單,只需要從digital line (DI)做讀取的動作即可。換言之,針對進階的功能例如雙向通訊,就會需要使用DD和DE。
雙向通訊:
執行完DO後若需要執行雙向通訊,要先對DE作寫入False的動作。接著,使用FPGA method Node的Set Output Enable method,讓數位通道是由外部供電,然後就可以使用DI讀取輸入值為何。若數位通道已經不需要由外部供電了,再將輸出值寫至DO並將DE切換為true(注意這跟DO函數是ㄧ樣的動作)。
|