/Settings/AudioGen/Gen1/On/1000/-10 does not turn on Gen1

I’m trying to use /Settings/AudioGen/Gen1/On/1000/-10, but it does not turn on GEN 1 when it is switched off or another generator is enabled. It also does not work with the QA403_REST_TEST application. It also does not change to GEN 1 when it is in FREQ RESPONSE. Change frequency and amplitude do change though.
I get the message ‘FFT too small’ when I perform an acquisition after trying to turn on GEN 1 when it is currently at ‘FREQ RESPONSE’. Also getting the fft with GetInputFrequencySeries returns empty values for Left and Right.

What am I doing wrong here?

Hi @breedj , if you run the app with -C (console) or -L (logging) you might see more info. I can’t tell if your question are a bunch of separate questions or one big question. Remember the strings you are sending are case sensitive. The -C option should show you malformed URL errors.

“FFT too small” means the FFT is too small. If you see that message while doing an FFT sweep, you need to increase your FFT size. You can run manually to learn the limits. For example, at 48K, 16K is too small, but 32K is not. And at 96Ksps, 32K is too small but 64k isn’t.

When switching from Sine to Chirp, you need to set the source. See PUT /Settings/OutputSource/{Source}

Can you distill your problem down to some curl statements and paste those?

Hi Matt,

I figured this out with your help:

  • To enable the Sine generator I first have to call PUT Settings/AudioGen/Gen1/On/1000/-10 and then call PUT /Settings/OutputSource/Sine.
  • To disable the Sine generator I first have to call PUT Settings/AudioGen/Gen1/Off/1000/-10 and then call PUT /Settings/OutputSource/Sine.
  • Calling /Settings/OutputSource/Sine before calling Settings/AudioGen/Gen1/On/1000/-10 does not enable the generator. That is no problem, but I expected it to work like that. The API description does not tell me I should call /Settings/OutputSource/Sine after Settings/AudioGen/Gen1/{OnOff}/{frequency}/{Amplitude} to enable the Generator.
  • I can call Settings/AudioGen/Gen1/{OnOff}/{frequency}/{Amplitude} to change the frequency and amplitude without having to call /Settings/OutputSource/Sine.
    For some reason this also causes the FFT too small error. I do not get this error anymore.

Thank you for your help.
Joost

Hi @breedj, if you are already in sine mode, then turning the generator on should do it. But if you are in FREQ mode, then just turning the sine generator on won’t do it, because you are in FREQ mode.

See the REST sequences in this code (sourced from HERE)

Does this not work for you?

curl -d "" -X PUT http://localhost:9402/Settings/Default
{ "SessionId":"3385396359" }
curl -d "" -X PUT http://localhost:9402/Settings/Input/Max/18
{ "SessionId":"3385396359" }
curl -d "" -X PUT http://localhost:9402/Settings/AudioGen/Gen1/On/1000/0
{ "SessionId":"3385396359" }
curl -d "" -X POST http://localhost:9402/Acquisition
{ "SessionId":"3107986534" }
curl -d "" -X GET http://localhost:9402/RmsDbv/20/20000
{ "SessionId":"3107986534", "Left":"-0.0576729794600683", "Right":"0.0469983685396606" }

Hi matt. It seems to work, but the GEN1 button in the UI does not light up. All the other calls do result in changes in the UI. So I just thought it wasn’t enabled.

But it does light up when I call:
$ curl -d “” -X PUT http://localhost:9402/Settings/OutputSource/Sine
after
curl -d “” -X PUT http://localhost:9402/Settings/AudioGen/Gen1/On/1000/0

That I find confusing.

Hi @breedj,

I think this is correct. When you are in WhiteNoise mode, for example, you won’t see changes to the GEN1/GEN2 button state because you aren’t in SINE mode.

Consider the following:

<File New on QA40x app>
curl -d "" -X PUT http://localhost:9402/Settings/OutputSource/WhiteNoise
curl -d "" -X PUT http://localhost:9402/Settings/AudioGen/Gen1/On/1000/0
curl -d "" -X PUT http://localhost:9402/Settings/AudioGen/Gen2/On/1000/0
curl -d "" -X PUT http://localhost:9402/Settings/OutputSource/Sine

When you do the File New on the app, that puts you in sine mode with both GEN1 and GEN2 off.

Then issue the WhiteNoise command. That will illuminate the WhiteNoise button.

Then do tthe GEN1 and GEN2. That will set the GEN1 and GEN2 states, however, you are still in WhiteNoise mode. When you enter the Sine command, then you will see the GEN1 and GEN light up, indicating the state you just set.

What is happening is the GEN1 and GEN2 buttons are ANDed with the SINE state. It could be clearer in the future if perhaps the GEN1 and GEN2 button states were shown but dimmed or something.