LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Waveform Data write in to file

Hello Friends

 

I am new in lab view. I am trying to store double real number 2D data to waveform file. But giving me error like "you have connected two differnt data types. The type of source is 2D array of double [64 bit real(~15 bit digit precision)]. The type of sink is 2D array of Waveform (DBL)."

 

Basically I want to store the wave form data in to file.  My input data is  Double 64 bit real (15 bit digit precision) Would you please guide me? I am stuck here.

 

Here I am attaching error snap shot and not working code.

 

 

Best Regards,

Abel

Download All
0 Kudos
Message 1 of 3
(1,691 Views)

Hello Abel and welcome to the forum.

 

I can't open your VI but I can explain the problem:

As you can see your wire is broken this is because the type of data expected by your write vi is different. You have two solutions:

You can convert your data to a spreadsheet string and write this string to a file ( you wiil find the vis for this on the string palette and the file palette)

or you can convert your data to waveform, for this you will find the vi in the waveform palette.

 

Basically a waveform is a stucture that contains a start time and a dt as well as data. A waveform file need a waveform as an input

 

I hope this answers your question

 

best Regards

0 Kudos
Message 2 of 3
(1,671 Views)

I'm agreeing with the Error Message and the responses you've gotten.  I'm guessing you are very much a beginner in LabVIEW, one who does not understand what a Waveform is, does not understand what Write Waveform to File (the function you are trying to use) does, does not understand loops and arrays.

 

Let's start at the beginning.  Write Waveform to File want to write a waveform.  What is a Waveform?  It is an array of data sampled at regular intervals (usually symbolized as dt, or delta-t), and is stored in a cluster.  It is not a single point, so you would not have this function inside a loop attempting to do a write for every point being generated (as your code suggests).

 

So what do we need to do to make your code do something semi-intelligent?  Well, you are generating (random) data points at a fixed dt (250 msec), and if you brought each of the points to the right edge of the While loop through an indexing tunnel, when the loop exited, you'd have 3 arrays of some number of points, all collected at 250 msec.  There's a function that can turn such an array into a Waveform (all you need to supply is the array and dt, which you know) -- guess which Palette has it?  Now you should have three Waveforms which you can combine into a 1D Array of Waveforms, one for the data types that Write Waveform to File is expecting.

 

Go ahead and try "fixing" your badly-broken VI following these suggestions.  Not only will the Broken Arrow go away, but you'll save your data to a file.  Success!

 

Bob Schor

0 Kudos
Message 3 of 3
(1,632 Views)