LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize FPGA Memory with Custom VI Error

I have an interesting problem.  I am trying to optimize an algorithm for speed by moving a certain portion of it onto an FPGA that is housed inside of a cRIO-9004 (cRIO-9103).

 

So I set up local memory as such:

 

Number of Elements:20000

Data Type: FXP

Signed

Word Length: 64 bits

Integer word Length: 32 bits

 

Then under the "Initial Values" tab, I create a custom VI that initializes the memory where one value is:

 

0.89581528864800930023193359375000

 

Now to reproduce this error, all I do is click "Run VI", I then see the value in element 0, then I click "OK".  Afterwards I immediately re-open the memory, and the value is now: 

 

-0.10418471135199069976806640625000

 

So this looks like some kind of overflow error to me, but the question is,how is this coming about? All I am doing is closing the window for the memory and re-opening it.  If anybody has any insight as to how the memory on the RT Target works it would be greatly appreciated.  I have tried isolating this problem to a brand new project and by having one single element which is initialized by a VI loaded in various targets and locations, and the error still remains.

 

Perhaps this is a bug?

 

I have attached a sample project which can be used to reproduce the error.  Simply open the project and double click on the memory under the FPGA Target, then click on "Run VI" in the Initial Values tab, close the memory tab and then reopen the memory under the FPGA Target.

0 Kudos
Message 1 of 3
(2,599 Views)

Hi John,

 

What you are seeing is a known issue.  It is being addressed in CAR# 166493. The issue comes up when you select a word length over 32 bits.  The reason it fails at the word length of 32 bits is the way we handle our hexadecimal string to number conversion for some fixed-point configurations.  That issue is being addressed in CAR# 167373.  When hexadecimal string conversion issue is fixed, the 32 bit word length limit issue should go away.  I can't give a specific time line for when this will be taken care of, but you can check the Bug Fix List of future versions of LabVIEW and check.

 

What range do you need?  Are you able to use a word length under 32 bits?

 

 

Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 2 of 3
(2,540 Views)
until someone at ni is able to fix the bug, you should be able to break your 64-bit wide ram into two 32-bit wide rams and initialize one to the lower half of hte values and the other to the upper half of the values. when reading from or writing to the ram just split and join the values as necessary. its a little messy but not too bad. just take your current 'custom' initialization routine and drop it in two vis 'lower-custom' and 'upper-custom' that return the respective values.
0 Kudos
Message 3 of 3
(2,529 Views)