LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String & array manipulation

Solved!
Go to solution

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
Message 1 of 9
(2,979 Views)

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

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 2 of 9
(2,976 Views)

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
Message 3 of 9
(2,966 Views)

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
Message 4 of 9
(2,954 Views)
Solution
Accepted by topic author ABiermans

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

 

Message 5 of 9
(2,952 Views)

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
Message 6 of 9
(2,921 Views)

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! Smiley Embarassed

0 Kudos
Message 7 of 9
(2,910 Views)

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
Message 8 of 9
(2,893 Views)

Thanks everyone. I have things working correctly now.

0 Kudos
Message 9 of 9
(2,847 Views)