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.
08-25-2015 11:59 AM
guys,
i'm sampling voltage values from daq which are in the form of 1D arrays.
but i need them in a single numeric value.
for example, i've sampled 10 values at an instant and these ten values occupy 10 places in an array at that instant.
but i want all these values to a numeric constant, in which these values will change in that nmeric constant for some given time interval.
a[]=[2,1,3,4,5,6,7,8,3,4]. but i want a=2 for 2 milliseconds, a=1 for the next 2 milliseconds, a=3 for the next 2 millisecond interval and so on.
is there any conversion block to do this or an logic for this.
08-25-2015 12:04 PM - edited 08-25-2015 12:09 PM
It's a bit difficult to understand which part of the process you are trying to figure out.
Are you trying to have a 2ms period for your sample rate instead of 10 values instantly? e.g. 10 values that cover 20ms total time
You are saying "numeric constant", but it's unclear what you mean by that.
Are you just trying to plot the 10 values with an associated timestamp? Like a waveform?
Rather than plot, are you just trying to have a numeric indicator that shows you the values one-by-one in the array? If your DAQmx is set up right, you will have a sample rate (500Hz?) that will output these values every 2ms.
Am I wrong about all of the above and you're actually trying to output 10 data points with each datapoint every 2ms?
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-25-2015 12:10 PM
I think what you need is a simple for loop. Do whatever you need with "a"...?
08-25-2015 12:30 PM - edited 08-25-2015 12:32 PM
dear james morris,
yes. i need to read value from the array one element by one element
08-25-2015 12:32 PM
trip, looking at your other post, why don't you just do an average of the 10 values to get your indicator value? This will be a more accurate representation of the array of values since you have them all already. The user won't be able to tell the difference between each value if you write them at 2ms periods.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-25-2015 12:36 PM
dear james morris,
how to take average of the sampled values.
shall i divide the values with the array size?
will it work?
08-25-2015 12:38 PM
@triptathakur wrote:
how to take average of the sampled values.
shall i divide the values with the array size?
will it work?
You can do that if you want (Add array elements and then divide by original size), or you can use the handy Mean VI.
It sounds like you could use some tools to become more familiar with what LabVIEW is capable of. Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-25-2015 12:39 PM
i mean, shall i take the index array to sample the values and take the average of them by dividing with array size.
is this what you are saying about?
then what about the index value?
08-25-2015 12:43 PM
What do you mean by "index value"? Don't you just need to display the data? Just take the Mean value like above and write that to your indicator.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-25-2015 12:50 PM
dear james,
yeah i got it.
i have to use summation of array elements and divided by array size.
if it cope up with my logic, i'm so thankful to you