07-16-2018 09:14 AM
Hi. I need professional help. I am just starting to work with Diadem and would like to understand if it is possible to do the following.
I have periodic pulse signals. There is a task: to define the fronts and the slices of the pulse period (frequency), to calculate the mean for each steady-state value of the signal, etc.
Maybe someone has experience, please advice how is it time-consuming rr easier to do in means of LabVIEW or Excel?
Solved! Go to Solution.
07-16-2018 10:11 AM
This is totally possible in DIAdem and will be difficult in Excel depending on the amount of data points you acquire. There are many ways to find periodic signal programmaticaly and it all depends on specific application. The best way to get help around here is to provide an example (maybe code, tdms file, or some screenshots) that explain your specific situation.
07-17-2018 04:25 AM
I hear you. Now I will prepare the pictures. Is it possible to automate this?
07-17-2018 04:51 AM
The necessary calculations are given in the file event.docx
Now all calculations occur in excel vba, but there are errors
07-17-2018 09:23 AM
Definitely possible to automate in DIAdem especially since your pulse is pretty well defined. So now it just depends on how your file looks like and what exactly you look for in a report... Is there 1 pulse or multiple pulses? Are you looking for average value from steady state and after affects off all pulses averaged or you want an average data point per pulse? Are t2-t1 and t5-t4 constant for every pulse or do you need to find them? I understand your attached example, and I do cycle detection and transient response averaging in DIAdem quite often. It's best to work with an example csv or preferably TDMS file do develop the specific scripts for the data or you can ask how to do a specific thing and get help here (for example CTNV function will clean all values above or below a certain value and ChnNovHandle will "glue" all the gaps left after running the CTNV which is most likely what I'd do).
07-18-2018 03:53 AM
This is an example of a technical specification. Real pulses behave not so perfect. In fact, there may be an interference that causes a false alarm. In fact, it is necessary to measure the value of all these parameters for each pulse (with/without the first few pulses) and find the average value for the entire file. All calculations are made for the steady state of the pulse.
07-19-2018 04:51 AM
I have a file tdms saved in the Excel.
1. Channel U KY2 D2 trace_fullset
2. Channel Pk2 trace_fullset
07-19-2018 09:50 AM
I was able to load the file into diadem and got 8 channel groups. Each group has 7 channels (TraceFullSet and Trace_Decim1-6). Could you explain a little more about each channel and what is your vision for result channels after processing in a script?
07-20-2018 12:58 AM
Channels U KY2 D2 and Pk2 trace_fullset need at the moment. The other channels are the same values only with fewer measurements. They are needed for a clear view of the behavior of the signal. I only need the calculations, the ones I wrote about above.
07-20-2018 02:54 PM
Oki I started off by separating the channels a little bit
Option Explicit 'Forces the explicit declaration of all the variables in a script. ' LOAD FILE Call Data.Root.Clear() Dim FileLocation: FileLocation = "C:\Users\111660\Desktop\" ' CHANGE TO YOUR FILE LOCATION HERE Call DataFileLoad(FileLocation & "for diadem.xlsx", "") ' DELETE EXTRA DATA Dim oElementList Set oElementList = data.CreateElementList Call oElementList.Add(Data.Root.ChannelGroups("U KY1 D1")) Call oElementList.Add(Data.Root.ChannelGroups("U KY2 D1")) Call oElementList.Add(Data.Root.ChannelGroups("Pk1")) Call oElementList.Add(Data.Root.ChannelGroups("P in")) Call oElementList.Add(Data.Root.ChannelGroups("Ra")) Call oElementList.Add(Data.Root.ChannelGroups("U KY1 D2")) 'Data.Remove(oElementList) ' SETUP VARIABLES Call Data.Root.ChannelGroups.Add("Results").Activate() Dim pulseChnl, dataChnl Set pulseChnl = Data.Root.ChannelGroups("U KY2 D2").Channels("Trace_FullSet") Set dataChnl = Data.Root.ChannelGroups("Pk 2").Channels("Trace_FullSet") DIM TenPercent, NintyPercent Call Calculate("ch("""&pulseChnl.GetReference(eRefTypeNameName)&""") = abs(ch("""&pulseChnl.GetReference(eRefTypeNameName)&"""))") TenPercent = pulseChnl.Maximum * 0.10 NintyPercent = pulseChnl.Maximum * 0.90 ' CALCULATE CHANNELS Call Calculate("Ch(""Results\Switch1"") = Ch("""&pulseChnl.GetReference(eRefTypeNameName)&""")*(1+CTNV(Ch("""&pulseChnl.GetReference(eRefTypeNameName)&""")<"&TenPercent&"))") Call Calculate("Ch(""Results\Switch2"") = Ch("""&pulseChnl.GetReference(eRefTypeNameName)&""")*(1+CTNV(Ch("""&pulseChnl.GetReference(eRefTypeNameName)&""")>"&NintyPercent&"))") Call Calculate("Ch(""Results\Pulse"") = Ch("""&pulseChnl.GetReference(eRefTypeNameName)&""")*(1+CTNV(Ch("""&pulseChnl.GetReference(eRefTypeNameName)&""")<"&NintyPercent&"))") Call Calculate("ch(""Results\AfterEffectSwitch"") = ch(""Results\Switch1"") + ch(""Results\Switch2"") - ch(""Results\Switch2"")") Call Calculate("ch(""Results\AftereffectData"") = (ch(""Results\AfterEffectSwitch"") / ch(""Results\AfterEffectSwitch"")) * ch("""&dataChnl.GetReference(eRefTypeNameName)&""")") Call Calculate("ch(""Results\PulseData"") = (ch(""Results\Pulse"") / ch(""Results\Pulse"")) * ch("""&dataChnl.GetReference(eRefTypeNameName)&""")")
The actual calculations are in the last 6 lines and here are the results:
The t4 - t5 are all separated in 1 channel and can be averaged into 1 aftereffect. Is this the right track here? Feel free to try the code and see if it gets you started on some automation