cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

String & array manipulation

¡Resuelto!
Ir a solución

Hi,

 

Maybe someone can give some advice. I am reading temperature data from a Fluke 2620a Hydra. I got that part to work, a temperature reading every few seconds is fast enough. The Fluke outputs a string containing a number of temperatures for each scan. Each scan outputs a string, something like +0023.7E+0, +0025.6E+0, +0023.8E+0,......

9 probes are measured. For each string I can scan the string for a number string, convert it to a number and add this number to an array.

Say the temperatures are 1,2,3,4,5. I end up with a 1D array, 1 2 3 4 5 1 2 3 4 5 12 3 4 5 1 2 3 4 5...........Writing this to a LVM file results in 1 column with all these numbers.

 

What I need is a row of numbers for each scan, like so (an additional column would be time)

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

 

I am having a brain freeze and I just can't figure out how to do that.

Also, I need to display these temperatures in a graph. If I have the temperatures in an array I can manipulate them and do the required calculations.

If some has a suggestions that would be great. I am using Labview 2012.

Attached is the part that needs to do this. The 1,2,3,4,5 string would be the output of the Fluke and would be read until stopped.

Thanks in advance

Arne

0 kudos
Mensaje 1 de 9
4.293 Vistas

could you quickly post it in Lv2010? I will have a look at it

Regards
Freelance_LV
TestAutomation Consultant
0 kudos
Mensaje 2 de 9
4.290 Vistas

Double-click on the "Convert to Dynamic Data" VI and change the type to "1D array of scalars - multiple channels". That will give you:

 

1 2 3 4 5

1 2 3 4 5

.

.

.

 

Problems with the VI as supplied.

  1. Change format strings to %d OR change the input data to engineering format. As is String to Number errors out.
  2. Change the loop termination source to the "offset past token" output rather than the "token index" of the Scan String and compare to -1 versus -2, otherwise you get an extra blank string ("") after the last number in.

 

0 kudos
Mensaje 3 de 9
4.280 Vistas

Set the file write to "append to file"

Initiaize the shift register with an empty array. Just use Spreadsheet string to array with comma as delimiter.

Convert to dynamic data as "1D array of scalars multiple channels"

 

Try the attached.

0 kudos
Mensaje 4 de 9
4.268 Vistas
Solución
Aceptado por ABiermans

And if you also want to graph them, simply send them to a chart:

 

Mensaje 5 de 9
4.266 Vistas

Thanks for all the replies so quickly. I will try to attach the vi for version 10 for the person that asked. I will try the solutions suggested and report back.

0 kudos
Mensaje 6 de 9
4.235 Vistas

This seems to work with an artificially constructed string. I think it will work with the Hydra, i wont be able to test this until Monday.

One last question. What is the easiest way to add a  timestamp column to the data written to the measurement file?

 

Going through the Core1 labview course right now. I have a lot to learn obviously! Emoticono avergonzado

0 kudos
Mensaje 7 de 9
4.224 Vistas

From your VI, the simplest way would be to use the Format Date/Time string VI and leave the time stamp input disconnected (this defaults to current date and time). Run the string output into the "Comment" input of the "Write to Measurement File" VI.

0 kudos
Mensaje 8 de 9
4.207 Vistas

Thanks everyone. I have things working correctly now.

0 kudos
Mensaje 9 de 9
4.161 Vistas