DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

display tdms on diadem

Solved!
Go to solution

Hi All,

 

I followed the example below saving Spectrum Graph  and times into TDMS file format.  However, Diadem does not plot the data correctly.  Is there anyone know how to used Diadem to plot this TDMS data.

http://forums.ni.com/t5/LabVIEW/TDMS-2d-Array-Won-t-Append/td-p/1872743

 

I attached the TMDS data file and screen shot of how Diadem display my data.  Please help if anyone know how to used Diadem.

 

Thanks 

Download All
0 Kudos
Message 1 of 5
(4,640 Views)

Hello John,

 

your data contains those curious 0,0 tuples. You can see it very easly in the preview of Frequency.

So if you want to plot DBM over Frequency you can easily mark those 0,0 tuples using the "Band Cursor"

mark them using Set Flag and remove those values by selecting Flags: Remove Datapoints .

 

If you drop the channels to view again they will look nice.

 

Greetings

Andreas

 

0 Kudos
Message 2 of 5
(4,611 Views)
Solution
Accepted by John_vu

Alternative you can use the following script to replace the 0 values by NoValues and use this channel to plot.

Option Explicit

Call Calculate("Ch(""[1]/FREQUENCY_NV"") = Ch(""[1]/FREQUENCY"")*(1+CTNV(valequal(Ch(""[1]/FREQUENCY""),0)))")

 

0 Kudos
Message 3 of 5
(4,609 Views)

After I follow the example from the link above, saved datas to TDMS file, the 0,0 tuples is automatic generate in the datas set.  I believe they used that 0,0 tuples to seperate between my first data set with other sets. 

If you look at my TDMS file, There are 3 channels.  Time, Frequency, and dBM.

Time: -- Time stamp every time I acquired a set of data. 

Frequency & dBM : -- contained multiple set of data seperate by 0,0 tuples. (my data set have 1001 data point, " 0,0 tuples happen at 1002 index, New data set start after that, and so on.. )

 

What I really want that I able to plot each set of data seperately ("frequency vs amplitude (dBm) graph) with time stamp shown.   

 

Second, I would like to make a replay macro that hop through all those data set (with timestamp) and display it on the screen ( Video replay if possible)

 

** I want to save my data to TDMS file this way, because it easy to manage data files.  It minimize amount of file that each data set must be created.

0 Kudos
Message 4 of 5
(4,566 Views)

Hi John_vu,

 

Here's a script that separates those different spectra into their respective groups, so that you can easily overlay them on a VIEW or REPORT graph.

 

Call DataDelAll
Call DataFileLoad(CurrentScriptPath & "test.tdms")
IF NOT GlobUsedChn > 2 THEN Call AutoQuit
L1 = 1 ' Time
L2 = 2 ' Frequency
L3 = 3 ' DBM (Amplitude)
iMax = ChnLength(L1)
Size = ChnLength(L2)
ChnLength(L3) = Size
LastRow = 1
Row = ChnFind("Ch(L2)=0 AND Ch(L3)=0", Row+1)
Do While i < iMax AND Row > LastRow
  i = i + 1
  Call GroupCreate(RTT(ChD(i, L1), "#mm-dd-yyyy hh:nn:ss.ffff"))
  Call GroupDefaultSet(GroupCount)
  FreqChArray = ChnAlloc("Frequency", Row-LastRow) : FreqCh = CNo(FreqChArray(0))
  AmplChArray = ChnAlloc("Amplitude", Row-LastRow) : AmplCh = CNo(AmplChArray(0))
  ChnDim(FreqCh) = "Hz"
  ChnDim(AmplCh) = ChnName(L3)
  ChnComment(FreqCh) = ChnName(L2)
  ChnComment(AmplCh) = GroupName(ChnGroup(AmplCh))
  Call DataBlCopy(L2&","&L3, LastRow, Row-LastRow, FreqCh&","&AmplCh, 1)
  LastRow = CLng(Row) + 1
  Row = ChnFind("Ch(L2)=0 AND Ch(L3)=0", Row+1)
Loop
Call GroupDel(1)
Call PicUpdate

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 5
(4,501 Views)