01-07-2013 06:36 PM - edited 01-07-2013 06:40 PM
Hi All,
I'm trying to build ARB baseband data on my PC, a rack mount controller in this case, then transmit as quickly as possible with the 5673 (VSG) for real time transmission in a TDD. The best solution I've found is the following, but it doesn't seem to work properly. ... and I'm not sure why. Shouldn't it work?
I don't really understand the interaction between the script and streaming waveform.
Put generation mode into script;
Set the data transfer property to streaming;
Allocate and initialize VSG memory for the corresponding number of samples in my waveform;
Program a script like the following: ( I put comments after the '//' )
script myScript1
Generate wf0 // play waveform once to open up stream buffer
Repeat forever
Clear scriptTrigger0
Wait until scriptTrigger0 // (*) download next waveform, then use scriptTrigger0 to transmit
Generate wf0
end repeat
end script
FYI: Sample rate is in the 10's of MHz. (I've been using 80 MHz)
After initiating I can't do anything. I can't even query the device to check 'SpaceAvailableInStreamingWaveform'. Any subsequenct command gives the following error:
The data being written to the streaming waveform cannot keep up with the output.<LF/>Decrease the sample rate or write data to the streaming waveform more frequently.
Waveform Name: wf0
Status Code: -219106
So then I have to reset / reconnect. This seems faulty in that my streaming data is keeping up with the output since the VSG should be waiting.
Interestingly enough I can do the following and things actually work. It seems that an error is only produced when the VSG buffer is "mostly" empty. So if I pad enough zeros on my waveform, then play 3/4 of the entire buffer per trigger, things seem to work well. It's just a pain in the butt and I'm intruducing more latency then I'd like. The following script works:
script myScript1
Generate wf0 subset (0, 750000) // empty 3/4 of buffer
Repeat forever
Clear scriptTrigger0
Wait until scriptTrigger0 // download new data prior to trigger and play a 3/4 cyclic piece of the buffer
Generate wf0 subset (750000, 250000)
Generate wf0 subset (0, 500000)
Clear scriptTrigger0
Wait until scriptTrigger0
Generate wf0 subset (500000, 500000)
Generate wf0 subset (0, 250000)
Clear scriptTrigger0
Wait until scriptTrigger0
Generate wf0 subset (250000, 750000)
Clear scriptTrigger0
Wait until scriptTrigger0
Generate wf0 subset (0, 750000)
end repeat
end script
There has to be a better way to do this...
Any thoughts are apreciated.
Thanks in advance.
Clayton_A
01-07-2013 10:46 PM
So... after more thought about my application, I'm really not so concerned with small latency involved with additional buffer space.
I'm going to define a buffer that's twice the length of my waveform and simply ping-pong between to subsets. Like this:
script myScript1
Repeat forever
Clear scriptTrigger0
Wait until scriptTrigger0
Generate wf0 subset (0, waveform_length)
Clear scriptTrigger0
Wait until scriptTrigger0
Generate wf0 subset (waveform_length, waveform_length)
end repeat
end script
Then I'll just write to one subset while transmitting from the other.
I'm still interested in hearing any thoughts on the matter.
I'm also interested in why errors are produced when the VSG hasn't read all data in the stream buffer. Or 'at what point' are errors produced. Is there a non-zero difference between read and write pointers that is too close?
For example, the following gives an error prior to the first trigger:
script myScript1
Generate wf0 subset (0, (waveform_length - 100) )
Repeat forever
Clear scriptTrigger0
Wait until scriptTrigger0 // Any device query or command gives an error while waiting for this trigger.
Generate wf0 subset ((waveform_length - 100), 100)
Generate wf0 subset (0, (waveform_length - 100))
end repeat
end script
01-08-2013 04:34 PM
Hi Clayton_A,
What controller are you using in your chassis? I have seen this type of issue with older controllers because of the high throughput rates required when using RFSG. Also, though not exactly the same as your script, there is a known issue using script triggers documented here.
Regards
01-08-2013 08:11 PM
It's a remote controller, 64bit Windows, LabVIEW 2012 64bit, RFSG 1.8.5
I'm connected through a MXI x16.
01-10-2013 01:12 PM
Hi Clayton_A,
What is the size of your waveform? Also, how fast are you updating? The error you are seeing is an underflow error, which means the device is generating the signal faster than the controller is putting information to the buffer. It would make sense that padding 0's would help this, but it is strange if you are only going at 80 MHz. When exactly are you seeing the error?
One thing we can try is to see if the LabVIEW examples work. The Example Finder can be found by going to Help -> Find Examples. Next, navigate to Hardware Input and Output -> Modular Instruments -> NI-FGEN -> Fgen Arb Script.vi. Please try this to see if the example code will run.