ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
05-01-2012 07:23 PM
Hello,
This is two part question/help needed:-
1. I would like to display on the table the same number of decimal places as in the attached image. Also, include a text input on the last column (as shown in the image).
2. I would also like to save the data to a file where there is both numerical data and text data as shown in the attached image.
Any help will be greatly appreciated.
Thanks,
hiNi.
Solved! Go to Solution.
05-01-2012 09:06 PM - edited 05-01-2012 09:15 PM
Hi hiNI,
forget about the numeric or string... Use "numeric to fracational string" function to convert the number into string. individually set the precision value then put those data in the table.
<<KUDOS ARE WELCOME>>
05-02-2012 12:13 AM
Hi,
Check the attached VI.. It does what you want.
Regards,
Nitz
(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved)
05-02-2012 01:23 AM - edited 05-02-2012 03:12 AM
You need to format the values seperately and assemble it as an array of strings. I don't understand the purpose of the shift register. Why are there controls and a user operated case structure inside the loop, because the loop will execute so fast that any user control would be unpredictable.
Here''s some simple code (LabVIEW 8.5) that you could use. Modify as needed.
05-02-2012 02:41 AM
Hi Christan,
One small inference. If we wire %.6f and then write the values to the file, the precision of the values being written into the file is 2. Instead if we write it as string (%s), the precision is 6. Please correct me if i am wrong.
Regards,
Nitz
(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved)
05-02-2012 03:06 AM - edited 05-02-2012 03:13 AM
Sorry, that format was a leftover from the original code. "Precision" has no meaning for strings, so I am surprised that it truncates the values. Oh well. (looks like it truncates the strings to lenght=6, or whatever the number in the %f format is. Nothing to do with decimal digits)
Yes %s is correct. I recommend to leave it unwired. (%s is the default for the string version))
You can open "write to spreadsheet file" and look at the code. It uses a simple "array to spreadsheet string" internally.
05-02-2012 08:56 AM
Can you give more than one Kudos?