Hi @Peter_T, take a look at the C# code that does this in the QA402_REST_TEST repo. Around line 176 you’ll see the DoAcquisition() that takes the left/right waveforms you want to send out. You can see the Base64 encoding into one big string, and then that string is passed to the Post() call around line 332.
And in the Post() function, that strings gets turned into a Post body application/json.
the length of the waveform array is equal to the buffersize - is that correct?
Since the waveform arrays are transmitted every time the acquisition is started
the time between each acquisition is relatively large. Is there a way to upload
the waveform once and then repeatedly use it?
My goal is to generate single or multiple sharp pulse on the generator output.
Is there a way to achieve this with the on board commands? I did not find a way …
Hi @Peter_T, there’s not a way to tell the analyzer to buffer the last buffer.
How large are the waveforms you are sending, and how long is it taking to process the waveforms? There will be two parts to this: The time required to digest the BASE64 data, and the time required to send the data. To the caller (aka your code), you can’t really know how long each took. But remember that doing a send/receive on a 64K buffer at 48K sample rate will take (64K/48)=1.36 seconds. And on a 128K buffer it will take twice as long. This is the physical time to send the buffer to the DAC. There’s no way to shorten this. But if you time the total time for the POST to return, you can then subtract the fixed transmission time and learn the processing time.
My guess is the processing time is a very small part of the equation. The reason being is that decoding BASE64 and sticking it into the body of a POST request is a pretty common operation and Microsoft has ensured C# is quite good there.
Could you please also reply to my questions regarding the REST API string and the buffer size and
if there is a way to eventually generate pulse with the on board generator functions …
Thanks for taking the time to answer my questions!
Peter
Hi @Peter_T, if you look at the code in the github link I posted above, you’ll see this the base64 encoded string goes into the body of the put request. This is because the max length of a URL is something like 2K or so. You cannot send large amounts of data via the URL as you are doing.
If you can run Visual Studio, the github repo should be easily cloned, and then you can single step the building of the REST command and add whatever debug you want. And then replicate that via CURL.