LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS file decimal place issue

Solved!
Go to solution

In a application I have a VI that saves data to a TDMS file that's used in two different places (see attached). One saves the data on demand and one on an alarm condition. The VIs are run nonreentrant. When the on demand is run it saves the time in hours to two decimal places as I want it to. When run in the alarm condition it saves with up to nine decimal places which really messes up column spacing when the file is opened in Excel. Both get the data from the same global. Any ideas?

0 Kudos
Message 1 of 5
(2,825 Views)
Solution
Accepted by topic author GDthomas

1. There is no need for the To Dynamic Data Type.  You may need to Transpose your 2D array first instead.

2. The TDMS is just saving binary data.  So my guess would be a formatting issue in Excel.


GCentral
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
Message 2 of 5
(2,817 Views)

I don't see anything in your attached screenshot that shows anything about alarm conditions, nor how data is formatted.  Perhaps that is happening in other code you are not showing.

 

Why are you using in so many places in that code an Insert Into Array along with Array size to "insert" data at the end of an existing array?  That is a Rube Goldberg.  If you are just putting more data at the end of an array, the Build Array function does it all in one step.

 

Actually all of those array manipulations are very odd as you are building a timestamp, a temperature, and a strain into a 1-D array, then putting more in for the second, followed by a third.  It seems to me like you should be creating a 2D array.

0 Kudos
Message 3 of 5
(2,814 Views)

The VI is run in a case structure when an alarm condition is detected so there's no reference to it in the VI itself. Same thing when the Save Data button is pressed. The VI sorts the data that comes in 1234 1234 1234 to get 111 222 333 444 if that make any sense. I'm still learning LV and that was the only way I could come up with to do it. 

0 Kudos
Message 4 of 5
(2,802 Views)

Thanks Crossrulz. I'm sorry for the delay but vacation, holiays etc. got in the way. I'm not sure why I had the convert to dynamic data in there. I'll see what's up with the formatting in Excel. What I'd really like to do is use some of the capablity of the Report generation tool kit to make a more presentable report but I've been unable to figure out how. I've used it to parse data from a .CSV file into a nice report but get stuck at saving data as it's created. But that's an issue for another thread.

 

Thanks again.

0 Kudos
Message 5 of 5
(2,743 Views)