From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

number to fractional string not working correctly

Solved!
Go to solution

I am measuring some parameters from oscillsocpe. i need to write these values to text file for which i am using write to spreadsheet, but what is happening is it is always writing zero value to file, on debugging i found that while converting from number to string it is always writng zero to string indicator, then separately i used that number to fractional string indicator and it is always showing zero in string output , i dont why it is happening.

 

Attached below is the code.

0 Kudos
Message 1 of 7
(2,907 Views)

It should

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 7
(2,895 Views)

I dont understand that code as it converts a numeric string into a number and then back to string. That seems to be Rube Goldberg code.

 

Are you sure that you read valid values from the VISA interface?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 7
(2,892 Views)

Ranjeet Singh and Norbert_B

 

Thanks for ther reply

 

Ranjeet singh,

 

number to fractional string is working correctly, there is some other problem, because inly when i am executing this code converting this rise time value to string then only it is showing zero, otherwise for any random number if i am checking this number to fractional string is working correctly.

 

Norbert_B

i dont need to convert it back to string that i am doing only to check why it is showing zero value on converting number to string , because when i was writing to spreadsheet file it was always writing zero value, so when checked that code it was observed that while converting from array of numbers to spreadsheet string it is always writing zero value that's why i am doing it here just to check why it is not converting to string, but your suggestion helped in focussing the string that i am gettong from VISA read, i can use that  in last case if i wont be able to find the solution but main problem is that why i am not able to convert it back to string, why it is showing zero because it is because of this only write to spreadsheet is always showing zero value .

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

If you want help, you need to provide the data. First, create an indicator on the output of the VISA Read. Run the VI. Go to Edit>Make Current Values Default. Save the VI. Attach that. Until you do that, everyone would just be guessing what is wrong with your conversion.

0 Kudos
Message 5 of 7
(2,876 Views)

Thanks Dennis knutson for the reply,

 

Below i am attaching the code with all the valuees. 

0 Kudos
Message 6 of 7
(2,868 Views)
Solution
Accepted by RChoudhary

That was simple. When you are converting a nsec reading, you would of course need greater precision than 2 decimal places. Why don't you use Number to Exponential or Number to Engineering.

Message 7 of 7
(2,863 Views)