04-10-2007 05:24 AM
04-10-2007 08:26 AM
04-10-2007 08:37 AM
It seems that waht you want to do is convert your strings into numerics. That can be done with the Scan From String Function or Fract/Exp String to Number.
Do you want a running average or do you just want the mean when the last while loop is done. If it's a running average, you could use a shift register in the loop to hold the array of values. If the loop doesn't run tooo long, you could use the build array function, Otherwise, use the Insert Into Array. If at the end, all you have to do is wire the numeric through the while loop, right click on the exit tunnel, and select Enable Indexing.
p.s. Eliminate that sequence structure and use the error in/error out connections of the VISA functions in order to enforce dataflow.
04-11-2007 03:16 AM
Hi GerdW,
You are right what i meant was changing "1.23E-2" to "0.0123".
However, i was not able to scan as my data result is a string that looks like this '2.87471E-4,-1.41954E-4,5.02184E-4,-1.41954E-4,-1.41954E-4' is there anything that i left out?
please pardon me for i might be slow with this program as i am a student only and i am working on a program as an individual project for my internship.
Regards,
Linda
04-11-2007 04:08 AM
Hi Dennis,
yup. what i wanted was to convert my strings into numerics. sorry for the confusion made earlier. what i meant was converting the displayed scientific values into decimal values.
In any case, if i would like to do a running average, how should i go about doing it?
fyi, i get many sets of '1.18594E-1,1.27397E-1,1.27183E-1,1.22674E-1,1.20527E-1' such string depending on my sampling points. how should i average them?
thanks
rgds,
Linda
04-11-2007 04:15 AM
04-11-2007 04:37 AM - edited 04-11-2007 04:37 AM
In case that you don't know the amount of numbers in the string, a simple for loop would work.
Make a subVI's with something like this in it:
Message Edited by Anthony de Vries on 04-11-2007 11:37 AM
04-11-2007 09:08 PM
thanks anthony!
that was what i wanted. Now i gotta crack my brain on how to do either a running average, or a mean for all the data points i got.
rdgs,
Linda
04-11-2007 09:11 PM
Hi GerdW,
thanks for you help! Although ity wasn't exactly what i had asked for, but i'm sure i had learnt the right way to connect a 'scan from string' function.
rdgs,
Linda