04-25-2013
03:17 AM
- last edited on
05-05-2025
06:45 PM
by
Content Cleaner
By far the easiest way to do this is to use the built in primitives for binary file IO, but I believe from your previous post these aren't available in the the version of LabVIEW you are using. They look something like this, you specify the datatype to read and LabVIEW sorts out the rest.
Otherwise, there is an option to flatten the data to a string, log as binary/ASCII (equivalent in this case), read back as a string then unflatten the data.
Those functions, Flatten to String and Unflatten from String may not be available in LV7.x - I don't have a copy to check against here.
04-25-2013 03:01 PM
Thank you for the reply Todd. I will try to do that, but like you said, I think it may be too slow.
Peter,
I think I will try the second option, with the flattening and unflattening. In the image, I'm not quite sure what you mean by "writing and reading with normal IO". Are those functions within Labview? Thank you
04-26-2013 04:33 AM
05-01-2013 04:32 PM
Hello Peter,
I tried using the flatten and unflatten functions. I'm stuck though. I'm not sure how to log as binary. I've attached some code to show you what I've got. It's not much really, because I'm not sure how proceed. I want to tell the unflatten function to use the waveform(DBL) type so that it can graph the data. I'm sure I'm missing some steps however.
Would it be easier to use MATLAB for data analysis. Perhaps there is a way to call binary files into Matlab and then displaying that data into a graph? I'll look into that as well.
Thank you
05-02-2013 03:03 AM
Hi Trannh,
From my understanding it sounds like you need two distinct functions. The first one is doing this:
The second function should be able to:
The easiest way to create a waveform array constant is to right-click your waveform array wire from the first function and select Create » Constant - you can then cut and paste this across to other function.
- Did we discuss the reasoning behind writing the data to a file?
It is possible to analyse the data in Matlab, although it does not natively (to my knowledge) support the LabVIEW waveform datatype, so you would need to find a plug-in. My guess is that it would be more difficult - what analysis do you need to perform?
05-02-2013 02:56 PM
Hello Peter,
I don't have the code to acquire the array of waveforms. I'm not quite sure how to do that. Do you mean converting the waveform data into a 2D array? Is this something I do in my data acquisition program or in a separate program like the latest attachment I showed you? I've attached pictures of both. In the first program, I tried to use the waveform data and the method you suggested, but I'm not getting anything. The program is saving the data into an external binary file. In the second image, I tried to create a program that could open any file and then use the method you suggested to display the data. I think I'm getting closer. Thank you so much for helping me with this.
05-02-2013 02:58 PM
In the first program I was trying to make the program display all of the data acquired onto the second graph once I hit the stop button to stop recording data.