LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array to spreadsheet string- why middle data becomes zero

Solved!
Go to solution

Hello

I converted an 3x2 array to 2x3 array by transpose 2D array, then I used "array to spreadsheet string" vi  to convert my 2x3 array to string. The string format is %f. The array consists of numbers and text like:

frequency       capacitance      resistance
100                  10                     100

when I try to write the data on text file the number at middle becomes 0. I used probes for debugging. I found out that the problem is in output of the "array to spreadsheet string"vi.  Input data ( which is a 2D array) is ok but in output (which is a string) the middle data are zero!! I can not find the reason.

 

Thank you in advance for your help

 

0 Kudos
Message 1 of 12
(4,573 Views)

No idea.

 

But if you attach an actual VI that demonstrates the problem rather than a tiny picture of code that doesn't show any data, maybe we can help.

0 Kudos
Message 2 of 12
(4,564 Views)

Were your initial arrays the same length?



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 12
(4,544 Views)

Did you understand RavensFan's point?  We cannot "execute" your picture, nor do we know what data you were trying to convert.

 

Take your VI, put data in it, and run it so that it "fails".  Go to the Front Panel, open the Edit menu, and click Make Current Values Default (this "keeps" the values you just entered present when you save the file).  Save the File and close LabVIEW.

 

Now go back to the Forum, reply to this VI, hit Attachments, and attach the VI that you just saved.  Now we will be able to open the VI, run the code, and explain the problem (and fix) to you.  We won't have to guess, we won't have to wonder which version of LabVIEW you are using, all will be revealed.

 

Bob Schor

0 Kudos
Message 4 of 12
(4,535 Views)

Try using %S as your format string.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 12
(4,517 Views)

Hello Bob

Thank you for your explanation. I use labview for controlling an instrument. I did not send the vi because I used keysight drivers ( the instrument's driver). I think you dont have them. my input is frequency and outputs are capacitance and resistance. Actually every thing seems ok in program. In front panel data are shown correctly exactly as they are shown in device, but in text file the capacitance ammounts become zero(I dont know why) while in device they are shown in femto Farad and picoFarads amounts.  there is no error in code. I mean it does not fails. My labview version is 2015. 

 

 

0 Kudos
Message 6 of 12
(4,505 Views)

I forgot to mention that Primary parameter is capacitance

Thank you 

0 Kudos
Message 7 of 12
(4,503 Views)

I have tried it already dear RTSLVU

Thank you 

0 Kudos
Message 8 of 12
(4,500 Views)

Dear Crossrulz

 

There is no error in code and I think there is no problem in array sizes. I attached my code to above replys

Thank you for your consideration.

0 Kudos
Message 9 of 12
(4,494 Views)
Solution
Accepted by PA65

The problem is in the magnitude of your value.  Primary parameter is 14.5 p, which rounds to zero because it is rounding to 6 decimal places and pico is too small.  Use %g instead of %f for your format code.

 

I don't understand why you are building values onto the ends of empty array.  A lot of that cluster and array manipulation seems unnecessary.

 

I removed the while loop and the agilent subVI's so I could run this.  But basically your code can be stripped down to this.

 

 

PS:  Because you attached the code, we could zoom in and see that the problem was with the magnitude of your data, which we couldn't see on the original partial screenshot of the code.Smiley Wink

Message 10 of 12
(4,490 Views)