]> sigrok.org Git - libsigrok.git/commitdiff
rigol-dg: Add some more waveforms for MSO5000
authorRalf <redacted>
Thu, 22 Oct 2020 16:37:21 +0000 (18:37 +0200)
committerSoeren Apel <redacted>
Sat, 28 Sep 2024 21:50:31 +0000 (23:50 +0200)
Known issue: Read-back of parameters does not work.
Caused by changing :SOUR:APPL to :SOUR:FUNC, because APPL only
supports NOIS, PULS, RAMP, SIN, SQU, USER.
When MSO5000 is configured to a different waveform, there is no answer at all.
sr: [00:00.051760] scpi_vxi: Successfully sent SCPI command: 'SOUR1:APPL?'.
sr: [00:02.056361] scpi_vxi: Device read failed for 192.168.1.250 with error 15

src/hardware/rigol-dg/api.c
src/hardware/rigol-dg/protocol.c
src/hardware/rigol-dg/protocol.h

index c65e6f17e689f40aaec1e77b955e8678f036eb89..a89e1ed5393a3a1f9d48be863b6eac9770b0112b 100644 (file)
@@ -261,8 +261,8 @@ static const struct scpi_command cmdset_mso5000[] = {
        { PSG_CMD_GET_ENABLED, "SOUR%s:OUTPUT:STATE?", },
        { PSG_CMD_SET_ENABLE, "SOUR%s:OUTPUT:STATE ON", },
        { PSG_CMD_SET_DISABLE, "SOUR%s:OUTPUT:STATE OFF", },
-       { PSG_CMD_GET_SOURCE, "SOUR%s:APPL?", },
-       { PSG_CMD_SET_SOURCE, "SOUR%s:APPL:%s", },
+       { PSG_CMD_GET_SOURCE, "SOUR%s:FUNC?", },
+       { PSG_CMD_SET_SOURCE, "SOUR%s:FUNC %s", },
        { PSG_CMD_GET_FREQUENCY, "SOUR%s:FREQ?", },
        { PSG_CMD_SET_FREQUENCY, "SOUR%s:FREQ %f", },
        { PSG_CMD_GET_AMPLITUDE, "SOUR%s:VOLT?", },
index 5a40c4f74695382ca731711d6d4e60c773cf6975..16e8d30669a6fe559eded5b00d24d3439e5bf7ad 100644 (file)
@@ -39,6 +39,20 @@ SR_PRIV const char *rigol_dg_waveform_to_string(enum waveform_type type)
                return "Noise";
        case WF_ARB:
                return "Arb";
+       case WF_SINC:
+               return "Sinc";
+       case WF_EXPRISE:
+               return "ExpRise";
+       case WF_EXPFALL:
+               return "ExpFall";
+       case WF_ECG:
+               return "ECG";
+       case WF_GAUSS:
+               return "Gauss";
+       case WF_LORENTZ:
+               return "Lorentz";
+       case WF_HAVERSINE:
+               return "Haversine";
        }
 
        return "Unknown";
@@ -60,6 +74,20 @@ SR_PRIV int rigol_dg_string_to_waveform(const char *s, enum waveform_type *wf)
                *wf = WF_ARB;
        else if (g_ascii_strncasecmp(s, "DC", strlen("DC")) == 0)
                *wf = WF_DC;
+       else if (g_ascii_strncasecmp(s, "SINC", strlen("SINC")) == 0)
+               *wf = WF_SINC;
+       else if (g_ascii_strncasecmp(s, "EXPR", strlen("EXPR")) == 0)
+               *wf = WF_EXPRISE;
+       else if (g_ascii_strncasecmp(s, "EXPF", strlen("EXPF")) == 0)
+               *wf = WF_EXPFALL;
+       else if (g_ascii_strncasecmp(s, "ECG", strlen("ECG")) == 0)
+               *wf = WF_ECG;
+       else if (g_ascii_strncasecmp(s, "GAUS", strlen("GAUS")) == 0)
+               *wf = WF_GAUSS;
+       else if (g_ascii_strncasecmp(s, "LOR", strlen("LOR")) == 0)
+               *wf = WF_LORENTZ;
+       else if (g_ascii_strncasecmp(s, "HAV", strlen("HAV")) == 0)
+               *wf = WF_HAVERSINE;
        else {
                sr_warn("Unknown waveform: %s\n", s);
                return SR_ERR;
index 745a74d9f8b0cdf04645f615e1f5a556e1133619..d62c87c79aeab2cdb1b9eadae9128329352c1ddd 100644 (file)
@@ -69,6 +69,13 @@ enum waveform_type {
        WF_PULSE,
        WF_NOISE,
        WF_ARB,
+       WF_SINC,
+       WF_EXPRISE,
+       WF_EXPFALL,
+       WF_ECG,
+       WF_GAUSS,
+       WF_LORENTZ,
+       WF_HAVERSINE,
 };
 
 enum waveform_options {