LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add text ring labels as a row into a spredsheet

I am trying to add the text ring labels as a constant row header into a spreadsheet. I am going to use it inside a larger project in which I must calibrate several instruments using  a DAQ. First of all I must write into a spreadsheet the value of the samples preceded by its own row header telling the corresponding instrument I did it without success. Before writing into the file I use the "array to spreadsheet string" function but its output is empty, here is the first problem, before this function I have put a table indicator in order to see what happens and it is written well but with a 0 appended to the name of the instrument, here is the second problem.
I attach the simple VI for any suggestions.
Thanks in advance.
Regards.
0 Kudos
Message 1 of 11
(3,524 Views)

It is not entirely clear what you want. Do you want a header for each row, or just the current instrument name as header in column 1?

I tried to guess a solution, maybe it can help you. Let me know if you want something different.

0 Kudos
Message 2 of 11
(3,514 Views)
Sorry if I didn't explain it more clear, but I would like to save my data into a spreadsheet with the same format as the attached picture. This means, a first column in which every element (I think this is called in english a row header ) tells the  instrument being calibrated.
 
Thanks for your quick answer and regards.
0 Kudos
Message 3 of 11
(3,505 Views)
Message 4 of 11
(3,489 Views)

Yeahh, that's what I wanted , but look at my attached VI ( your Vi, but modified) ,why the spreadsheet is empty??

Thanks a lot.

0 Kudos
Message 5 of 11
(3,482 Views)

Sorry I forgot to attach it. Try now

Regards

0 Kudos
Message 6 of 11
(3,481 Views)
Use "%s" for the format string in array to spreadsheet string (top right of code). Your array elements are already formatted strings, they are no longer numerics. 🙂

Message Edited by altenbach on 07-12-2005 02:38 PM

0 Kudos
Message 7 of 11
(3,479 Views)
Hi,
 
if you read the last post of altenbach, he showed you the answer to your question. Type %s for the Format String in the Array To Spreadsheet String and you´ll see the data into your spreadsheet.
 
Regards
 
Diego M.
0 Kudos
Message 8 of 11
(3,455 Views)
Another question altenbach, I take 3 samples per angle in order to calibrate my instrument and then write the name of the instrument in the first column , the measure (a voltage from the DAQ) in the second column and the angle which corresponds to that voltage in the third column , thanks to your help everything goes fine ,but I have several angles which corresponfing voltage I have to measure. The problem is that I would like to be only prompted to save the file the first time I press "measure" button, and then each time I pressed "measure" the instrument name, the voltage read, and the angle are saved in the same text file below the other measures without being prompted every time , only once, until I press stop.
 
I attach my Vi which runs well but being prompted every time yo press "measure" .The resulting text file is what I want but not in that way, being prompted always. Any suggestion to be prompted only the first time?
 
Thanks
Regards.
0 Kudos
Message 9 of 11
(3,446 Views)

Well, you probably should open the file exactly once at the beginning of the experiment ouside the loop, then keep appending in the loop, see attched small modification. Close the file when the loop is done.

 

A few other points:

  • There is no need for local variables
  • I don't see why you would need to duplicate all code in a second case structure. Once is enough!
  • Your loop needs a wait statement. It makes no sense to spin it millions of times a second executing an empty case and consuming 100% of the CPU.
  • It is not efficient to rewrite the strings[] at every loop iteration. It is sufficient to do this when the instrument changes.
  • I assume that the "scaled data" will be read inside the loop in the finished program.
  • I don't understand your boolean logic for the comparison operation, but I don't think you need it.

modify as needed.

 

Message 10 of 11
(3,443 Views)