USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a transceiver from USRP Packet TX/RX example

Hi

I have just seen the USRP packet Tx/Rx example. It is a very useful example but I would like to make a synchronous transceiver by using sequence structure. So I somehow combined the two VIs to make one VI . 

here is the example:  https://decibel.ni.com/content/servlet/JiveServlet/download/18801-9-38215/USRPPacketTxRx.zip

I have attached my vi to this post. Basically first I configure both receiver and transmitter and then start to transmit packets and then my receiver will receive packets. I would like to do it packet by packet. so my transmitter transmit one packet and the receiver , receive that packet and the process repeats for the next packet

I would also like to use frequency hopping so I can transmit my packets at different frequencies and the receiver will use the same pattern for the carrier frequencies.

The problems I have faced are:

 

Firstly for the frequency hopping part. seems like I can't change the carrier frequency while the driver is in use so I need to stop both USRPs ,change the centre frequency and then transmit again. But this process takes a lot of time to set the front end . I would greatly appreciate your ideas regarding making a frequency hopping modem using the usrp. I am not sure the method I use is correct or not. I don't want to make something as fast as Bluetooth but it is almost impossible to implement frequency hopping if I stop the usrp for every hop

 

Secondly even if I don't change the carrier frequency the transceiver still not functioning properly and I get lots of errors like time out errors . Would you please help me with this code?

Message 1 of 19
(13,766 Views)

Hey tintin99,

 

Writing this sort of application is tricky and will take some time to get right.  I don't have a perfect answer, but I have some suggestions based on some similar applications that I have been working.

 

First, regarding the frequency hopping, using the Carrier Frequency property node is the correct way to do the hop.  You can change this property without having to stop your task.  You do not need to change the LO frequency as well.

 

Next, I would recommend implementing some sort of power trigger for your receive so that it only processes data when valid data is present.  I have had a lot of success using the trigger function from our 6x6 MIMO example.  Just follow that link, download the zip file, and drop the trigger function in to your VI.  You may need to tweak it slightly depending on your application.

 

A final piece of advice--check out the "End of Data" Boolean for the Write TX Data VI.  It doesn't behave quite like you have it implemented in your VI.  You should not have a stop button connected to it.  This Boolean will actually allow you to transmit in a different way.  The 2 basic ways of transmitting are finite and continuous, but by setting this Boolean to true, you enable a bursty transmit.  For this bursty transmit, you can specify the number of samples that will be in the buffer for a transmit, as well as the time to begin the transmit.  The bursty method allows you to send a burst of data and then turn off the front end amplifier so you aren't sending out noise when you aren't sending out your packet without completely stopping your task.  For the time to transmit, I take the timestamp of when my trigger goes off and add a set amount of time to it.

 

This method sounds a lot more complicated, and it is definitely tricky, but it is the architecture you need to consider in order to get your frequency hopper working.  Let me know as you come across issues and I'll do my best to provide answers.  I know this topic isn't particularly well documented, so posting your code as you have success would also help others trying to do something similar!

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 2 of 19
(13,747 Views)

Sarah Many thanks for your suggestions. It was really helpful. I don't have access to the USRPs but I will definitely try use your suggestions tomorrow

 

just regarding the hopping issue. As I mentioend I get " you can't change this attribute because the driver is in use" error and I use 1.1 version. seems like in this version it is possible but I don't know why still I can't change the C-Frequency in a loop. Do you have any idea?

 

I have also used a power trigger method ( minimum threshold ) to detect the packets. The VIs work fine when ther are sepereated ( the transmitter and Reciever) but I would like to combine them and make a sequence so I can send one packet, recieve the packer and then the same for next packets because as I mentioned I would like to use F-hopping and so every packet should use a different Carrier-frequency.

and when I combine two VIs I get lot's of emails. Tomorrow I will take a note of all errors and will post them here.

As

0 Kudos
Message 3 of 19
(13,724 Views)

Hey tintin99,

 

Like I mentioned before, you should be able to change the carrier frequency while running in a loop like you are trying to do.  I just added a property node to the niUSRP EX Rx Continuous Asysnc.vi example and was able to change the Carrier Frequency and the LO Frequency inside the loop without any issues.  Having an niUSRP Abort call inside your loop could be causing problems.  Changing the frequency will work and it will just require a little debug to figure out why it currently isn't.

 

As far as your application, it is possible to put the Tx chain and the Rx chain the the same vi to create the burst type transceiver you want to.  Once you are able to use the End of Data function for the Tx chain, it will be much easier.  I would also recommend using queues as a way to store your data.  The best set up I have found is to use 3 loops:  1 for Rx, one for Tx, and one for data processing.  I also use 2 queues, one for Rx data and another for Tx.  The processing loop uses a sequence structure to implement the modulation, demodulation, and packet building.

 

Once you post your errors, I'll do my best to help debug and get your application up and running.

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 4 of 19
(13,718 Views)

Hi Sarah,

 

A quick question regarding frequency hopping? what about the TX loop!  Is it possible to use a Carrier frequency property node inside the TX loop to transmit every packet at different frequency

 

 

 

0 Kudos
Message 5 of 19
(13,715 Views)

Hey tintin99,

 

You can use that same property node in the TX loop or in the RX loop and change the frequency for every packet if you like.  I would try working with some basic examples if you are getting errors in your larger application.

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 6 of 19
(13,698 Views)

Hi Sarah,

 

I am really confused and I don't know why it is not working and I can't change the centre frequency when the driver is in use. I have just edited two of the USRP examples. Would  you please double check to see whether you get the " you can't change this attribute while the driver is in use" or not. As I mentioned before in both VIs I get this error and I use LV 2011 and USRP 1.1

 

I have attached both files. Basic PSK T and R

Download All
0 Kudos
Message 7 of 19
(13,672 Views)

Hi tintin99,

 

For the Rx example, I don't get that error.  However, if you are seeing it you could add in another Initiate before you while loop starts:

 

forum.PNG

 

For the Tx I don't get the error either.  These VIs both look very simple and appear like they should be working.  Are you running anything else in the background that could be causing an error?

 

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 8 of 19
(13,666 Views)

Hi Sarah,

 

Many thanks for your help. It is really strange. In both cases I get this error even when I edited the RX part as you mentioend

 

Error -1074118632 occurred at niUSRP Initiate.vi
Possible reason(s):
This attribute cannot be modified while the driver is in the Running state.

 

I really don't know what to do and nothing is running in background. What if I change the LV version to 2012. Does it helps?

 

 

0 Kudos
Message 9 of 19
(13,664 Views)

Hey tintin99,

 

I'm also running LabVIEW 2011 and since 2012 wasn't out when NI-USRP 1.1 was released, almost all of the validation test for the driver was done using LabVIEW 2011 as one of the 3 versions tested.  Are you able to use one of the examples that shipped with the driver to change this property?  Can you see if niUSRP EX Tx Continuous Async Reconfig on the Fly.vi?  That will test out other property nodes as well.  If that example fails, I would try to do a repair for the driver and reflash the FW/FPGA images.

Sarah Yost
Senior Product Marketing Manager
0 Kudos
Message 10 of 19
(13,662 Views)