From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-28-2016 01:08 PM
Basically I just want to convert this vi so that instead of taking a cluster of 2 elements as input, it accepts one double precision floating point number as input.
I just want to be able to make an array of DBLs that erases the oldest value in the array when a new value comes in.
Thanks.
Solved! Go to Solution.
12-28-2016 01:16 PM
http://www.ni.com/white-paper/5241/en/
You'll want to go through that.
As far as your questions, you can change the indicators on the front panel to be numerics of DBL type. Then, connect them to the connector pane. That brings in a scalar DBL instead of the cluster (if that's REALLY what you want to do more so than it's the way you think is best to solve the problem at a micro level).
To handle your array, create a shift register that holds your past values. Update that each iteration. If you have a fixed sized array that isn't very large, you can even use the shift register itself by pulling down to get several more terminals.
The bigger question though: What is it you're actually trying to do. This is the way you're attempting to solve a problem. But, what is the problem itself. Given the questions you're asking, it's likely there's a better way to look at approaching the problem.
12-28-2016 01:45 PM
Hi Riebel,
Can you ensure that attached vi is backward compatible so that I can help you further?
12-28-2016 02:36 PM
I'm trying to filter out the voltage spikes I am getting from a touchscreen signal by keeping an array of 50 values, and when a new voltage point comes into the array, the oldest one is discarded. I believe the vi I am currently using is quite inefficient (I've attached it). I couldn't figure out how to set up the buffer for DBL input (I haven't yet tried what you suggested but will be doing that right after I'm done writing this), so I left it as a cluster input.
I then convert it to a 2D array and take the median of each column and then bundle those values together and plot to a waveform chart. I am sure there is a better way of doing this but as you can tell, I am quite new to labview.
12-28-2016 02:51 PM
Just to clarify:
1) I want to get an array of x coordinates and an array of y coordinates from the FPGA target.
2) Take the median of the array
3) Cluster x and y & plot to waveform chart
4) When a new coordinate comes in, the oldest coordinate leaves the array, & repeat the process
12-29-2016 01:39 AM
Hi Riebel,
1) I want to get an array of x coordinates and an array of y coordinates from the FPGA target.
Then you need to change the FPGA VI and recompile it.
Btw. the FPGA is quite bad for handling (large) arrays, you better do this task in your host VI!
2) Take the median of the array
You already do this. (Are you sure you need the median and not the mean?)
3) Cluster x and y & plot to waveform chart
Right now you are using graphs. You really need charts instead?
Well, have you tried to plot the median values on waveform charts?
4) When a new coordinate comes in, the oldest coordinate leaves the array, & repeat the process
12-29-2016 12:20 PM
Hi GerdW,
There is nothing wrong with the current VI, it works quite well, I just thought there would be a more efficient way to do this instead of reading a cluster from the FPGA, and converting it to 2 1D arrays.
Anyway, since I've posted this I have figured out how to do what I've been trying to do, so it's all good now. Thanks for the help.