LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Split elements into an array

Solved!
Go to solution

Hi Guys

 

I have signal which consists of some numbers .......they are reported seperately to Labview as x , y , z.

 

So I need a way to package 3 such elements into an array (for example) as x refes to a data point number , y is the voltage and z is the current.

 

I would then like to split the "array" off into an X-Y graph to eventually plot I vs V.

 

Any suggestions ???

 

Rgards

 

B

0 Kudos
Message 1 of 7
(4,468 Views)

It depends.  If you are getting your x,y,z one at a time, then I would parse the string (you can use Scan From String or Spreadsheet String to Array) and build the x and y arrays dynamically.  You can either build 2 arrays and bundle them for the XY graph, or bundle each XY pair, and build them into an array.

 

If you are getting the entire set of data at once, then use Spreadsheet String to Array and get the array subsets for x and y.  Bundle them to plot to th XYGraph.

0 Kudos
Message 2 of 7
(4,456 Views)

Hi Matthew

 

Thanks for the quick reply and the info.

 

I am getting the x,y,z one at a time ....so each 'x' has a 'y' and a 'z' associated with it..Giving one set {x,y,z} , then {x1,y1,z1} e.t.c......but coming off sequentially as x,y,z,x1,y1,z1 e.t.c 

 

I think the Spreadsheet String to Array idea could work, allowing me to build an array dynamically and then unbundle to feed into an X-Y graph. 

 

I will give it try and get back to you .

 

Thanks again 

 

Regards

 

B

0 Kudos
Message 3 of 7
(4,444 Views)

Hi Matthew 

 

I am having no luck with the Spreadsheet string to array route.

 

Do you any suggestions ?

 

Regards

 

B

0 Kudos
Message 4 of 7
(4,425 Views)

Hi Matthew 

 

I attach a picture of what I am trying to do.

 

The string indicator labelled data shows the string. I convert this string to number and then try and pump this into an array with 1 row and 3 columns.

 

Regards

 

B

0 Kudos
Message 5 of 7
(4,419 Views)
Solution
Accepted by barrys

Hi Barrys,

 

I am not very clear about your doubt. I assume that if you can make an array of your x y z values, then you can proceed on your own. Check the attached example. I have made an array of a set of values. Instead of the constant i used, you can directly read it from your spread sheet. Hope this helps.


Regards,
NitzZ

(Give kudos to good Answers, Mark it as a Solution if your problem is Solved;)) 

0 Kudos
Message 6 of 7
(4,414 Views)

Hi All

 

Thanks for all your input.

 

I solved the problem by chnaging the delimiter on the instrument so I get now sets of {x,y,z},{x1,y1,z1} e.t.c

 

I then used Spreadsheet string to array and turned th array into a Matrix which I was able to extract each element sepertely and feed into an X-Y graph

 

NitzZ  your solution is more elegant...

 

Thanks again 

 

Barry

0 Kudos
Message 7 of 7
(4,407 Views)