Compare commits
1 Commits
62f3a3690e
...
d1486e9df1
| Author | SHA1 | Date | |
|---|---|---|---|
| d1486e9df1 |
@@ -368,6 +368,15 @@ def cmd_integration(meter: Hioki3193, args: argparse.Namespace) -> None:
|
|||||||
print(f"Integrating channels: {status}")
|
print(f"Integrating channels: {status}")
|
||||||
|
|
||||||
|
|
||||||
|
def cmd_degauss(meter: Hioki3193, args: argparse.Namespace) -> None:
|
||||||
|
"""Degauss (demagnetize) current sensor cores."""
|
||||||
|
channels = args.channels if args.channels else [5, 6]
|
||||||
|
items = ",".join(f"I{ch}" for ch in channels)
|
||||||
|
print(f"Degaussing: {items}")
|
||||||
|
meter.write(f":DEMAg {items}")
|
||||||
|
print("Degauss command sent. Wait for the instrument to finish.")
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="HIOKI 3193-10 Power Analyzer GPIB Tool",
|
description="HIOKI 3193-10 Power Analyzer GPIB Tool",
|
||||||
@@ -439,6 +448,10 @@ examples:
|
|||||||
p_int = sub.add_parser("integration", help="Integration control")
|
p_int = sub.add_parser("integration", help="Integration control")
|
||||||
p_int.add_argument("action", choices=["start", "stop", "reset", "status"])
|
p_int.add_argument("action", choices=["start", "stop", "reset", "status"])
|
||||||
|
|
||||||
|
# degauss
|
||||||
|
p_demag = sub.add_parser("degauss", help="Degauss (demagnetize) current sensor cores")
|
||||||
|
p_demag.add_argument("channels", nargs="*", type=int, help="Channel numbers (default: 5 6)")
|
||||||
|
|
||||||
# send
|
# send
|
||||||
p_send = sub.add_parser("send", help="Send raw SCPI/GPIB command")
|
p_send = sub.add_parser("send", help="Send raw SCPI/GPIB command")
|
||||||
p_send.add_argument("raw_command", nargs="+", help="Command string (queries auto-detected by '?')")
|
p_send.add_argument("raw_command", nargs="+", help="Command string (queries auto-detected by '?')")
|
||||||
@@ -455,6 +468,7 @@ examples:
|
|||||||
"efficiency": cmd_efficiency_setup,
|
"efficiency": cmd_efficiency_setup,
|
||||||
"setup-mppt": cmd_setup_mppt,
|
"setup-mppt": cmd_setup_mppt,
|
||||||
"integration": cmd_integration,
|
"integration": cmd_integration,
|
||||||
|
"degauss": cmd_degauss,
|
||||||
"send": cmd_send,
|
"send": cmd_send,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user