09-12-2014 05:09 AM
09-15-2014 02:38 PM
Can you attach the code that you are trying to make work.Thanks.
09-24-2014 06:01 AM - edited 09-24-2014 06:02 AM
I like to look at the "Initiate" vi as the thing that finalizes configuration and kicks off data streaming. If the 3 measurements you're making are consecutive/continuous in time...then you only need to call Initiate once (outside the loop) after you've set up all the timing...then call Fetch within your loop 3 times. This will give you 3 "chunks" of data which are all contiguous in time.
If you want to take your 3 chunks of data at random times (say, when a user clicks a button)...then you'll have to configure everything like the "single shot" examples. In this case, you'll have to configure the timing, Initiate, and Fetch, and then Stop, each time you want a chunk of data.
Basically, for synchronous measurements, the driver gets confused if you call Initiate more than once after you've set up the initial timing and triggering parameters. Think of it this way...you initially set the system clock to 0, and then tell the USRP to start streaming at 1 second (in system time). You initiate, the clock starts, data starts streaming at the configured time, you fetch some samples, do some stuff, etc.. Now you go back and call Initiiate again. The driver says to itself, "Ok I will start streaming at system time of 1 second"....but...the system clock is already way beyond that already. Error! So...you either have to go back and reset the system clock back to zero and the trigger to 1 second....OR....just Initiate once and call the Fetch VI multiple times in the loop to get contiguous chunks.
---
Brandon
09-24-2014 06:18 AM
I guess I should add a few other details here...
Reconfiguring a property like retuning the center frequency requires a "reconfiguration", which is essentially what the Initiate VI does (at least that's the way I like to look at it). The reason you see it work with only one channel (radio/device) is that since you're not making a sync'd measurement across different devices, you can reconfigure (i.e. - Initiate) as many times as you want since system time doesn't matter.
Once you try to do this with multiple sync'd channels...then you get to the situation I described above. You set up all the initial timing parameters for synchronization...but are then asking the system to reconfigure over and over without resetting the system clock. I'm guessing that the "re-tune" process isn't deterministic, which is why the driver can't both reconfigure the radio AND assure time sync. You've got to go back and start from the beginning, so to speak.
From what I can tell...things like center frequency and IQ rate are properties that require the radio to "shut down" so that it can re-tune. You'll need to re-call all the timing and sync blocks each time if you want to do multiple acquisitions with different configurations of these parameters.
However...I've been able to do things like switch antennas ports and change the gain WITHOUT having to "re-tune" and reconfigure. I suppose this makes sense, as they're both "timing agnostic". In other words...these properties don't require changes to the LO or the rate of samples coming from the FPGA, both which need to be controlled to assure time synchronization.
---
Brandon
09-24-2014 06:26 AM
Sorry...one more thing!
It sounds like you're trying to calibrate the phase offset between two radios with a calibration tone. Presumably, you've got some signal of interest that you want to measure coherently (hence the sync'd acquisition of multiple channels/devices), and you want to "flip over" to the calibration signal at different frequency to callibrate out the phase difference between the radios. Is this right?
If so...this approach won't work because each time you retune the center frequencies, the phase difference between devices will be different. So you're calibration will be worthless when you "swap back" to the other center frequency.
There are some cute tricks to get around this, if this is indeed what you're trying to do.
09-26-2014 05:06 AM
Hi cochenob,
first of all, thanks for your precious tips!
By the way, we solved our problems by using a queue structure from the Data Fetch VI loop to the data processing loop and adding a flush queue data after every input prompt.