NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
John_vu
Posts: 5
0 Kudos
Accepted Solution

display tdms on diadem

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 

Member
AndreasK
Posts: 199
0 Kudos

Re: display tdms on diadem

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

 

Member
AndreasK
Posts: 199
0 Kudos

Re: display tdms on diadem

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

 

Member
John_vu
Posts: 5
0 Kudos

Re: display tdms on diadem

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.

Trusted Enthusiast
Brad_Turpin
Posts: 2,367
0 Kudos

Re: display tdms on diadem

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

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page