Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scopehal/AlientekPowerSupply.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -153,6 +153,12 @@ class AlientekPowerSupply
public:
static std::string GetDriverNameInternal();
POWER_INITPROC(AlientekPowerSupply);
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
{"Alientek DP100", {{ SCPITransportType::TRANSPORT_HID, "2e3c:af01" }}}
};
}
};

#endif
11 changes: 9 additions & 2 deletions scopehal/DemoOscilloscope.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -197,8 +197,15 @@ class DemoOscilloscope : public virtual SCPIOscilloscope

public:
static std::string GetDriverNameInternal();

static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
{"Demo Oscilloscope", {{ SCPITransportType::TRANSPORT_NULL, "" }}}
};
}
OSCILLOSCOPE_INITPROC(DemoOscilloscope)


};

#endif
Expand Down
8 changes: 7 additions & 1 deletion scopehal/DemoPowerSupply.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -99,6 +99,12 @@ class DemoPowerSupply

public:
static std::string GetDriverNameInternal();
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
{"Demo PSU", {{ SCPITransportType::TRANSPORT_NULL, "" }}}
};
}
POWER_INITPROC(DemoPowerSupply)
};

Expand Down
18 changes: 17 additions & 1 deletion scopehal/KuaiquPowerSupply.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -103,6 +103,22 @@ class KuaiquPowerSupply
public:
static std::string GetDriverNameInternal();
POWER_INITPROC(KuaiquPowerSupply);
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
#ifdef _WIN32
{"Kuaiqu SPPS-D", {{ SCPITransportType::TRANSPORT_UART, "COM<x>:9600" }}},
{"Kuaiqu SPPS-S", {{ SCPITransportType::TRANSPORT_UART, "COM<x>:9600" }}},
{"Kuaiqu SPPS*D", {{ SCPITransportType::TRANSPORT_UART, "COM<x>:9600" }}},
{"Kuaiqu R-SPPS", {{ SCPITransportType::TRANSPORT_UART, "COM<x>:9600" }}}
#else
{"Kuaiqu SPPS-D", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>:9600" }}},
{"Kuaiqu SPPS-S", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>:9600" }}},
{"Kuaiqu SPPS*D", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>:9600" }}},
{"Kuaiqu R-SPPS", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>:9600" }}}
#endif
};
}
};

#endif
14 changes: 12 additions & 2 deletions scopehal/MagnovaOscilloscope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -368,6 +368,16 @@ string MagnovaOscilloscope::GetDriverNameInternal()
return "magnova";
}

std::vector<SCPIInstrumentModel> MagnovaOscilloscope::GetDriverSupportedModels()
{
return {
{"Magnova", {
{ SCPITransportType::TRANSPORT_LAN, "<ip_address>:5025" },
{ SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
}}
};
}

OscilloscopeChannel* MagnovaOscilloscope::GetExternalTrigger()
{
return m_extTrigChannel;
Expand Down Expand Up @@ -679,7 +689,7 @@ double MagnovaOscilloscope::GetChannelAttenuation(size_t i)
{
protocolError("invalid channel attenuation value '%s'",reply.c_str());
}
return 1/d;
return d;
}

void MagnovaOscilloscope::SetChannelAttenuation(size_t i, double atten)
Expand Down
3 changes: 2 additions & 1 deletion scopehal/MagnovaOscilloscope.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -493,5 +493,6 @@ class MagnovaOscilloscope : public virtual SCPIOscilloscope, public virtual SCP
public:
static std::string GetDriverNameInternal();
OSCILLOSCOPE_INITPROC(MagnovaOscilloscope)
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels();
};
#endif
12 changes: 11 additions & 1 deletion scopehal/NanoVNA.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -119,6 +119,16 @@ class NanoVNA : public virtual SCPIVNA, public virtual CommandLineDriver

public:
static std::string GetDriverNameInternal();
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
#ifdef _WIN32
{"NanoVNA", {{ SCPITransportType::TRANSPORT_UART, "COM<x>:115200:DTR" }}}
#else
{"NanoVNA", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>:115200:DTR" }}}
#endif
};
}
VNA_INITPROC(NanoVNA)
};

Expand Down
4 changes: 2 additions & 2 deletions scopehal/Oscilloscope.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -1018,6 +1018,6 @@ inline Oscilloscope* OscilloscopeChannel::GetScope()
virtual std::string GetDriverName() const override \
{ return GetDriverNameInternal(); }

#define AddDriverClass(T) Oscilloscope::DoAddDriverClass(T::GetDriverNameInternal(), T::CreateInstance)
#define AddDriverClass(T) Oscilloscope::DoAddDriverClass(T::GetDriverNameInternal(), T::CreateInstance); SCPIInstrument::DoAddDriverClass(T::GetDriverNameInternal(), T::GetDriverSupportedModels)

#endif
15 changes: 14 additions & 1 deletion scopehal/OwonXDGFunctionGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -81,6 +81,19 @@ class OwonXDGFunctionGenerator : public virtual SCPIFunctionGenerator

public:
static std::string GetDriverNameInternal();
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
{"Owon XDG 2000", {
{ SCPITransportType::TRANSPORT_LAN, "<ip_address>:3000" },
{ SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
}},
{"Owon XDG 3000", {
{ SCPITransportType::TRANSPORT_LAN, "<ip_address>:3000" },
{ SCPITransportType::TRANSPORT_USBTMC, "/dev/usbtmc<x>" },
}}
};
}
GENERATOR_INITPROC(OwonXDGFunctionGenerator)

protected:
Expand Down
16 changes: 15 additions & 1 deletion scopehal/OwonXDMMultimeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* libscopehal *
* *
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
Expand Down Expand Up @@ -81,6 +81,20 @@ class OwonXDMMultimeter

public:
static std::string GetDriverNameInternal();
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
#ifdef _WIN32
{"Owon XDM1041", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
{"Owon XDM1241", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
{"Owon XDM2041", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}}
#else
{"Owon XDM1041", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
{"Owon XDM1241", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
{"Owon XDM2041", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}}
#endif
};
}
METER_INITPROC(OwonXDMMultimeter)
};

Expand Down
44 changes: 38 additions & 6 deletions scopehal/RidenPowerSupply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,38 @@ RidenPowerSupply::RidenPowerSupply(SCPITransport* transport)
// Read model number
uint16_t modelNumber = ReadRegister(REGISTER_MODEL);
m_model = string("RD") + to_string(modelNumber/10) +"-" + to_string(modelNumber%10);
// Determine current and voltage factor
switch(modelNumber)
{
case 3005:
case 5005:
case 8005:
case 60061:
case 60062:
case 60066:
m_currentFactor = 1000;
m_voltageFactor = 100;
break;
case 60065:
m_currentFactor = 10000;
m_voltageFactor = 100;
break;
case 5015:
case 5020:
case 60121:
case 60181:
case 60241:
m_currentFactor = 100;
m_voltageFactor = 100;
break;
case 60125:
m_currentFactor = 1000;
m_voltageFactor = 1000;
break;
default:
m_currentFactor = 1000;
m_voltageFactor = 100;
}
// Read serial number
uint16_t serialNumber = ReadRegister(REGISTER_SERIAL);
m_serial = to_string(serialNumber);
Expand Down Expand Up @@ -112,28 +144,28 @@ double RidenPowerSupply::GetPowerVoltageActual(int chan)
{
if(chan != 0)
return 0;
return ((double)ReadRegister(REGISTER_V_OUT))/100;
return ((double)ReadRegister(REGISTER_V_OUT))/m_voltageFactor;
}

double RidenPowerSupply::GetPowerVoltageNominal(int chan)
{
if(chan != 0)
return 0;
return ((double)ReadRegister(REGISTER_V_SET))/100;
return ((double)ReadRegister(REGISTER_V_SET))/m_voltageFactor;
}

double RidenPowerSupply::GetPowerCurrentActual(int chan)
{
if(chan != 0)
return 0;
return ((double)ReadRegister(REGISTER_I_OUT))/1000;
return ((double)ReadRegister(REGISTER_I_OUT))/m_currentFactor;
}

double RidenPowerSupply::GetPowerCurrentNominal(int chan)
{
if(chan != 0)
return 0;
return ((double)ReadRegister(REGISTER_I_SET))/1000;
return ((double)ReadRegister(REGISTER_I_SET))/m_currentFactor;
}

bool RidenPowerSupply::GetPowerChannelActive(int chan)
Expand All @@ -147,14 +179,14 @@ void RidenPowerSupply::SetPowerVoltage(int chan, double volts)
{
if(chan != 0)
return;
WriteRegister(REGISTER_V_SET,(uint16_t)(volts*100));
WriteRegister(REGISTER_V_SET,(uint16_t)(volts*m_voltageFactor));
}

void RidenPowerSupply::SetPowerCurrent(int chan, double amps)
{
if(chan != 0)
return;
WriteRegister(REGISTER_I_SET,(uint16_t)(amps*1000));
WriteRegister(REGISTER_I_SET,(uint16_t)(amps*m_currentFactor));
}

void RidenPowerSupply::SetPowerChannelActive(int chan, bool on)
Expand Down
19 changes: 19 additions & 0 deletions scopehal/RidenPowerSupply.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,27 @@ class RidenPowerSupply
REGISTER_ON_OFF = 0x12
};

double m_currentFactor;
double m_voltageFactor;

public:
static std::string GetDriverNameInternal();
static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
{
return {
#ifdef _WIN32
{"Riden RD60xx", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
{"Riden DPS30xx", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
{"Riden DPS50xx", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}},
{"Riden DPS80xx", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}}
#else
{"Riden RD60xx", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
{"Riden DPS30xx", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
{"Riden DPS50xx", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}},
{"Riden DPS80xx", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}}
#endif
};
}
POWER_INITPROC(RidenPowerSupply);
};

Expand Down
Loading