02-05-2015 06:14 PM
I'm using LabView to interface with the USRP N210.
Using the example Tx waveform, I'm trying to figure out how to read data from a binary file instead of using the built-in Sine waveform vi.
One issue is that I don't know how to read from a binary file, then loop back to the beginning of the file once EOF has been reached. As in, I want to generate one period of a sin wave in MATLAB, fwrite it to a binary file, then use that as the input to the USRP Tx example vi. I'd like to continuously read this data so that the next value after the last is the first value in the file.
I've been made aware of measurement files, but there's still no easy way to read/write from/to a measurement file in MATLAB. Even if there was, this is adding unessisary complexity, IMO. I can write a 1d vector in MATLAB to a binary file and read it in LabView, but can't get it to loop continuously to make it fit into the USRP example.
I'll attach the example vi I'm talking about.
--
Justyn
02-05-2015 10:12 PM
First of all, rereading the file over and over again is a waste. Read the data once and store it in something like a DVR or functional global (depending on the size of the data). Structure the buffer such that it operates like a circular buffer.
Only read the file when the data in it changes.
Mike...