Forums › BB Series Discussions › Simple API question
- This topic has 14 replies, 2 voices, and was last updated 8 years, 3 months ago by
joeqsmith.
- AuthorPosts
joeqsmithParticipantI am attempting to use the latest API and for the most part, everything seems to work which is why I wonder if I found a bug.
I did notice that when I call the bbGetDeviceType, it always returns a 0. The device is open when I make the call. It does not return an error.
I assume the problem is between the keyboard and chair but I noticed the document mentions four possible types including BB_DEVICE_BB124
but the header only defines three.
// Device type
#define BB_DEVICE_NONE 0
#define BB_DEVICE_BB60A 1
#define BB_DEVICE_BB60C 2Is this call functional?
Thanks
AndrewModeratorHi Joe,
Yes, this call should be functional. Spike uses this function to properly determine which device is connected to the PC. You are free to email me any example you have where you find the function not behaving as you expect. I can take a look and see if I can reproduce it.
Regards,
A.J.
joeqsmithParticipantThanks, I will triple check my work. So far, of the 12 functions I have tried it’s the only one that seemed to have a problem. I am using LabVIEW 2011. Do you have this available for testing?
joeqsmithParticipantSTUPID STUPID STUPID… pointer problems… Must have been too late in the day and I could not see it.
I am reading the API document and I am trying to understand what I need to do to get the BB60C into zero-span mode.
Basically, I am wanting to try and decode that 2FSK signal I mentioned earlier using Labview. I have it now working with your demodulator using the clipboard copy paste. I also have it working with the raw IQ data now with the file save under zero-span. Next step is just to pull the data directly from the BB60C.
Also, I did not see anything in the API for triggers. Does this mean that the triggers in Spike were all at a higher level?
AndrewModeratorHi Joe,
Glad you found your problem with that function.
Regarding getting IQ data from the receiver, take a look in the examples folder. There will be an example of the minimal IQ acquisition setup. This should be a good starting point. If you don’t see the examples folder, get the latest API files from this download
https://signalhound.com/download/bbsa-application-programming-interface-for-windows-3264-bit/
Video triggering occurs in the Spike software. The implementation is simply looking for the transition across a certain amplitude. (for() loop through each IQ sample). Pattern triggering is much more involved and is performed in the Spike software as well.
Regards,
A.J.
joeqsmithParticipantYes, that was a big miss on my part.
With Spike being so rich in features, I wonder if you have considered adding a way for customers to hook into it rather than writing their own full blown programs. Ability to save the data to disk, post process the data from the demodulator, more advanced triggers would be very nice. In my case, if I use the demodulation, I have to use the clipboard to copy the binary data into a text editor, then save that to a text file where I can then do what I want and display it. It would be pretty cool to be able to do all this within Spike so I could leverage what you have written. Just a thought.
Thanks for the information on the triggers.
joeqsmithParticipantLooking at the return values of the bbQueryStreamInfo, the maximum length I seem to be able to return is 524288. I also seem to be unable to change the samples per second which is always 40M. So I basically have to stitch the data together.
Is there a way to decrease the sample rate or increase the length?
joeqsmithParticipantA few more questions about streaming the data.
Does the bbQueryStreamInfo need to be called prior to each call of the bbFetchRaw to know the amount of data sent, or will bbFetchRaw wait until the buffer is filled?
It seems to always send the same amount of data no matter how fast I make the call.
Is there a way to turn off the Q data stream and capture twice the amount of I data?
If there is no way to change the sample rate or increase the data length independently (aside from decimation) and it is up to the software to stich segments together, is there anything special that needs to be done to guarantee there is no loss of data between the segments?
AndrewModeratorHi Joe,
Did you get download the latest API files from the link I posted above? The bbFetchRaw function is deprecated and is not used in any of the examples I provide. The function that replaces it is the bbGetIQ function and has more flexibility.
That said, decimation is the only way to control the sample rate of the device. bbFetchRaw will always return the same amount of data per call. You do not need to call bbQueryStreamInfo more than once. bbGetIQ allows you to retrieve an arbitrary amount of samples per function call. bbFetchRaw guarantees no loss of samples assuming data retrieval keeps up with the sample rate of the device. The API will store about 3/4 of a second worth of data before data loss occurs.
This information and more can be found in the API manual at
https://signalhound.com/sigdownloads/BB60C/BB60-API-Manual.pdfRegards,
A.J.
joeqsmithParticipantThe one you linked has the same revision in the release_notes.txt as the one I am using.
Yes, I saw the bbFetchRaw was deprecated. I was not sure with the bbGetIQ that it would buffer up the data.
Looks like stitching the data back together is the answer. I’ll give that a try.
AndrewModeratorYou can use either function. They both serve the same purpose, the bbGetIQ function just has additional flexibility in how much data you acquire, keeping track of data loss, data left in the queue, and control over flushing the IQ data queue. Admittedly the bbFetchRaw function is much simpler and may be easier to use in Labview.
Regards
joeqsmithParticipantDoes the bbGetIQ have the same internal buffer size then? The document only seems to mention this with the bbFetchRaw.
I now have a similar video trigger as Spike where I wait for the radio to turn on before I start collecting the data. I then stiched multiple records together to form the packet. I then have my pattern trigger and decode the packet. This seems to work just fine. It’s pretty cool really! I am impressed!
Thanks for all the help.
joeqsmithParticipantVideo showing my BB60C running with Labview. Skip to the end if you just want to see the final result… Again, thanks for the help.
https://www.youtube.com/watch?v=f1UtLpSZ2W0&feature=youtu.be
AndrewModeratorHi Joe,
Thanks for sharing the video with us. It was a fun watch. Those were some neat Labview projects. I’ve been meaning to learn it. Good stuff.
Regards,
A.J.
joeqsmithParticipantNo problem. I’ve continued to work with the API using LabVIEW. The more I use it, I like it.
- AuthorPosts
You must be logged in to reply to this topic.