Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Memory Read Function

LabVIEW 8.6 FPGA Module Help
June 2008

NI Part Number:
371599D-01

»View Product Info

Owning Palette: Memory & FIFO Functions

Installed With: FPGA Module

Reads from memory available on the FPGA target. Use the Memory Read function in conjunction with the Memory Write function.

Details  

Address specifies the location of the data in memory on the FPGA target. The valid address range depends on the Depth you specify in the Memory Properties dialog box. For example, if you specify a Depth of 1000, the valid address range is 0–999. If Address exceeds the address range, the Memory Read function returns an error and the output data might be invalid. Add error terminals so LabVIEW can notify you if Address exceeds the address range.
Data is the data read from memory on the FPGA target. Data is directly accessible only from within the FPGA VI. You cannot directly access the data in the memory of the FPGA target from the host VI. You must use controls, indicators, or DMA FIFOs to access data from the host VI. The Data data type is the data type you configure in the Memory Properties dialog box when you create the memory item. If you do not initialize the memory item, the data is undefined.

Memory Read Details

To read from or write to the FPGA memory with the Memory Read and Memory Write functions, you must create memory items. You can create a memory item in the Project Explorer window or using a VI-Scoped Memory Configuration node. You then can right-click the Memory Read or Memory Write function and select the memory item from the Select Memory shortcut menu.

Tip  You can click a memory item in the Project Explorer window and drag it onto the block diagram to place a Memory Read function on the block diagram. You also can right-click the Memory Read function and select Find Item in Project from the shortcut menu to highlight the memory item in the Project Explorer window.

Right-click the Memory Read function and select Add New Memory from the shortcut menu to create a new target-scoped memory item.

Right-click the Memory Read function and select Select Method»Write from the shortcut menu to change to a Memory Write function. You also can click the function and select Write from the shortcut menu to change to a Memory Write function.

If you reset the FPGA VI, the memory remains unchanged. You must download the FPGA VI again to reinitialize the memory.

Special Considerations for Single-Cycle Timed Loops

If you use the Memory Read function in a single-cycle Timed Loop, you must set the Read option in the Advanced Code Generation Memory Properties page to Arbitrate if Multiple Requestors Only or Never Arbitrate for the memory item, and you cannot use this function with the same memory item anywhere else in the FPGA VI.

If you use the Memory Read function in a single-cycle Timed Loop, wire the output directly to an uninitialized shift register or feedback node.

The Memory Read function takes an entire clock cycle to execute. You cannot use memory to transfer data among multiple clock domains.

Error Handling Details

Add error terminals to monitor if the operation you performed completed correctly. Right-click the Memory Read function on the block diagram and select Show Error Terminals from the shortcut menu to add standard LabVIEW error in and error out parameters to the function. If error in includes an error, you might receive incorrect data.

Note  Adding error in and error out parameters increases the amount of space the function uses on the FPGA target. The error in and error out parameters also can cause slower execution on the FPGA target.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit