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.
|
在LabVIEW 8.5.x中,LabVIEW FPGA的Math and Analysis函數只支援整數資料型態。假如直接將定點數傳入該函數,小數部份會被截去使得該值轉變為整數。
為了在整數IP中使用定點數,您必須透過將定點數的長度增加到該整數的大小以達成符號延長(sign extend)。接下來的步驟詳細介紹了將定點數資料以整數型態傳入DC and RMS Measurements Express VI(使用I16資料型態)。注意,為了確保Number to Boolean Array使用固定維度的陣列,您必須設定VI Properties,選擇Execution並勾選陣列與字串的Autopreallocate。
定點數轉換整數
整數轉換定點數
下方附件為使用PID, DC/RMS,以及sinwave產生的範例程式。
|