Download LabVIEW FPGA Module User Manual
Transcript
Chapter 2 Creating FPGA VIs The equation you use to convert a voltage to a binary representation depends on the specific FPGA device. Refer to the hardware documentation for more information. For example, with an NI PXI-7831R device, use the following equation to convert the voltage to the binary representation: Voltage × 32768Binary Code = Output ------------------------------------------------------------10.0 V Avoid executing this calculation in the FPGA VI because the FPGA only supports integer operations. Also, performing the equation on the FPGA uses additional space on the FPGA. Refer to the Mathematical Operations section for more information. Note Digital I/O You can treat digital resources as individual lines or as predefined groups of eight digital lines, also known as ports. A terminal is either an individual digital line or a digital port depending on which FPGA Device I/O function you use. You can perform both digital input and digital output on any digital terminal. Refer to the LabVIEW Help, available by selecting Help»VI, Function, & How-To Help, for information about specific FPGA Device I/O functions and port assignments. Use the Digital Input and Digital Port Input functions to read the state of a digital terminal or digital port. The state of the digital terminal is commonly determined by an external signal, such as the output generated by an external device. Use the Digital Output and Digital Port Output functions to set the state of a digital terminal or port. You can use the Digital Input functions to verify the state of the same terminal to which the Digital Output function writes. If you have used a terminal for output, you must use the Digital Enable or Digital Port Enable function to disable the terminal for output before the Digital Input function can read the state of an external signal. Note The Digital Output and Digital Port Output functions both write the data and enable the terminal for output. You also can use the Digital Data and Digital Port Data functions, which write data to a terminal but do not enable the output. Use the Digital Enable and Digital Port Enable functions to enable the digital terminal, which allows the data to be driven out. For example, you might have one portion of the block diagram continuously generating an internal signal. Use a Digital Enable or Digital Port Enable function in another portion of the block diagram to independently control when the internal signal is actually driven out to an external device. FPGA Module User Manual 2-6 ni.com