I am trying to send consecutive bursts with different characteristics (be it amplitude, frequency or completely arbitrary). Is there a proper way to ensure that the previous burst has been completely generated before the next burst is started? Something like a 'burst queue'? Having a continuous output signal without gaps or jumps is important for my project.
Thanks!
generating consecutive bursts without gaps?
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generating consecutive bursts without gaps?
With the current ASG logic, there is no easy way to find out when a burst is finished, and there is no queueing of bursts.
You could observe the buffer pointer and determine that way when a burst is finished. Programming a new burst should only be done once the generator is idle, so you'll have some neccessary delay between bursts. If you need to reprogram the waveform, this delay can get quite large.
You could of course change the ASG logic to suit your needs better, implementing a 'burst queue' that is coupled to the burst state should be possible.
You could observe the buffer pointer and determine that way when a burst is finished. Programming a new burst should only be done once the generator is idle, so you'll have some neccessary delay between bursts. If you need to reprogram the waveform, this delay can get quite large.
You could of course change the ASG logic to suit your needs better, implementing a 'burst queue' that is coupled to the burst state should be possible.
-
- Posts: 7
- Joined: Wed Apr 20, 2016 4:36 pm
Re: generating consecutive bursts without gaps?
Hello Nils,
would that be the following function call?
Thanks!
would that be the following function call?
Code: Select all
/**
* Returns current position of ADC write pointer.
* @param pos Write pointer position
* @return If the function is successful, the return value is RP_OK.
* If the function is unsuccessful, the return value is any of RP_E* values that indicate an error.
*/
int rp_AcqGetWritePointer(uint32_t* pos);
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generating consecutive bursts without gaps?
No, sorry, the API does not expose this functionality. If you want to add it yourself, the information can be read from the structure member ch_properties_t.buffReadPointer, like this (RedPitaya/api/rpbase/src/generate.c):
Code: Select all
int generate_getReadPointer(rp_channel_t channel, uint32_t *readpointer) {
volatile ch_properties_t *ch_properties;
ECHECK(getChannelPropertiesAddress(&ch_properties, channel));
*readpointer = ch_properties->buffReadPointer;
return RP_OK;
}
-
- Posts: 7
- Joined: Wed Apr 20, 2016 4:36 pm
Re: generating consecutive bursts without gaps?
after some include file adding, I can compile.. but I am getting a segmentation fault. When I comment all three lines from generate_getReadPointer() except for the return line, it works. Any ideas how to trace down the problem?
-
- Posts: 7
- Joined: Wed Apr 20, 2016 4:36 pm
Re: generating consecutive bursts without gaps?
If anybody wants to have a look, here is the code.. probably a stupid mistake but I cannot find it..
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generating consecutive bursts without gaps?
Not a stupid mistake, you just misunderstood how the different pieces work together. Your generate pointer is private to your sourcefile and will not be filled with the appropriate value when you call RP_Init(). So when you use it, it will still contain NULL and cause segfaults.
You need to put your generate_getReadPointer() into the generate.c file of the API, add wrappers for it to gen_handler.c and rp.c and put prototypes into the corresponding headerfiles. Then rebuild librp.so and install it on your RP. It sounds more complicated than it is, most things can just be copy-pasted from existing code.
You need to put your generate_getReadPointer() into the generate.c file of the API, add wrappers for it to gen_handler.c and rp.c and put prototypes into the corresponding headerfiles. Then rebuild librp.so and install it on your RP. It sounds more complicated than it is, most things can just be copy-pasted from existing code.
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 113 guests