ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save data with both text and numeric

Solved!
Go to solution

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. 

Download All
0 Kudos
Message 1 of 7
(3,797 Views)

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>>

0 Kudos
Message 2 of 7
(3,786 Views)

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:smileywink:)    

Message 3 of 7
(3,775 Views)
Solution
Accepted by topic author hiNI

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.

 

 

Download All
Message 4 of 7
(3,763 Views)

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.

write.JPG

 

 

Regards,
Nitz 

(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved:smileywink:)  

Message 5 of 7
(3,749 Views)

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.

0 Kudos
Message 6 of 7
(3,746 Views)

Can you give more than one Kudos?

Message 7 of 7
(3,725 Views)