【正文】
THEN 。 ELSIF ( button_var(0) or button_var(2) or floor_var(0))=39。 button_var(1):=39。 THEN next_state=S2。 IF (button_var(1) or button_var(3) or floor_var(2))=39。 floor_var(1):=39。 WHEN1101= dor=39。 THEN 二樓內上升請求; CASE ca_time IS WHEN 0011 = dor=39。 IF floor_var(1)=39。 cat:=39。 END IF。 ELSE next_state = S0。 up = 39。 THEN next_state = S1U。 ELSIF (button_var(1) OR button_var(2) or button_var(3) or floor_var(2) or floor_var(1))=39。 WHEN others = NULL。 ca_time:=0000。139。 ca_time:=0000。139。039。039。039。139。139。039。 position = 0001。 END IF。039。 END IF。139。139。 END IF。139。139。 END IF。139。139。 END IF。139。139。 END IF。139。139。 END IF。139。139。 END IF。139。139。139。 ELSIF clk39。 button_var( 3 DOWNTO 0):=0000。 dor=39。 up=39。039。 position = 0001。139。 VARIABLE ca_time : STD_LOGIC_VECTOR(3 DOWNTO 0)。 VARIABLE floor_var : STD_LOGIC_VECTOR( 2 DOWNTO 0)。 END PROCESS。 THEN 檢測時鐘上升沿 current_state = next_state。EVENT AND CLK=39。 中間變量:上升下降狀態(tài) SIGNAL dor : STD_LOGIC。 中間變量:當前狀態(tài) SIGNAL next_state : State。ARCHITECTURE Behav OF elevator15 IS TYPE State IS (S0,S1U,S1D,S2)。為下樓; )。為上樓,39。為關門; up_down : OUT STD_LOGIC 39。為開門,39。 39。position表示電梯當前位置信息。 button(0)為一層外上升請求,button(1)為二層外上升請求, button(2)為二樓外下降請求,Button(3)為三層外下降請求; floor : IN STD_LOGIC_VECTOR(2 DOWNTO 0)。 reset: IN STD_LOGIC。USE 。附錄B 程序清單LIBRARY IEEE。不像傳統(tǒng)的PC處理器,F(xiàn)PGA是并行處理器。你可以指定時鐘頻率為編譯的時間。當FPGA時鐘運行在40MHz時,這個例子中的循環(huán)運行的就很慢,因為每一組件需要長于一個時鐘循環(huán)的時間來執(zhí)行。圖二展示了在NI的RIO硬件上實現(xiàn)PID(比例積分微分)控制算法的FPGA應用和一組在Windows機器或RT對象和NI的RIO硬件通信的應用。當你把目標定為在NI的RIO(實時輸入輸出),LabVIEW就只顯示可以在FPGA中實現(xiàn)的功能,這樣進一步使得用LabVIEW為FPGA編程變簡單LabVIEW FPGA 模塊功能版上包含典型的LabVIEW結構與功能,比如while循環(huán)、for循環(huán)、case結構、sequence結構、一系列專業(yè)的LabVIEW 中FPGA專屬的數(shù)學函數(shù)、信號產生于分析、線性與非線性控制、對比邏輯、數(shù)組和簇操作、Occurrence(意思是事件發(fā)生,Occurrence技術也用于控制相互獨立的程序同步運行)、信號輸入與輸出和定時。利用LabVIEW和LabVIEW FPGA 模塊開發(fā)可編程自動化控制器有了LabVIEW 和LabVIEW FPGA 模塊,你就為你的工業(yè)控制硬件增加了重要的靈活性和專用化。NI的CVS145x系統(tǒng)應用IEEE的1394(火線)技術,可以與40多種有各種各樣功能、性能和價值的照相機兼容。 NI緊湊型視覺系統(tǒng)是一個半成的機器視覺包裝,他需要經受在機器人技術中常見的苛刻的環(huán)境、自動化測試和工業(yè)檢測系統(tǒng)。C的溫度范圍內設計的。你可以用NI 緊湊的RIO為諸如車載數(shù)據采集、汽車NVH(噪聲振動和聲振粗糙度Noise Vibration Harshness)測試和內置機械控制系統(tǒng)的應用,開發(fā)內置系統(tǒng)。 NI 緊湊RIO — 一個以RIO技術為核心的平臺,提供了一個小的,工業(yè)上半成品的標準PAC平臺。利用這些未定制設備,你可以將你的NI PXI或PCI工業(yè)控制系統(tǒng),擴展為具有高速離散和模擬信號控制、自定義傳感器接口、精確定時和控制的系統(tǒng)。 NI的可編程自動化控制器為你的工業(yè)控制應用提供了標準的、未定制的平臺。LabVIEW FPGA 模塊模型之所以有如此有用,是因為它將LabVIEW FPGA 模塊與FPGA的商業(yè)的未定制(COTS)硬件結構、周圍輸入輸出元件緊密結合在一起。有了LabVIEW FPGA 模塊,NI公司讓更多領域的工程師能使用FPGA技術,他們能用LabVIEW圖形開發(fā)功能定義FPGA的邏輯。為可編程自動化控制器的NI RIO 硬件因為LabVIEW FPGA 模塊將定制的電路配置到硬件中,所以你的系統(tǒng)可以快速而精確地處理和產生同步的模擬和數(shù)字信號。雖然FPGA經常用于工業(yè)控制產品,它先前的功能在工業(yè)控制器械上是不容易應用的。由于FPGA的靈活和可軟件編程的架構,使得定制算法的高精度實施、精準的定時和同步、快速決策和多功能同時運行更容易。不像那些ASIC(專用集成電路)的芯片只有固定的廠家定制好的功能,你可以為你的特殊的應用配置或重新配置FPGA上的邏輯關系。將LabVIEW圖形編程功能和FPGA融合在NIRIO硬件上的就是RIO技術。 FGPA開發(fā)流程5.PAC(可編程自動化控制器)的NI RIO(實時輸入輸出)硬件3. 簡介2.你也可以將得到的圖像、分析、運動控制、比如CAN和RS232一樣的工業(yè)協(xié)議集成到你的定制NI RIO(實時輸入輸出)硬件,這樣就可以快速地事先并標準一個完整的PAC系統(tǒng)。 為將FPGA技術的靈活性和可定制性并入工業(yè)PAC系統(tǒng),國家儀器公司利用LabVIEW FPGA模塊和實時輸入輸出(RIO)硬件提供了一種直觀、容易理解的解決方法。通過一種普通的軟件開發(fā)環(huán)境NI LabVIEW,國家儀器公司提供各種可編程自動化控制器的解決方案。 工業(yè)控制上的應用要求高度集成的模擬和數(shù)字輸入輸出、浮點運算和多重處理節(jié)點的無縫連接。 however, creating additional functionality on the NI RIO device is merely a matter of adding another While Loop. Unlike traditional PC processors, FPGAs are parallel processors. Adding additional loops to your application does not affect the performance of your PID loop.使用LabVIEW FPGA(現(xiàn)場可編程門陣列)模塊開發(fā)可編程自動化控制器綜述北京理工大學出版社,2002 22 附 錄附錄A 外文資料Building Programmable Automation Controllers with LabVIEW FPGAOverviewProgrammable Automation Controllers (PACs) are gaining acceptance within the industrial control market as the ideal solution for applications that require highly integrated analog and digital I/O, floatingpoint processing, and seamless connectivity to multiple processing nodes. National Instruments offers a variety of PAC solutions powered by one mon software development environment, NI LabVIEW. With LabVIEW, you can build custom I/O interfaces for industrial applications using addon software, such as the NI LabVIEW FPGA Module. With the LabVIEW FPGA Module and reconfigurable I/O (RIO) hardware, National Instruments delivers an intuitive, accessible solution for incorporating the flexibility and customizability of FPGA technology into industrial PAC systems. You can define the logic embedded in FPGA chips across the family of RIO hardware targets without knowing lowlevel hardware description languages (HDLs) or boardlevel hardware design details, as well as quickly define hardware for ultrahighspeed control, customized timing and synchronization, lowlevel signal processing, and custom I/O with analog, digital, and counters within a single device. You also can integrate your custom NI RIO hardware with image acquisition and analysis, motion control, and industrial protocols, such as CAN and RS232, to rapidly prototype and implement a plete PAC system.Table of ContentsIntroduction NI RIO Hardware for PACs Building PACs with LabVIEW and the LabVIEW FPGA Module FPGA Development Flow Using NI SoftMotion to Create Custom Motion Controllers Applications Conclusion Introduction You can use graphical programming in LabVIEW and the LabVIEW FPGA Module to configure the FPGA (fieldprogrammable gate array) on NI RIO devices. RIO technology, the merging of LabVIEW graphical programming with FPGAs on NI RIO hardware, provides a flexible platform for cr