The brand-new PN400 Phase Noise Test System is available for purchase! →

VSG60A Windows C API

Forums › VSG Series Discussions › VSG60A Windows C API

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #236255
    Mike D
    Participant

    Hello all,

    I have a couple of questions regarding the Windows DLL API for the VSG60A. I’m using the latest version of the API (2020-01-06).

    The vsgOutputWaveform, vsgRepeatWaveform, and vsgSubmitIQ functions all take input buffers of type ‘float *’. Is there some reason why this is not ‘const float *’? I’m assuming this is a small oversight and I can just pass in a (casted) buffer of const data, but I wanted to be sure. I can’t imagine why the implementation would need to modify the input buffer.

    It looks like whenever I turn off RF output (via vsgSetRFOutputState), I can never get any output (using vsgRepeatWaveform or vsgOutputCW) when I turn it back on. The only way for me to get output again is to close the handle and establish a new connection. It’s as if the function can only turn off RF output and not turn it on. I understand that I can stop output via vsgAbort, but I liked the idea of completely gating RF output with that switch independently of current playback.

    Any feedback would be greatly appreciated. Thanks for your time.

    Mike.

    #236260
    AndrewAndrew
    Moderator

    Hi Mike,

    You are correct about the float* parameter. It should be const, and the data is not modified by the API. I will see about getting this in a future update. Yes, you are safe to cast.

    I can’t reproduce the issue you are seeing regarding RF output on/off. I wrote a short script to attempt to reproduce. Maybe you could try to run this? If all else fails, maybe you could whip up a simple script I could try to run and reproduce? See code below.

    This function simply turns on and off the RF output in 1 second intervals. I observed the power going on and off at these intervals.

    
    void testRFOutput()
    {
        int handle = -1;
        VsgStatus vsgSts = vsgOpenDevice(&handle);
        if(vsgSts != vsgNoError) {
            printf("Unable to open VSG\n");
            return;
        } 
    
        vsgSetFrequency(handle, 1.0e9);
        vsgSetLevel(handle, -40.0);
    
        while(true) {
            vsgSetRFOutputState(handle, vsgTrue);
            vsgOutputCW(handle);
            Sleep(1000);
            vsgSetRFOutputState(handle, vsgFalse);
            Sleep(1000);
        }
    }
    

    Look forward to your response.

    Regards,
    Andrew

    • This reply was modified 6 years, 7 months ago by AndrewAndrew.
    #236269
    Mike D
    Participant

    Hello Andrew,

    Thank you for your quick reply. I can confirm that your sample code is running just fine, thank you. I modified your sample code to do what I was trying to do. In the code below, I see the output for a second and then never again.

    void testRFOutput()
    {
        int handle = -1;
        VsgStatus vsgSts = vsgOpenDevice(&handle);
        if(vsgSts != vsgNoError) {
            printf("Unable to open VSG\n");
            return;
        }
    
        vsgSetFrequency(handle, 1.0e9);
        vsgSetLevel(handle, -40.0);
    
        vsgSetRFOutputState(handle, vsgTrue);
        vsgOutputCW(handle);
    
        while(true) {
            Sleep(1000);
            vsgSetRFOutputState(handle, vsgFalse);
            Sleep(1000);
            vsgSetRFOutputState(handle, vsgTrue);
        }
    }

    I thought that the vsgSetRFOutputState was a function I could use to quickly gate the output without having to generate a new waveform, which could potentially be an expensive operation. At any rate, I think I have everything I need so thank you for the help!

    Regards,
    Mike.

    #236273
    AndrewAndrew
    Moderator

    Thanks for the follow up. I see how that could be confusing. Let me know if I can help with anything else.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.