From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

[JupyterHub Module] How to get TDMS waveform channel's timing info?

This example shows us how to get the amplitudes from a TDMS channel: https://github.com/ni/systemlink-server-examples/blob/master/jupyter/TDMReaderServiceExample.ipynb

 

However, I couldn't find a way to retrieve the waveform properties (like wf_start_time and wf_increment) via the TDMSReaderClient API. What API should I use?

Certified LabVIEW Developer
0 Kudos
Message 1 of 4
(1,482 Views)

Ping?

Certified LabVIEW Developer
0 Kudos
Message 2 of 4
(1,389 Views)

The following call should return all properties of any level in the TDM hierarchy:

 

https://ip-10-192-40-22.aws.natinst.com/nitdmreader/v1/files/601947b411b5111ff4c289bc

In my case, I found the respective information. I tried it out using the Swagger tool (click ? and choose HTTP-API, and chose TDMReader). I retrieved the needed file id from Data Navigation's property view (NI_FS~id).

 

 

 "channels": [
        {
          "name": "Temp_A",
          "dataType": "Double",
          "dataCount": 250,
          "properties": {
            "properties": [
              {
                "name": "name",
                "type": "String",
                "value": "Temp_A"
              },
              {
                "name": "description",
                "type": "String",
                "value": "Input: [1]/Temp_A (1)"
              },
              {
                "name": "unit_string",
                "type": "String",
                "value": "°C"
              },
              {
                "name": "datatype",
                "type": "String",
                "value": "DT_DOUBLE"
              },
              {
                "name": "minimum",
                "type": "Double",
                "value": "20.9375287489371"
              },
              {
                "name": "maximum",
                "type": "Double",
                "value": "27.5582236964886"
              },
              {
                "name": "displaytype",
                "type": "String",
                "value": "Numeric"
              },
              {
                "name": "Limit_High",
                "type": "Double",
                "value": "50.0"
              },
              {
                "name": "Limit_Low",
                "type": "Double",
                "value": "20.0"
              },
              {
                "name": "monotony",
                "type": "String",
                "value": "not monotone"
              },
              {
                "name": "novaluekey",
                "type": "String",
                "value": "No"
              },
              {
                "name": "Sensor_Calibration_Date",
                "type": "DateTime",
                "value": "2016-06-09T22:00:00Z"
              },
              {
                "name": "Sensor_ID",
                "type": "String",
                "value": "A5_206"
              },
              {
                "name": "Sensor_Type",
                "type": "String",
                "value": "TC-K"
              },
              {
                "name": "wf_increment",
                "type": "Double",
                "value": "2.0"
              },
              {
                "name": "wf_samples",
                "type": "Int32",
                "value": "250"
              },
              {
                "name": "wf_start_offset",
                "type": "Double",
                "value": "0.0"
              },
              {
                "name": "wf_start_time",
                "type": "DateTime",
                "value": "1903-12-31T23:00:00Z"
              },
              {
                "name": "wf_time_pref",
                "type": "String",
                "value": "relative"
              },
              {
                "name": "wf_xname",
                "type": "String",
                "value": "Time"
              },
              {
                "name": "wf_xunit_string",
                "type": "String",
                "value": "s"
              }
            ],
            "totalCount": 21
          }
        },
        {
          "name": "Temp_B",
          "dataType": "Double",
          "dataCount": 250,
          "properties": {
            "properties": [
              {
                "name": "name",
                "type": "String",
                "value": "Temp_B"

 

 

 

0 Kudos
Message 3 of 4
(1,367 Views)

Hi JKSH,

 

Let me add a little color commentary to Stefan's correct answer.  In order to read all the properties you're after, you will indeed have to use either the "TDM Reader Web Service" or the "Data Navigator Data Service", both of which are SystemLink web service apis documented in the common Swagger page.  The "TDM Reader Web Service" will read any TDM-ish data file ingested by the File Ingestion Service (using the file ingestion GUID) or locatable on disk (using the full path).  The "Data Navigator Data Service" offers even more functionality, but only if the data file you care about has been indexed by a SystemLink DataFinder.  Stefan rightly started with the simpler "TDM Reader Web Service" approach and provided the file ingestion GUID to locate the desired file:

 

http://bradt2-lt:9090/nitdmreader/v1/files/5fce9104e49e4d5a6442acf1

You can see in both Stefan's URL and mine above that the protocol (http:) comes first, followed by the DNSname:port or ip address to the server computer where SystemLink is installed (bradt2-lt:9090), followed by the web service name (nitdmreader/v1/files), followed by the GUID or file path to the data file you want to read the properties from (5fce9104e49e4d5a6442acf1).

 

If you want to address the data file by file path, the file needs to be on a shared drive that is known in the network, you need to use forward slashes, and you need to replace special characters like slashes and spaces and colons with their %Hex equivalents in the URL.  So for instance a file located at the following network path would be passed with the below %Hex replacements:

 

"file://NetworkSharedFolderName/Subfolder/File Name.tdms"

"file%3A%2F%2FNetworkSharedFolderName%2FSubfolder%2FFile%20Name.tdms"

 

The "Data Navigator Data Service" is an entirely different kettle of fish.  Let us know if you would prefer to go that route to retrieve the desired properties.

 

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 4 of 4
(1,331 Views)