Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use LUT

Hi,

we are developing an engine speed measurement system using an FPGA.  Our first try was to calculate the speeds on the fly (2ms, 20ms and 1 sec speeds).  However, it was taking too much space on the FPGA so we decided to create tables to calculate the speed.   We decide roughly that we will need around 4 u16 tables of 204 and 595 elements, 3 u32 tables of 204 and 595 elements and a ring buffer of 2048 elements (u32) for storing the time.  I was planning to use the 1-D LUT to implement the tables and the write and read memory to implement the ring buffer.  My specific questions are:  First, how do you create a VI to initialize the tables, I was looking for examples in my computer but I didn't find them.  Could you guys point me to some examples?  Secondly, how do I use the LUT across my program, since I have to access different instances of the same look up tables.  Are there any examples on LUT where you use the same LUT in different parallel loops?  Finally, one of the inputs is the address, if I have five different LUT how is this address handled? 

thanks

Jose
0 Kudos
Message 1 of 2
(3,281 Views)
 
Jose,
 
> First, how do you create a VI to initialize the tables
 
When you configure the LUT, in the dialog click on Call Initialization VI... . Then in the Mode dropdown select Create New Initialization VI from Template. Select a new VI name and press Ok. This will create a new VI in the specified location that you can use to initialize the LUT. Then select Edit Existing Initialization VI in the dropdown and press Ok. Modify the new VI to create the array of numbers you want in the LUT. Save the VI. Then go back to the LUT configuration dialog dropdown and select Run/Load Exisiting Initialization VI. Select your VI and click on Ok.
 
> how do I use the LUT across my program, since I have to access different instances of the same look up tables.
 
This is not directly possible using the LUT. Using local variables or other mechanisms you would need to implement code to retrieve data in multiple locations from a central LUT. For your requirements the Memory Extension Utility is a better tool to use. This tool allows you to define multiple memory blocks, set the data in each memory block during development, and access each data block from multiple locations in your diagram.
> One of the inputs is the address, if I have five different LUT how is this address handled? 
 
The address space for each LUT and memory extension utility memory block is handled separately starting at 0, so you do not need to worry about special considerations.
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 2 of 2
(3,267 Views)