LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1821, when exporting waveform to spreadsheet

Hello,

 

But you want to have data or graph (the graphical representation of data)? If you want to have data follow the instructions:

http://digital.ni.com/public.nsf/allkb/1678E94CB6FC508C86256C2200771468

 

You can use for example invoke node Export data to excel and create an Excel macro to generate graph automatically.

 

If you want to have 'just an image' use property node for Export Image. See the attachement to get screen shot how to do it.

 

Hope this helps.

 

Marcin

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 11 of 13
(1,547 Views)

Did you check the inbuilt example?

-The problem is i'm guessing with the file type.

-Try to make use of LabVIEW documentation and examples.

-Refer to the Waveform - Write Waveforms to File VI in the labview\examples\Waveform directory for an example of using the Export Waveforms to Spreadsheet File VI.

-When I checked example it showed read and write files type as .dat and Export Waveform VI file type as .txt.

-Can you try with these types of files and see if still error persists?

Thanks
uday
0 Kudos
Message 12 of 13
(1,539 Views)

Sometimes it helps to "Write the Documentation First", or, in this case, think clearly about what you want to do, what data you have, and how you want to save the data.  Here are some suggestions:

  • You mention Spreadsheets (which I presume you mean "Comma-separated Text files containing Strings or Numeric data, with extension .csv"), as opposed to Excel Workbooks, with extension .xls or .xlsx.
  • You also mention Waveforms.  Describe the type and size of the Waveforms, including whether you are referring to Waveforms produced by single or multi-channel DAQmx Read functions.
  • Many of the LabVIEW File I/O functions (in particular Write to Delimited Spreadsheet and Write Waveform to File) have an "Append to File" input.  This is handy when you need to use a loop to do multiple Writes to the same file that you are also creating.  If you think about the sequence you want, you want to do the first Write with "Append" False (so it makes a new File for you), but afterwards with it "True" (so it Appends).  The easy way to do this is to create a Shift Register in your loop to hold the "Append" variable -- initialize it to False outside the loop, and set it to True on the "output" side of the loop, making it False the first time and True thereafter, just what you need.
  • In looking at your code, there is an awful lot going on, and it is not clear what you are trying to do.  Think about your Documentation -- you'll say something like "We take the data and do the following to it:  we compute the mean and variance of these things, then we do some correlation, and then we do some other computation".  OK, make a sub-VI for each of these (and, for goodness sake, make a simple Text Icon for your VI that says "Mean + Var" or "Correl" so that you'll recognize it when you place it on your Block Diagram).  Hide the Messy Details so that you can look at your Top Level routine, see the input(s) coming in on the left, some (labelled) processing going on in the middle, and some output taking place on the right.
  • I notice that in the middle of your VI, you transform Arrays to Waveforms.  Why?  Waveforms are clusters that have other elements that you don't appear to be using, so why complicate things?

Note -- if you are a Student, I don't expect you to really "Write the Documentation First" (however, if you are hoping to do professional programming, this is not a bad ideal to set for yourself, even if you rarely attain it).  But you should think through the Big Steps (and maybe even "write them down") and not simply jump in laying down functions and wires all over the place.

 

Bob Schor

 

 

Message 13 of 13
(1,530 Views)