LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"I don't get it..."

I thought I was doing something fairly simple. I want to capture a bunch of waveforms to a file on an RTOS unit. Start the capture based on an external input turning ON and stop when the same input turns OFF. The whole capture may last for up to 3 minutes at 1000 samples per second. Then FTP this file to a central server and delete the file from the RTOS disk. I got this working fine now.
 
Now the problem. I built a "Read.vi" and I want to be able to grab this file from the server and display THE WHOLE THING on a chart, so I can zoom in on anything which doesn't look normal. I never dreamed this would be harder than Quantum Physics. I have tried .lvm files, and now I am trying binary files. I still see the same reaction. It will only read 1000 samples, or the first second of the file. A probe shows me that the Read Binary File.vi is indeed only reading in from 0 to 999 samples and then nothing else. At least it is reading all 16 waveforms.
 
My question is.... Is there any way that I can read more than the first second? OR Do I have to create a file for each successive second of my capture?
 
I have read thousands of posts and not been able to find anything about this. The only thing I can figure is that everyone must look at data in real time? I don't get it...
 
technomage
0 Kudos
Message 1 of 10
(3,949 Views)
I can speculate about what your problem is, but really need code to help you out.  Please post your code and we can find your problem.  A couple of things to look for:
  1. Is your original file correct (has more than 1000 points)?
  2. Are you using Express VIs that are set up wrong?
Post your code and we can take a look.  If you get more than about 1 million points in your graph, you may want to check out Managing Large Data Sets in LabVIEW.  It has an example very similar to what you are doing, although the browsing is from a memory object, not a disk object.  It will help you keep your performance up.
0 Kudos
Message 2 of 10
(3,926 Views)

There should be no problem to read a file of any size (within limits of the OS and memory resources). You must be doing something wrong.

Can you attach your VI to read the file? Can you open the whole file of you create a local copy first?

0 Kudos
Message 3 of 10
(3,925 Views)

Here is a copy of my Read-bin.vi and a sample file which should cover about 10-15 seconds of a 16 waveform capture. I have also attached the Write-bin.vi I have built, but it is set up to run on the RTOS.

I also have another vi I am using as the external trigger. Normally my laptop is running the Trigger.vi and also serving as the central server during this development phase. Then I run the Write-bin.vi on the RTOS unit over ethernet. My trigger signal is a shared network variable. When ON the capture is running and stores the data on the RTOS hard drive. When OFF the capture stops, the file is transferred via FTP to my "central server" and then deleted from the RTOS disk. In order to ensure the transfer took place I have modified the FTP-PUT.vi so it would output the response code from the server when the connection closes. That is the trigger to delete the file on the RTOS unit. I have also included that vi.

I hope someone can point me in the right direction...

Thanks a Ton

technomage

0 Kudos
Message 4 of 10
(3,880 Views)

Ooops, I forgot to say that I had renamed the .bin file to .txt to avoid any problem posting it. When I decided to zip them all together I forgot to name it back to .bin

sorry

technomage

0 Kudos
Message 5 of 10
(3,875 Views)
You are not saving the file in the format you think you are.  A dynamic datatype (DDT - the dark blue wire) is a single entity to LabVIEW.  Every time you save data to the file, you are saving a single, top-level, entity (1000 points, 16? channels, with timestamp).  You are not saving a continuous data set.  On the read side, you have not wired the count input.  This means you default to one item - which in your case is a DDT with 1000 points.  If you want a continuous data set, you will need to extract the data from the DDT and save without saving size information (assuming your data is actually continuous).  To read more than one set of data with your current configuration, wire the count input.

Let us know if you need more help.
Message 6 of 10
(3,867 Views)

So, if I understand correctly, the main thing I am doing wrong is using the DAQ assistant to read the analog inputs. Isn't that what would be giving me the Dynamic Data? Should I be using the DAQ primitives instead?

I guess my problem was based on the fact that I am generating rather large files so I assumed it was a continuous acquisition. Even though I am saving a "single entity", I must be saving many of them in the file.

I will dig deeper...

Thanks

technomage

0 Kudos
Message 7 of 10
(3,855 Views)
The easiest way to modify your code would be to use the Convert From Dynamic Data VI, found in the Express->Signal Manipulation palette.  This allows you to efficiently extract just the data array from a dynamic data type (or several other options, as well).  You also want to set the flag so you do not save waveform size in the file, since you are streaming and don't know how big things are going to get.  You will lose the timing information when you do this (t0, dt).  You can get this timing info and save it as your first points by fetching your first data set and converting to a waveform data type, explicitly save the t0, dt, then start saving your waveform only.

Note that the way you are currently doing it is not much less inefficient than doing it the way I mentioned above.  You just need to read multiple objects to get a continuous waveform.  To be truly efficient, you would need to fetch as binary data (e.g. I16) and store the scaling factors as well.  This would save you a factor of four or so in disk space, file size, and ftp time.
Message 8 of 10
(3,793 Views)

Actually I have found a way to use my "mistake" to my advantage. When I wired the "Count" input as you suggested, it turned the output into an "1D Array of, Cluster of 1 element of, 1D Array of, Waveform DBL". Now to get the waveforms out I added an "Index Array" followed by an "Unbundle". This got me back to my original array of waveforms.

While playing around with the "Count" value and the "Index" value I discovered that I can now pull out any "Segment" of this large file and display it on the chart. Now I just need to work on my loops so it will re-read the file and display the selected segment, without having to stop and restart the vi. Unfortunately the "read" takes place outside my While loop, so it only happens when the vi is first started.

I may post it when I get close...

technomage

0 Kudos
Message 9 of 10
(3,788 Views)

Hi

I did not read all messages because I read just one word in your first post "Chart". I'd just say try to use a Graph instead.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 10 of 10
(3,785 Views)