LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change a data value of 1D array running real time

Hi, I am acquiring real time analog data using 4474 daq card. Basically i am doing some signal processing to the data that i am reading then i am feeding it to my sound card. In middle of my process i would like to read the 1D array and check the values if it is above certain value and if it is above certain, i want to change that element to the certain value. as an example, i am trying to set the limits of the array no to exceed 4 voltage which is the voltage limit of the speaker i am using. and if some of the values are above 4, basically i want to change it to 4
IF(array.element>4) array.element=4;
how can i achieve this while i am running real time. thank you for your help
0 Kudos
Message 1 of 4
(2,753 Views)
Run the array to a Max & Min function from the Comparisons pallette. Connect the limit value (4) to the other input. The minimum output will be an array with no value greater than 4. If you need both upper and lower limits (+4 and -4), the In Range and Coerce function will work in a similar manner.

Lynn
0 Kudos
Message 2 of 4
(2,744 Views)
okay i have done that and inserted my max voltage limit to one of the inputs and the array to other inputs. I just dont understand the output that has two terminals.. I just wanted the array to be modified so that any value above 4 to set it to 4 and give me an output. I am sorry i am just new to the labview.. can u please explain it to me thanks you so much for ur time
0 Kudos
Message 3 of 4
(2,737 Views)
LabVIEW is a lot to learn at first. I have been using it since version 1.2 and probably have more to learn now than when I started. But its power makes it worth the time. Look at the tutorial; it is very helpful with the basics.

The Min and Max function has two outputs, one for minimum and one for maximum. For your application you need the minimum. Note that this function (and many others) will accept an array on one input and a scalar on another while producing an array output. It applies the scalar value to each element of the array.

I am attaching a little VI that shows how some of these things work. Make little test VIs like this when you want to see how something works. Then put what works into your largere program.

Lynn
0 Kudos
Message 4 of 4
(2,728 Views)