Skip to content

YC99T_Controller Command Line User Guide

GENY edited this page Mar 2, 2026 · 1 revision

YC99T_Controller Command Line User Guide

Overview

YC99T_Controller is a command-line tool for controlling YC99T series power quality test sources. It supports device connection via TCP or RS-232 serial port, providing four major functional modules: Three-Phase AC Source (AC3P), Power Source (PWR), Harmonic Source (HRM), and Energy Error Testing (Energy), with both interactive and script execution modes.


Command Line Arguments

YC99T_Controller [connection options] [--script <script_file>]

Connection Options

Option Description Example
--tcp <IP> [port] TCP connection, default port 5888 --tcp 192.168.1.100
--tcp <IP> <port> TCP connection with specified port --tcp 192.168.1.100 5888
--com <port> [baud] Serial connection, default baud 115200 --com COM3
--com <port> <baud> Serial connection with specified baud rate --com COM3 115200
--script <file> Execute script file after startup --script init.txt
--help Display help information

Note: Either --tcp or --com must be specified. If neither is provided, help is displayed and the program exits.

Startup Examples

YC99T_Controller --tcp 192.168.1.100
YC99T_Controller --tcp 192.168.1.100 5888
YC99T_Controller --com COM3
YC99T_Controller --com COM10 115200
YC99T_Controller --tcp 192.168.1.100 --script startup.txt

Operation Modes

Interactive Mode

After successful connection, the program enters interactive mode displaying a > prompt. Enter one command per line and press Enter to execute.

[OK] Connected
YC99T Controller ready. Type "help" for commands, "quit" to exit.
> online
[TX] 7E 02 00 80 00 00 FF B1 FF
[RX] 7E 03 00 00 80 00 00 FF B2 FF
[OK] Online success
>

Script Mode

Use --script <file> parameter to specify a script file. Scripts are plain text files with one command per line.

  • Empty lines are automatically skipped
  • Lines starting with # are comments
  • After script execution completes, the program automatically enters interactive mode

Script Example (startup.txt):

# Power-on initialization
online
speed 5
ac3p test 3F 7 220.0 0.0 7 220.0 -120.0 7 220.0 120.0 9 5.0 0.0 9 5.0 -120.0 9 5.0 120.0 50.0 50.0

Output Format

Each command execution displays communication content and results:

Prefix Meaning
[TX] Raw frame sent to device (hexadecimal)
[RX] Raw frame received from device (hexadecimal)
[OK] Command executed successfully
[ERR] Command failed or device returned error
[DATA] Measurement data read back from device
[WARN] Warning information such as device overload

General Commands

online — Go Online

Puts the device into working state and starts output. This command must be executed before other test commands.

> online
[OK] Online success

offline — Go Offline

Stops device output and enters standby state.

> offline
[OK] Offline success

speed — Set Speed

Sets the output change speed of the signal source, range 1 (slowest) to 10 (fastest).

speed <speed_value>
> speed 5
[OK]

loop — Set Loop State

Controls the connection state of the current loop.

loop <close|open>
Parameter Description
close Close current loop
open Open current loop
> loop close
[OK]

hex — Send Raw Hexadecimal Frame

Directly sends custom hexadecimal byte sequence for debugging. Spaces between hex bytes are optional.

hex <hex_bytes...>
> hex 7E 02 00 80 00 00 FF B1 FF
[TX] 7E 02 00 80 00 00 FF B1 FF
[RX] ...

help — Display Help

> help

quit / exit — Exit

Automatically executes offline, disconnects, and exits the program.

> quit
Goodbye.

AC3P — Three-Phase AC Source

Controls three-phase voltage and current signal source output.


ac3p test — Start Three-Phase Signal Output

Sets and outputs three-phase voltage and current with 6 channels (Ua/Ub/Uc/Ia/Ib/Ic), specifying range, amplitude, and phase for each channel.

ac3p test <enable_flag> \
  <UaR> <UaAmp> <UaPhase> \
  <UbR> <UbAmp> <UbPhase> \
  <UcR> <UcAmp> <UcPhase> \
  <IaR> <IaAmp> <IaPhase> \
  <IbR> <IbAmp> <IbPhase> \
  <IcR> <IcAmp> <IcPhase> \
  <frequency> <Freq2>

Parameter Description:

Parameter Type Description
enable_flag Hex byte Channel enable bitmask, 3F = all 6 channels enabled
UxR / IxR Integer Range code, see table below
UxAmp / IxAmp Float Output amplitude (V or A)
UxPhase / IxPhase Float Output phase (degrees)
frequency Float Fundamental frequency (Hz)
Freq2 Float Second frequency (Hz)

Voltage Range (UxR):

Value Range
6 100V
7 220V
8 380V
9 660V (3C model only)

Current Range (IxR):

Value Range
7 50mA
8 200mA
9 1A
10 5A
11 16.667A (3C) / 20A (5C)
12 50A (3C) / 100A (5C)

Number Format: Integers can be decimal (220), hexadecimal ($DC or DCH).

Typical Three-Phase Balanced Output Example (220V/5A, 50Hz):

> ac3p test 3F 7 220.0 0.0 7 220.0 -120.0 7 220.0 120.0 10 5.0 0.0 10 5.0 -120.0 10 5.0 120.0 50.0 50.0
[OK]

ac3p adjust — Fine-Tune Single Channel

Fine-tunes amplitude or phase of a specified channel based on current output.

ac3p adjust <channel> <amp|phase> <value>

Channel Names:

Parameter Channel
ua Phase A voltage
ub Phase B voltage
uc Phase C voltage
ia Phase A current
ib Phase B current
ic Phase C current
freq Fundamental frequency
freq2 Second frequency
> ac3p adjust ua amp 221.5
[OK]
> ac3p adjust ia phase -1.5
[OK]

ac3p read — Read Current Output Data

Reads actual three-phase voltage and current measurement values from the device.

ac3p read <once|cont|stop>
Parameter Description
once Read once and stop
cont Continuous reading, press Enter to stop
stop Stop continuous reading

once Output Example:

> ac3p read once
[DATA] Ua=220.00V 0.00°  Ub=219.98V -120.01°  Uc=220.02V 120.00°
[DATA] Ia=5.000A 0.00°  Ib=5.001A -120.00°  Ic=4.999A 120.01°
[DATA] Freq=50.000Hz  Freq2=50.000Hz

ac3p stop — Stop Output Immediately

> ac3p stop
[OK]

PWR — Power Source

Controls single-phase or three-phase power source output, supporting active/reactive power testing.


pwr test — Start Power Output

pwr test <PowerSel> <ElemSel> <UR> <UAmp> <IR> <IAmp> <PF> <L|C|N> <frequency>

Parameter Description:

Parameter Type Description
PowerSel Integer Power type, see table below
ElemSel Integer Element selection, see table below
UR Integer Voltage range (same as AC3P range table)
UAmp Float Voltage amplitude (V)
IR Integer Current range (same as AC3P range table)
IAmp Float Current amplitude (A)
PF Float Power factor value
L/C/N Letter Power factor nature: L=inductive, C=capacitive, N=resistive
frequency Float Frequency (Hz)

PowerSel (Power Type):

Value Type
0 3-phase 4-wire active (3P4W)
1 3-phase 3-wire active (3P3W)
2 Single-phase active (1P)
3 3-phase 4-wire reactive
4 3-phase 3-wire reactive
5 2-element 60° reactive
6 2-element 90° reactive
7 3-element 90° reactive

ElemSel (Element Selection):

Value Selection
0 All (ALL)
1 Phase A
2 Phase B
3 Phase C

Example (3P4W active, all elements, 220V/5A, PF=1.0, 50Hz):

> pwr test 0 0 7 220.0 10 5.0 1.0 N 50.0
[OK]

Example (Single-phase active, Phase A, 220V/1A, PF=0.8 inductive, 50Hz):

> pwr test 2 1 7 220.0 9 1.0 0.8 L 50.0
[OK]

pwr adjust — Fine-Tune Power Parameters

pwr adjust <volt|curr|power|pf> <value> [L|C|N]
Parameter Description
volt Fine-tune voltage amplitude
curr Fine-tune current amplitude
power Fine-tune power value
pf Fine-tune power factor (can append L/C/N)
> pwr adjust volt 221.0
[OK]
> pwr adjust pf 0.85 L
[OK]

pwr read — Read Power Measurement Data

pwr read <once|cont|stop>

once Output Example:

> pwr read once
[DATA] Ua=220.00V 0.00°  Ia=5.000A 0.00°  Pa=1100.000W  Qa=0.000VAR
[DATA] Ub=220.00V -120.00°  Ib=5.000A -120.00°  Pb=1100.000W  Qb=0.000VAR
[DATA] Uc=220.00V 120.00°  Ic=5.000A 120.00°  Pc=1100.000W  Qc=0.000VAR
[DATA] P=3300.000W  Q=0.000VAR

pwr stop — Stop Power Output

> pwr stop
[OK]

HRM — Harmonic Source

Controls harmonic superposition output, adding specified harmonic components on top of the fundamental wave.


hrm test — Start Harmonic Output

Sets fundamental wave parameters (same format as ac3p test, but without Freq2). Harmonic components are configured via advanced hex command method or inherited from device internal settings.

hrm test <enable_flag> \
  <UaR> <UaAmp> <UaPhase> \
  <UbR> <UbAmp> <UbPhase> \
  <UcR> <UcAmp> <UcPhase> \
  <IaR> <IaAmp> <IaPhase> \
  <IbR> <IbAmp> <IbPhase> \
  <IcR> <IcAmp> <IcPhase> \
  <frequency>

Parameters have the same meaning as ac3p test, except there is only one frequency parameter (no Freq2).

Example:

> hrm test 3F 7 220.0 0.0 7 220.0 -120.0 7 220.0 120.0 10 5.0 0.0 10 5.0 -120.0 10 5.0 120.0 50.0
[OK]

hrm read — Read Harmonic Measurement Data

hrm read <once|cont|stop>

once Output Example:

> hrm read once
[DATA] Ua fund=220.00V 0.00°  DC=0.000  THD=2.100%
[DATA] Ub fund=219.98V -120.01°  DC=0.000  THD=2.098%
[DATA] Uc fund=220.02V 120.00°  DC=0.000  THD=2.102%
[DATA] Ia fund=5.000A 0.00°  DC=0.000  THD=1.500%
[DATA] Ib fund=5.001A -120.00°  DC=0.000  THD=1.498%
[DATA] Ic fund=4.999A 120.01°  DC=0.000  THD=1.501%
[DATA] Freq=50.000Hz
[DATA]   Harmonic ch=01 n=3  amp=4.620  phase=0.00°
[DATA]   Harmonic ch=01 n=5  amp=2.200  phase=0.00°

hrm stop — Stop Harmonic Output

> hrm stop
[OK]

energy — Energy Error Testing

Used for energy meter error verification, outputs stable power signal and counts error pulses.


energy test — Start Energy Error Test

energy test <PowerSel> <ElemSel> <UR> <UAmp> <IAmp> <PF> <L|C|N> <frequency> <meter_const> <calib_cycles>

Parameter Description:

Parameter Type Description
PowerSel Integer Power type (same as pwr, 0~7)
ElemSel Integer Element selection (same as pwr, 0~3)
UR Integer Voltage range
UAmp Float Voltage amplitude (V)
IAmp Float Current amplitude (A)
PF Float Power factor
L/C/N Letter Power factor nature
frequency Float Frequency (Hz)
meter_const Float Energy meter pulse constant (imp/kWh)
calib_cycles Integer Calibration pulse cycles (1~65535)

Example (3P4W active, 220V/5A, PF=1.0, 50Hz, 3200imp/kWh, 10 cycles):

> energy test 0 0 7 220.0 5.0 1.0 N 50.0 3200.0 10
[OK]

energy adjust — Fine-Tune Energy Test Parameters

energy adjust <volt|curr|pf> <value> [L|C|N]
> energy adjust volt 220.5
[OK]

energy read — Read Power Measurement Data

Same format as pwr read, used to monitor real-time power output values during testing.

energy read <once|cont|stop>

energy error — Trigger Error Calculation

After sending start, the device completes calibration cycle counting and returns error results for each meter.

energy error <start|stop>

start Output Example:

> energy error start
[DATA] Energy errors:  Meter1=0.0312%  Meter2=0.0287%  Meter3=0.0341%

Error result meaning:

  • Meter1 / Meter2 / Meter3: Relative error (%) of three energy meters
  • Only displays meter data corresponding to valid flag bits (ValidFlag)

energy stop — Stop Energy Test

> energy stop
[OK]

Parameter Value Format

Integer parameters support the following three formats:

Format Example Description
Decimal 220 Regular number
Hexadecimal ($prefix) $DC Delphi/Pascal style
Hexadecimal (H suffix) DCH or dch Case insensitive

Floating-point numbers can use decimal point (.) or comma (,), such as 220.0 or 220,0.


Communication Protocol

YC99T_Controller uses a proprietary binary frame protocol with the following structure:

SOI(1) + LEN(4LE) + CMD_TYPE(1) + CMD_CODE(1) + DATA(N) + CRC16(2LE) + EOI(1)
  • SOI: Frame header 0x7E
  • LEN: Little-endian 32-bit unsigned integer, value = 2 + data length
  • CMD_TYPE: Fixed 0x00 (request direction)
  • CMD_CODE: Command code (e.g., 0x80 = online, 0xA0 = AC3P test)
  • CRC16: MODBUS CRC16 (polynomial 0x8005, init 0xFFFF, input/output reflected), covers CMD_TYPE + CMD_CODE + DATA
  • EOI: Frame tail 0xFF

Error Handling

Situation Output Description
Device returns non-zero error code [ERR] Device error code: 0xXX Device rejected command
Receive timeout (3 seconds) [ERR] Receive timeout Device not responding
Frame verification failed [ERR] CRC mismatch Communication interference
Command parameter error [ERR] Unknown ... Command format incorrect
Overload warning [WARN] Overload: Ua Ib ... Corresponding channels overloaded

Complete Operation Flow Examples

Three-Phase Active Power Standard Output

> online
[OK] Online success
> speed 5
[OK]
> loop close
[OK]
> ac3p test 3F 7 220.0 0.0 7 220.0 -120.0 7 220.0 120.0 10 5.0 0.0 10 5.0 -120.0 10 5.0 120.0 50.0 50.0
[OK]
> ac3p read once
[DATA] Ua=220.00V 0.00°  Ub=219.99V -120.00°  Uc=220.01V 120.00°
[DATA] Ia=5.000A 0.00°  Ib=5.000A -120.00°  Ic=5.000A 120.00°
[DATA] Freq=50.000Hz  Freq2=50.000Hz
> ac3p stop
[OK]
> offline
[OK] Offline success

Energy Meter Error Verification

> online
[OK] Online success
> energy test 0 0 7 220.0 5.0 1.0 N 50.0 3200.0 10
[OK]
> energy error start
[DATA] Energy errors:  Meter1=0.0312%  Meter2=-0.0156%
> energy stop
[OK]
> offline
[OK] Offline success

Clone this wiki locally