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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert this VI to take a DBL input

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(3,937 Views)

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.

0 Kudos
Message 2 of 7
(3,932 Views)

Hi Riebel,

  
Can you ensure that attached vi is backward compatible so that I can help you further?

 

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 3 of 7
(3,912 Views)

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.

0 Kudos
Message 4 of 7
(3,892 Views)

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

0 Kudos
Message 5 of 7
(3,886 Views)
Solution
Accepted by topic author Riebel

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

That's what your buffer VI does. Just use it!
 
What's wrong with the current VI?
Have you understood how this buffer VI works? (It's a FGV…)
Have you tried to adapt this subVI to your (additional) needs? (Use a copy of the VI!)
 
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,837 Views)

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.

0 Kudos
Message 7 of 7
(3,809 Views)