Forum Replies Created
- AuthorPosts
jgauthierParticipant- This reply was modified 4 years, 1 month ago by jgauthier.
jgauthier September 24, 2020 at 9:55 am in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Yes – purge is set to true.
The VSG waveform for now is short – it’s the simple CW waveform (iq = complex(1, 0) ) from the MATLAB examples in the SDK. The elapsed time from the start of transmitting the waveform from the VSG to returning from the GetIQData function (calling bbGetIQUnpacked and converting the returned array to complex) is < 0.20 seconds, so I’d think I wouldn’t need a separate thread just yet… But I’ll investigate doing it if I have to.
I’ve made the attached script just about as simple as I can get it. I’ve allowed for up to 4 triggers when grabbing I/Q data.
Attachments:
You must be logged in to view attached files.
jgauthierParticipant- Avg. Sustained Write Speed 203MB/s
- Avg. Sequential Mixed IO Speed 242MB/s
jgauthier September 24, 2020 at 6:57 am in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>The PC is a Dell laptop with an i7-5600U CPU @ 2.6GHz with 8GB RAM running Windows 10 Enterprise 1809…
The drive is a SanDisk X300 256GB MSATA SSD. According to UserBench SpeedTest, here’s the performance #’s:
Borderline, I guess?
JonG
jgauthierParticipantjgauthier September 23, 2020 at 10:20 pm in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>I should add that:
*I’m collecting at the highest resolution: decimation = 1 and bandwidth = 27MHz.
*The VSG60’s signal output is connected directly to the BB60 signal input (with a physical cable and 10dB attenuator).I’ve tried varying iqlen from 4096 [2^12] to 1048576 [2^20] with no real difference – I don’t see a trigger event. I’ve checked to make sure I have the VSG port2 (trigger out) connected to BB60 port 2, and the BB60 is set to trigger on the pulse leading edge…
I have the trigger length set to the default of 10 usec.
I’ll have to check and see if the PC’s SSD can sustain writes of 250MB/sec…
JonG
jgauthierParticipant- bbConfigureIO(int32(0), int32(64))
- bbConfigureIQCenter(CenterFreq)
- bbConfigureIQ(downsample, bandwidth)
- vsgSetFrequency(CenterFreq)
- bbConfigureIQCenter(CenterFreq)
- bbInitiate(uint32(4), uint32(0))
- vsgSubmitTrigger()
- vsgSubmitIQ(iqPtr, count)
- vsgFlushAndWait()
- GetIQData(iqCount, purge)
jgauthier September 23, 2020 at 9:50 pm in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Andrew,
Still not seeing triggers. Could it be the order I’m executing things?
I tried switching the order of vsgFlushAndWait and GetIQData, but it makes no difference.
In GetIQData, I have:
function [status, iqArray] = GetIQData(handle, iqCount, purge) nullPtr = int32(0); purgeArg = int32(purge); iqArrayPtr = libpointer('singlePtr', zeros(iqCount*2, 1)); iqCountInt = int32(iqCount); triggerPtr = libpointer('int32Ptr', ones(4,1)); % pointer to array of 32-bit integers triggerCount = int32(4); % size of the trigger array (32-bit int) status = calllib('bb_api','bbGetIQUnpacked',handle,... iqArrayPtr,iqCountInt,triggerPtr,triggerCount,... purgeArg,nullPtr,nullPtr,nullPtr,nullPtr); calllib('vsg_api', 'vsgFlushAndWait', handle); fprintf('Triggers:\n'); triggers = triggerPtr.Value; disp(triggers); % Convert results to complex numbers iqArray = reshape(iqArrayPtr.Value, 2, iqCount); iqArray = iqArray(1,:) + 1i * iqArray(2,:); iqArray = transpose(iqArray); end % of GetIQData
And I still find no triggers – disp(triggers) shows:
Triggers: 0 0 0 0
Any hints?
Thanks,
JonG
jgauthierParticipantjgauthier September 18, 2020 at 10:30 am in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Still having a few problems…
If I’ve done the following:
- vsgSubmitTrigger
vsgSubmitIQ
vsg.transmit(waveform, mode) which calls vsgOutputWaveform or vsgRepeatWaveform
then later call vsg.stop (which does a vsgAbort)If I call vsg.transmit again, will it still output a trigger, or do I have to submit trigger again?
Thanks,
JonG
jgauthierParticipantjgauthier September 9, 2020 at 3:54 pm in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>MATLAB didn’t seem to like the type int32ptr passed in libpointer, but it seems to be case sensitive in my version – int32Ptr worked fine…
jgauthierParticipantjgauthier September 8, 2020 at 12:31 pm in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Thanks, Andrew!
Yes – I was configuring the BB60 to capture on rising edge of trigger in bbconfigureiq.m…
I’ll try your code examples and get back to you
jgauthierParticipantjgauthier September 8, 2020 at 8:38 am in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Back at it after a week’s vacation…
I realized I was calling libpointer with the wrong parameters, so I changed it to:
triggerCount = int32(70); % size of the trigger array (32-bit int) % from SDK example "iq_external_trigger.cpp" triggerArray = 0:0:triggerCount; % array where we'll store trigger events... triggers = libpointer('int32', triggerArray); % pointer to array of 32-bit ints ... status = calllib('bb_api','bbGetIQUnpacked',handle,iqarrayptr,iqcountint,triggers,triggerCount,purgearg,nullptr,nullptr,nullptr,nullptr);
I still get an error, but it’s
Parameter must be scalar. Error in libpointer (line 21) ptr=lib.pointer(varargin{:}); Error in bbgetiq (line 67) triggers = libpointer('int32', triggerArray); % pointer to array of 32-bit ints
Are there any working examples of calling that C-library function from MATLAB? I’m stumped.
jgauthierParticipantjgauthier August 28, 2020 at 3:29 pm in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>I’m getting there, but having problems with MATLAB.
I started with the
bbgetiq.m
in the SDK, and modified it by trying to redefine the arraytriggers
and the size of ittriggerCount
as specified in the API manual forbbGetIQUnpacked
.I tried:
triggerCount = int32(70); triggers = libpointer('int32', triggerCount); calllib('bb_api','bbGetIQUnpacked',handle,iqarrayptr,iqcountint,... triggers,triggerCount,purgearg,nullptr,nullptr,nullptr,nullptr);
but MATALAB complains:
Error using calllib Array must be numeric or logical or a pointer to one
I can’t figure out how to properly define an array of integers ‘triggerCount’ long…
jgauthierParticipantjgauthier August 27, 2020 at 12:23 pm in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Thanks, Andrew
I guess I wasn’t specific enough. I want the step the VSG60 output of a simple CW waveform, stepping from a begin frequency to an ending frequency, and to output a trigger to the BB60 so it can grab IQ samples at each step when it sees the trigger input…
I hadn’t seen the
iq_external_trigger.cpp example
– that certainly helps!
jgauthierParticipantjgauthier August 27, 2020 at 8:34 am in reply to: BB60C matlab bbgetiq.m example code //php bbp_reply_id(); ?>Thanks! Is there any example MATLAB code to collect IQ data upon a trigger input from the VSG60 to the BB60? Going through the SDK, all I find on triggers is in the API, not any of the sample code. I.e, do I have to add to VSG60.m to get trigger output status, or should I write a dedicated function for that?
- AuthorPosts