LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing Cluster to Text or Spreadsheet File

I'm new to labview and am trying to write a cluster of string and numeric arrays to a file.

The vi contains headers for the columns, and then includes columns of data.

I am able to write the columns without the headers, but am finding it difficult to write the cluster with the headers.

How can I accomplish this? 

I've attached a data file I would like to extract data from, and also the vi.

Any help is greatly appreciated.


0 Kudos
Message 1 of 6
(10,504 Views)
0 Kudos
Message 2 of 6
(10,495 Views)

I am wanting to write a cluster of six elements into a spreadsheet file and vise-versa.  I have an example spreadsheet file atttached with each value for the corresponding elements in the cluster.  I am having difficulty with the coding, as all the values for the six elements have to be acted upon before the next set of value for the six elements are called - so-on and so forth.  I have given the cluster a title of TPOS and therefore seperated the values with this heading.  Is there anyway I can call this file quickly and write new cluster values to a new file file like a database system.

0 Kudos
Message 3 of 6
(9,707 Views)

This is pretty unrelated to the original posters issue, and would probably qualify for a new thread.

 

But, from looking through your text file I think that you are going to want to do is use a read from text file and then start using the VIs from the String palette to parse your string.  Its nice that your file has all the <X>, <Y>...etc that will give you a nice regular expression to look for.

 

Browse through some of the string parsing examples and let me know if you have any questions.

Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 4 of 6
(9,666 Views)

Thankyou for the reply, further to this....

 

I can search for the character <x>,<y> etc. and upload the numbers into an array/cluster.  The issue that I cannot resolve is that I wish to use the one group of values (separated by the <Tpos> </tpos>)within the text file (ie. <x>number, <y>number ---> <psi>number) and store them to be used within a 6 element cluster.  Then allow my vi to use these values for analysis etc. Once the software has utilized these, call the next group of values within the text file(<x>number, <y>number ----> <psi>number) and place them into the same 6 element cluster (replace original values)and utilize them and so on an so forth, until all the groups of values within the <tpos> </tpos> groups has been utilized within the vi separately. 

 

In essence how can I make my vi use information within the text file separately, when the vi  is ready to call for the next set of data.

 

(I do not really want to alter the text file as it is use for another application). However, Is the only solution to store the numerical values for x,y etc into separate columns.  and the values to be used for further 'iterations' on separate lines? 

0 Kudos
Message 5 of 6
(9,638 Views)

I'm still not sure that I completely understand what you are needing.  Are you wanting a 2D array of values from the string that is formatted like <X0,Y0,Z0,Phi0,...><X1,Y1,Z1,Phi1,...><X2,Y2,Z2,...> and so on.  Or, are you trying to get something else from the string? 

Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 6 of 6
(9,587 Views)