04-13-2024 09:47 AM
Hi All,
I have an issue that has been bothering me for a while now. My vi creates a tdm file. When I open it in excel, I see the data organized in sequential order. When my VI reads from the file, it seemingly pulls the data channels in randomly.
So instead of sensor 1, sensor 2, sensor 3, etc, it shows Sensor 2, Sensor 3, Sensor 1, etc. The data is all correct. It's just the order that is out of sequence. Has anyone seen this before?
04-13-2024 09:59 AM
We probably could help troubleshooting if you would attach a small tdm file and the VI you use to read it.
Terms like "it pulls" are very vague, so we can't really tell what you are doing..
(If the VI is in a newer LabVIEW version, use "save for previous" ( 2020 or below) before attaching)
04-13-2024 01:25 PM
Since your channels appear to numbered, you can sort them. When you read back the channel list, is it that which is out of order? Why not read the list, order then, and then pull the data?
Found this which may be helpful:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x45cCAA&l=en-US
I suspect that you are writing the channels out of order. In excel they are being shown in order alphabetically, but are actually arranged and retrieved in write order. Possible.
04-13-2024 04:54 PM
Thanks for the replies! My save routine saves to a tdm with XML header and a txt file (for legacy compliance). The same info is fed into both subVIs. The text file maintains the same order but the tdm changes it when I recall the data. If I open the tdm in excel, it shows the correct order. I named the sensors 1, 2, 3, 4, etc. and checked with other alphabetic configurations. I cannot find a pattern.
However, I needed to get this sorted for Monday so I 'fixed' it by adding metadata to the tdm save routine with the correct order, then sorting the data when opening the file based on said metadata.
04-15-2024 09:29 AM
@littlesphaeroid wrote:
Since your channels appear to numbered, you can sort them. When you read back the channel list, is it that which is out of order? Why not read the list, order then, and then pull the data?
Found this which may be helpful:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x45cCAA&l=en-US
I suspect that you are writing the channels out of order. In excel they are being shown in order alphabetically, but are actually arranged and retrieved in write order. Possible.
I have a technique similar to what NI is proposing, and I posted it here. I've also included it in my Tremendous TDMS toolkit found on VIPM.IO
But as others have said the order shouldn't matter in most cases. There are times when someone just wants to view it in an Excel plugin and then the order can't be controlled, or exporting to a CSV. But in most cases the data is based on the name of the group and channel.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord