03-15-2018 07:31 PM - last edited on 03-16-2018 09:42 AM by LiliMcDonald
Hi,
I've recently upgraded from diadem 2015 to 2017. In the Diadem Navigation window, when loading waveform channels from TDMS files, the channels are converted to numeric channels in the data portal. All the waveform properties are missing.
An example is shown below. On the left (external data), the channel includes waveform properties under the "extended properties" grouping. On the right, the data portal contains the same channel (after right clicking and slecting "Load Channel"). However, the data portal is missing the waveform properties and displays the channel as a numeric type (icon has "123" instead of the sinewave). The data finder appears to recognise the original TDMS file's channel is a valid waveform channel.
I've notices the "Group Properties" is a new feature in Diadem 2017: http://www.ni.com/white-paper/7393/en/#toc4
Is there a setting I'm missing somewhere that restore the abiltiy to load waveform channels as waveforms? I've tried the "Property Inheritence" setting, but this doesn't fix the problem.
The work around is that I have to manually copy out the waveform properties from the external data window, then use it to manually generate a time channel.
For reference, the data was created in LabVIEW.
Thanks,
Gabriel
Solved! Go to Solution.
03-16-2018 12:44 AM
There shouldn't be a difference between 2015 and 2017 behavior concerning your waveforms.
If you load the example file
C:\Users\Public\Documents\National Instruments\DIAdem 2017 (64-bit)\Data\Example.tdms
does it have waveforms in DIAdems "Noise data" group?
If Yes can you check if "Data Source type" of your file is TDMS.
Can you provide one of your files to determine what is different?
03-16-2018 01:10 AM - edited 03-16-2018 01:13 AM
Loading example.tdms works, and is displayed per your screenshot.
I also loaded the file "Example_data.tdm" (under the Diadem 2017 examples folder), which also worked.
I tried loading a channel from two different types of TDMS files I produce:
The first is written from LabVIEW using a simple TDMS method with waveform data type. This works:
Comparing the two files, the only differences I can see:
- The waveform that actually loads as a waveform in the data portal has a numeric ("123") icon in the external window, and it includes the property wf_samples.
- The Waveform that doesn't work is missing the wf_samples property, but includes other wf properties.
03-16-2018 11:46 AM
Gabriel_H,
Are you able to post one of your TDMS files? It might help to reproduce it on my end so that I can look into it.
Best,
Danielle
Applications Engineer
03-19-2018 08:51 AM
As far as I know
wf_samples
is what DIAdem uses to show it as waveform icon.
I also believe that there was no change in behavior between 2015 and 2017.
Because of whatever reason, the navigator uses
wf_xname
to show the waveform icon.
I Assume the minimum set for DIAdem is
wf_samples wf_start_offset wf_increment
but this did not change between DIAdem versions.
03-19-2018 05:26 PM
Thanks AndreasK,
That must be what I'm missing. I don't recall in detail what the behaviour differences were between Diadem 2015 and 2017. I upgraded a few months ago to solve a data finder issue on windows 10, and at the same time was trouble shooting a similar issue for that tdms file where I had misspelt wf_start_time as wf_starttime, which caused similiar issues. My memory may have been a bit hazy from a few months ago. At the time I was also testing waveform channels against the built in LabVIEW TDMS viewer and the Scout TDMS viewer.
Back to the point:
The TDMS file in question is produced by LabVIEW using the advanced TDMS functions, so I have to write those waveform properties manually. To do so, I was referencing this page from NI http://www.ni.com/white-paper/14252/en/ which describes the following:
(from the page):
Table 2. Standard Waveform Property Names
Name | Example | Required? | Description |
wf_xname | Time | Required | Name of the x-axis quantity |
wf_xunit_string | s | Required | Unit of the x-axis quantity |
wf_start_offset | 0 | Required | Start offset value of the x-axis |
wf_increment | 0.001 | Required | Increment value of the x-axis |
wf_starttime | Optional | Start DateTime value of the time axis | |
wf_samples | Optional | Number of values of the x-axis |
Because wf_samples was stated as optional, and I don't know this value when I create the file, I've omitted it. This has worked fine in Signal.X Scout, which can plot the waveform's time information without needing the wf_samples property. I've also noticed that Scout shows an "NI_ChannelLength" property in the TDMS file, which I didn't explicitly create in LabVIEW and Diadem doesn't show (i'm not sure if LabVIEW's underlying TDMS functions put this in, or if Scout calculates it, or if the data finder put it there when indexing the file).
Is it possible for either the "Writing Data-Management-Ready TDMS Files" white paper http://www.ni.com/white-paper/14252/en/ to be updated regarding the wf_samples property, or is it possible for Diadem or the Data Finder's TDMS dataplugin to be updated to work without it (or create it if missing)?
For my existing case I can work around it by manually creating time channels. In the future I may patch the LabVIEW software to create the wf_samples property on file close, but that won't work for incomplete files from power outages. I may just stick to explicit time channels in the future.
Gabriel
03-20-2018 03:29 AM
Sorry for the inconvenience. You are totally right the whitepaper contains wrong information and we will fix it.
Using script you can make DIAdem realize the waveforms by calling
ChnWfPropSet
A script like the following one can be used to make the channel a waveform.
Option Explicit dim chO : set chO = Data.Root.ChannelGroups(2).Channels("Noise_1") MakeWaveformIfSamplesIsMissing(chO) sub MakeWaveformIfSamplesIsMissing(byref chO) if chO.Properties.Exists("wf_start_offset") AND NOT chO.Properties.Exists("wf_samples") then dim offset : offset = chO.Properties("wf_start_offset").Value dim increment : increment = chO.Properties("wf_increment").Value dim startTime : set startTime = chO.Properties("wf_start_time").oValue call ChnWfPropSet(chO, "x-channel", "", offset, increment) ' set wf_samples to channel length set chO.Properties("wf_start_time").oValue = startTime end if end sub
03-20-2018 10:02 PM
Thanks AndreasK,
That script looks like it would do the job, however Diadem appears to discard all waveform properties when loading the channels. My guess is that it doesn't detect it as a waveform and removes those properties because they don't form a complete set of waveform properties.
I'll stick to manually adding the time channel by hand. In the future I may create a simple LabVIEW utility to fix the waveform properties before I load the file in Diadem.
Gabriel
03-21-2018 12:48 PM
Actually they are not removed but hidden. So the script above will potentially do the job of transforming it back to waveform.
They are hidden because all wf_??? are grouped and only show if wf_samples exists.
If you run this script after loading the file you channels should become waveforms again.
Option Explicit dim grpO : for each grpO in data.Root.ChannelGroups dim chO : for each chO in grpO.Channels MakeWaveformIfSamplesIsMissing(chO) Next Next sub MakeWaveformIfSamplesIsMissing(byref chO) if chO.Properties.Exists("wf_start_offset") AND NOT chO.Properties.Exists("wf_samples") then dim offset : offset = chO.Properties("wf_start_offset").Value dim increment : increment = chO.Properties("wf_increment").Value dim startTime : set startTime = chO.Properties("wf_start_time").oValue call ChnWfPropSet(chO, "x-channel", "", offset, increment) ' set wf_samples to channel length set chO.Properties("wf_start_time").oValue = startTime end if end sub
03-21-2018 06:51 PM
Sorry, I thought they were removed because I couldn't see them and the original script you gave me didn't work. Likewise, the second script didn't work either.
So i did some digging and found out why. The wf_samples property was already there, but was set to zero:
I've modified the script to add in a second case for the wf_samples property existing but being zero:
Option Explicit 'Forces the explicit declaration of all the variables in a script. dim grpO : for each grpO in data.Root.ChannelGroups dim chO : for each chO in grpO.Channels MakeWaveformIfSamplesIsMissing(chO) Next Next sub MakeWaveformIfSamplesIsMissing(byref chO) dim offset, increment, startTime if chO.Properties.Exists("wf_start_offset") then ' if the channel has waveform properties if (NOT chO.Properties.Exists("wf_samples")) then ' Original Script actions for case where wf_samples is missing offset = chO.Properties("wf_start_offset").Value increment = chO.Properties("wf_increment").Value set startTime = chO.Properties("wf_start_time").oValue call ChnWfPropSet(chO, "x-channel", "", offset, increment) ' set wf_samples to channel length set chO.Properties("wf_start_time").oValue = startTime else ' wf_samples exists if (chO.Properties("wf_samples").Value = 0) then ' wf_samples exists but is zero, so need to update the properties. ' Repeating the actions for the wf_samples doesn't exist case offset = chO.Properties("wf_start_offset").Value increment = chO.Properties("wf_increment").Value set startTime = chO.Properties("wf_start_time").oValue call ChnWfPropSet(chO, "x-channel", "", offset, increment) ' set wf_samples to channel length set chO.Properties("wf_start_time").oValue = startTime end if 'end if (chO.Properties("wf_samples").Value = 0) end if 'end if (NOT chO.Properties.Exists("wf_samples")) end if 'end if chO.Properties.Exists("wf_start_offset") end sub
This works now, and all the channels have been converted to waveforms with the correct start times!
Thank you for persevering with the issue!
Also: I found another issue with http://www.ni.com/white-paper/14252/en/
The wf_start_time property is incorrectly listed as "wf_starttime":
Table 2. Standard Waveform Property Names
Name | Example | Required? | Description |
wf_xname | Time | Required | Name of the x-axis quantity |
wf_xunit_string | s | Required | Unit of the x-axis quantity |
wf_start_offset | 0 | Required | Start offset value of the x-axis |
wf_increment | 0.001 | Required | Increment value of the x-axis |
wf_starttime | Optional | Start DateTime value of the time axis | |
wf_samples | Optional | Number of values of the x-axis |
This would have been the cause of that other issue I had a few months back, where my LabVIEW application was writing the wrong property name. Is it possible for that to also be fixed in the white paper?
Another suggestion would be for the LabVIEW TDMS function pallet to include a help VI for adding all the waveform properties with the correct names. Its something I made for my own LabVIEW application, but could help others in the future when working with the Advanced TDMS LabVIEW functions.
Thanks,
Gabriel