05-24-2012 03:26 PM
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
Solved! Go to Solution.
05-25-2012 09:30 AM
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
05-25-2012 09:50 AM
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)))")
05-31-2012 09:00 AM
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.
06-06-2012 05:19 PM
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