DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Import time channel into DIadem from a tdms file

Solved!
Go to solution

Hi A.Fiore,

 

Could you post your VI that is doing the write? Just want to verify a thought that we have on our side of why the file might be big.

 

Thanks!

Chris T.
0 Kudos
Message 11 of 23
(2,867 Views)

I hate to complicate this thread with my own problems, but based on the striking similarity I would rather post here than start additional threads.

Essentially I'm having the same issue; though my data ends up as a 2D array of strings of the form (Timestamp,Data)

 

Timestamp is LabVIEW created and is in the form "Seconds since 1Jan1904"

 

My situation is slightly more complex in that every data point collected comes with it's own timestamp. We're using a Queue to manage multiple dataloggers (Agilent 34980A) as well as multiple other data-producing units.

For this reason, we do not know for certain when various sets of data will enter/exit the queue and so we end up with a 2D array in this form. Each channel gets its own column (to use Excel terminology) but because different channels come from different loggers/products there is not a separate and uniform timestamp for each entire row.

 

So, I'm hoping that someone with a bit more expertise than me can help me decipher how to split every data point from a string in the form (timestamp,data) into a timestamp and data point.

 

Below I have attached an example file. You may note that the first 7 "columns" contains all collected data in a vertical column. Perhaps there is a way to utilize this arrangement more effectively, but it doesn't present itself very well for human readability. There is no direct separation of channels in these columns, so I question the usefulness here (you may wish to disregard their presence).

 

 

 

0 Kudos
Message 12 of 23
(2,856 Views)

Hi kc64,

 

Can you specify how you are writing your data to the spreadsheet?  Would it be possible for you to split the data within LabVIEW, before you send it to the spreadsheet?

 

Also -- would you mind uploading your VI here for us to take a look at it?

 

 

Regards,

 

Stephanie R.

Natonal Instruments

Stephanie R.
National Instruments
0 Kudos
Message 13 of 23
(2,827 Views)

Hi kc64,

 

It looks like that Excel file you posted was the result of loading a TDMS file into Excel with the TDM Excel add-in (double-clicking on the TDMS file in Windows Explorer).  I managed to recreate the original TDMS file, because that will load faster into DIAdem.  I then created a VBScript for you that sorts the rows from the first 8 Channels into 660 different Groups, including Stage1 and Stage2 differences.  I also converted the sorted string Channels to either Group and Channel properties or DateTime or Numeric Channels.

 

I'm including the reconstructed original TDMS file, the resulting sorted TDMS file, and the VBScript that creates the one from the other.

 

Ask if you have any further questions,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 14 of 23
(2,822 Views)

Hello Christopher T.

 

I attach you my VI in which there are two loops:

 

1 - there are two write calls in each iteration in order to save the Timestamp in the Labivew format

2 - I convert Timestamp into Double format and save all the data in only one write call.

 

I tried the second loop in order to see the difference in size and actually the size is lower but in this case the problem is to read the correct timestamp in Diadem.

So I have another question, how can I get a Date/Time channel from a DBL time channel in DIADEM?

 

 

 

Thank you

 

Andrea

0 Kudos
Message 15 of 23
(2,797 Views)

Hi A. Fiore,

 

The conversion from LabVIEW datetime DBL to a DIAdem datetime channel is included in the solution I attached to my above post, which comprehensively and efficiently sorts and processes your entire data file (as it is) in DIAdem.

 

Usually people store acquired numbers in a TDMS file as numeric channels (DBL, SGL, I32) as opposed to saving numeric data as string channels.  Numeric TDMS channels load just fine into Excel and much better into DIAdem.

 

If you connect the brown datetime wire in LabVIEW directly to the TDMS Write.vi instead of first converting it to a DBL, then both DIAdem and Excel will correctly import the datetime information automatically.

 

Please give my sorting VBScript a try,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 16 of 23
(2,790 Views)

I tried to load the file created with the vi that i posted you and it makes something weird maybe because i don't need to sort the channels they are already in the right place. The script create a new group for each row in which the name of the group is made of the values of the channels and inside the group i have only a channel "Timestamp" made of a single value.

 

The point is that if i connect the brown datetime wire in LabVIEW directly to the TDMS Write.vi i will have huge files (and i'm still wondering why), therefore my solution is to convert the time channel in DBL.

At this point the only problem is convert this channel in a time channel, i've seen that in your code you can do it but that part of the code it depends on the previous code, is it possible to have a script just to convert a DBL time channel into the DIADEM correct format?

 

Thank you very much for yor support

 

Andrea 

0 Kudos
Message 17 of 23
(2,781 Views)

I'm sorry Andrea,

 

I lost track of the fact that this is YOUR thread and got all caught up with the piggyback poster who had a "similiar" issue.  The VBScript application I posted was for the other customer and not intended for you-- I confused the two of you.  I just ran your VI and see what you mean.  Here's the standalone code you need to turn that LabVIEW DBL channel into a DIAdem datetime channel:

 

HrsFromGMT = -1 ' -1 for Europe, +5 for Texas
ChNum = CNo(GroupName(GroupDefaultGet) & "/Timestamp")
IF NOT ChNum > 0 THEN Call AutoQuit("Could not find the 'Timestamp' channel in the default Group")
IF ChnFormat(ChNum) <> "Time" THEN
  Call ChnLinScale(ChNum, ChNum, 1, 60084288000-3600*HrsFromGMT)
  ChnFormat(ChNum) = "Time"
END IF

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 18 of 23
(2,774 Views)

Thanks Brad, it's working perfectly and it's exactly what i needed!!

 

See you to the next thread!!  🙂

 

 

Andrea

0 Kudos
Message 19 of 23
(2,731 Views)

Thanks Brad! I posted before using the username of a colleague (kc64). The code that you provided was very effective with one small sticking point.

I really need the code not to differentiate between stages. All stages of a given sensor should still be only a single channel.

 

I spent some time working on "decoding" your code so that I could understand what you did and how you did it and I seem to have gotten it working the way I wish.

I'm not going to tell you that I fully understand the script, but I got from A to B.

 

I really appreciate you putting in the work that you did to fix my problem, it's helped me tremendously.

You will, undoubtedly see me asking other questions from time to time as I attack LabVIEW and DIAdem.

0 Kudos
Message 20 of 23
(2,717 Views)