USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

Using C# or .net C++ with NI USRP-2920

We are needing to make a quick prototype with the NI USRP-2920 and I do not know LabView. Yes, I know I need to learn, but I am much faster with C# or C++ (.net). 

Is it possible to completely interface with the NI-USRP using a .dll? Is it compatible with C#? If not, is it compatible with .net C++? 

Just looking for some insight.

 

Thanks for the help.

 

0 Kudos
Message 1 of 11
(10,432 Views)

Hey Nick_S_86,

 

NI-USRP won't just natively work in C# or .net C++, but it should be fairly simple to create a wrapper for it and call into the dll.  I haven't personally done it, but I checked with our driver team and they said there is no reason it can't be done.

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 2 of 11
(10,423 Views)

Which dll are you talking about? Is there documentation or code examples I can use?

0 Kudos
Message 3 of 11
(10,421 Views)

Hi Nick_S_86,

 

You can use the niusrp.dll.  Using the dll outside of the LabVIEW environment is not a supported feature, so there is no documentation for a text based API and there are no examples.  However, you can use the NI USRP help documentation for details about the functions available in the driver.  You can find the documentation by going to Start >> All Programs >> National Instruments >> NI-USPR >> Documentation.

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 4 of 11
(10,419 Views)

Nick,

 

You should be able to find the header files for the niUSRP.dll at C:\Program Files\National Instruments\NI-USRP\includes

You will also need to link your compiler to the library file located at C:\Program Files\National Instruments\NI-USRP\lib\msc

Anthony F.
Staff Software Engineer
National Instruments
0 Kudos
Message 5 of 11
(10,414 Views)

Hello,

 

I'm trying to control my USRP2921 via my own C++ application.

I can't compile program that create an USRP device...

 

This is what I get in terminal (ubuntu) when I try to compile following code:

#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/thread.hpp>
#include <iostream>
#include <fstream>
#include <complex>
#include <csignal>

int UHD_SAFE_MAIN(int argc, char *argv[])
{

std::string args ="192.168.10.2";

uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);

 

return EXIT_SUCCESS;
 }

 

/tmp/ccQJzixr.o: In function `_main(int, char**)':
USRP_Control.cpp:(.text+0x126): undefined reference to `uhd::device_addr_t::device_addr_t(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
USRP_Control.cpp:(.text+0x138): undefined reference to `uhd::usrp::multi_usrp::make(uhd::device_addr_t const&)'
collect2: ld returned 1 exit status

Could anybody help me?

 

 

 

 

0 Kudos
Message 6 of 11
(9,868 Views)

Hey TomStr,

 

It looks like you are using UHD in your application.  I recommend you check out the USRP users mailing list for UHD support.  While you may get an answer on this forum, this forum provides support more targeted for NI-USRP hardware questions or NI-USRP driver and LabVIEW questions.

 

You can find more information about the mailing list and other forums of support here:

http://code.ettus.com/redmine/ettus/projects/uhd/wiki

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 7 of 11
(9,865 Views)

Hi Sarah_Y,

 

Thank you for your response. Yes, indeed I'm using UHD. It was a linker problem. Resolved.

 

I'd like to ask about USRP-2921 sampling rate and maximum bandwidth. I'd like to send signal of 20 MHz bandwidth on 5.8 GHz frequency center.

 

So I have to sample my signal with rate at least 40MS/s.

 

But maximum sampling rate that I could set equals 33,333333 MS/s...

 

Do you know what is a problem?

 

0 Kudos
Message 8 of 11
(9,827 Views)

Sample rate chances happen in the FPGA.  The rates are all divisors of a 100 MHz clock.  For 40 MS/s of data you need to set the sampling rate to 50 MS/s

= 100 MS/s divide by 2.  Divide by 3 is 33.3 MS/s you saw.  Divide by 4 is next at 25MS/s.  You can continue to divide down to 200kS/s.

0 Kudos
Message 9 of 11
(9,805 Views)

Thank you.

 

And I have another doubt - how we could determine bandwidth of the received signal? Is it equal the IF filter bandwidth?

 

 

0 Kudos
Message 10 of 11
(9,738 Views)