04-26-2011 01:24 AM
can somebody help me? Im trying to use the same fpga sub-vi for multiple sensors but cant get it to work
04-27-2011 07:32 AM
Dear milo_unlimited,
We need to optimize your VI to get it fit on the FPGA, therefore the following recommendations;
- place only front panel items on the front panel of the FPGA VI to communicate with the host VI
- if you need a front panel item only for a local variable; use a shift register when the variable is used in the same loop, or use a global to communicate between loops
- we need to adjust the data representation of the fixed point data type; many sub VI's of the robotics library are using a 32 bit fixed point configuration; do we need the integer range and or the accuracy which comes with this fixed point configuration?
- we can also make adjustments to the timers and wait functions; do we need a 32 bit counter to create a 200 us delay? The counter will take less space and the control / constant can be changed to the 8 bit representation as well (please remember that in case of 8 bit 255 us is the maximum).
- if we look to the get mean.vi (which is used within the measure distance) a quotient remainder function has been used; this takes a lot of space, so this can be a problem when you try to implement this 4 times. When we need to quotient by 4 this would be easy, we can then use the scale by power 2 function (n= -2). With 3 this is hard, so I came with another alternative. Please find the attached VI to this post. You can connect the 3 constant to Y and the output of the subtract function to X. Trade of from this function is that it will take much more time to calculate the value (the quotient is roughly the number of clock cycles it takes).
Please notice that I only looked at the optimization of the VI, and not the the functioning itself.
Best regards,
04-27-2011 07:42 AM
Thank you,
I'm going to try this updated version.
Thanks again!
05-09-2011 02:28 AM
The default code has a lot of 32-bit representations which also work when downscaled to 8-bit or 16-bit.
I ran into some timing problems when compiling the new code, but when I slimmed it down to the bare essentials, I managed to complete the compilation.
Thanks!