LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview programming help: Save waveform to file in Tektronix TDS 3000 Series Driver

I am very new to LabView so I'm still learning a lot of the basics. Anyways my lab is using a TekTronix TDS 3054 in order to acquire waveform data. We are using the Dual Channel Waveform Acquire vi (Front Panel and Block diagram given in attachments). We have downloaded all the drivers and they appear to be running smoothly. 

 

What we are trying to do, is save the waveform to a file right after it is acquired. I have managed to do this to some extent, by right clicking the "waveform graph" in the block diagram, then going to Create>Invoke Node>Export Data to Excel. What this does is that it exports to (and opens) a new excel file every time we run the code. If we want to save the data in this excel file somewhere, we must do so manually by navigating to the excel file and then saving it.

 

While this is an ok temporary solution, ideally we'd like to be able to streamline this process a bit better. Namely, we'd like to add the following features to the driver

  1. Have the driver automatically save the excel file (the format is not that relevant, a text file or TDMS will work too) every time we run the code
  2. Have the driver name the saved files according to some numeric naming convention

 

So far I have tried wiring the waveform data to the input of the "Write to measurment file" function but I am stumped on how the wiring for that would work (the pink wire of the waveform data doesn't match any of the available inputs for "Write to measurment file"). I have also thought about converting the waveform data to a numeric form by using a string to numeric converter and then sending the output towards "Write to measurment file" but I'm not sure which function to use to convert a string to a numeric (there seem to be several out there and I'm not sure which one is the right one to use here).

 

Any guidance on this would be appriciated, espeically if there are some more efficient ways of going about this that I havn't considered. I think my primary problem is finding the right functions and wiring them into the block diagram (the wiring being the bigger challenge).

 

Thank you in advance!

Download All
0 Kudos
Message 1 of 7
(5,035 Views)
The first thing you need to do is go through the tutorials. That will give you the knowledge you need about datatypes and how to convert one to another.

For example, a magenta wire can be different things. In this case it is an array of clusters.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(5,017 Views)

This is a good suggestion. That being said I've been having trouble finding tutorials that pertain to what it is we're trying to do (or at the very least, understanding what does and doesn't petain to what it is we're trying to do). Is this what you had in mind for the tutorial I should look at?

 

Thanks again!

0 Kudos
Message 3 of 7
(4,990 Views)
What I had in mind was that at your stage nearly everything pertains to what you need to do. You need to lay a foundation of knowledge first.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 7
(4,985 Views)

So I went through (what I think was) all the tutorials explaining Labview basiccs. If I understood them correctly, then the problem here is that I have two clusters of 3 data sets (start time, time step, and y values). Each of these two clusters is then fed into the append array function to put them together, and then sent out as waveform data.

 

So should I be able to use the Flatten to XML function to transform my waveform data into a string that I can then input into "write to text file"? (shown in attached figure)

0 Kudos
Message 5 of 7
(4,977 Views)

Look in the Waveform palette.  Use the Build Waveform using the parameters you were already using in a cluster.  Build them into an array.  In the Waveform palette is a subpalete that has a function for saving waveforms to a delimited text file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(4,970 Views)

Thanks a lot! I have managed to figure out a way to save them to excel files instead of text (excel is just a little bit more convenient) by unbundling the clusters, constructing waveform data from them,  making an array, and then writing them to a measurment file (solution attached). I think the only thing I need help with at this point is the Write to Measurment function and how to decide the headers inthe resulting excel file (currently they are just Untitled and Untitled 1 whereas I'd like them to be CH1 and CH2)

 

 

0 Kudos
Message 7 of 7
(4,966 Views)