From: Ralf Date: Thu, 22 Oct 2020 16:37:21 +0000 (+0200) Subject: rigol-dg: Add some more waveforms for MSO5000 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=06600251e64d68e051d569fa3a0d644c5dfcd7d2;p=libsigrok.git rigol-dg: Add some more waveforms for MSO5000 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 --- diff --git a/src/hardware/rigol-dg/api.c b/src/hardware/rigol-dg/api.c index c65e6f17..a89e1ed5 100644 --- a/src/hardware/rigol-dg/api.c +++ b/src/hardware/rigol-dg/api.c @@ -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?", }, diff --git a/src/hardware/rigol-dg/protocol.c b/src/hardware/rigol-dg/protocol.c index 5a40c4f7..16e8d306 100644 --- a/src/hardware/rigol-dg/protocol.c +++ b/src/hardware/rigol-dg/protocol.c @@ -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; diff --git a/src/hardware/rigol-dg/protocol.h b/src/hardware/rigol-dg/protocol.h index 745a74d9..d62c87c7 100644 --- a/src/hardware/rigol-dg/protocol.h +++ b/src/hardware/rigol-dg/protocol.h @@ -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 {