Hameg: Description of Interface Commands
Hameg: Description of Interface Commands
Instruments
RS-232 cable
A 9 conductor serial interface cable (1:1 connection, i.e. without crossed pin connections ) will be required to
connect the oscilloscope to an external instrument.
The RS 232 interface must be initialized before use. This is effected by the first transmission of SPACE CR
(20 hex., 0D hex.) after POWER UP (switching on). This will automatically set the baud rate. The following
baud rates will be recognized:
If the PC has a COM interface with FIFO buffer, then the maximum depth of the send buffer must be set to
8 bytes.
The baud rate set will remain operative until POWER DOWN (switch off) or until the remote mode is disabled
with the command ‘RM0’, or until the pushbutton LOCAL (AUTOSET button) is activated, assuming this is
not inhibited (LK=0).
Once the remote mode is disabled, the data transmission can be only restored by again sending SPACE CR.
If the oscilloscope does not recognize SPACE CR as first characters, or if Low-level exists on the RTS line
longer than for about 2 seconds, then the oscilloscope exits the remote mode and sets the TxD Low for about
0.3s and thus generates a frame error.
The oscilloscope answers with a RETURNCODE (0 CR LF) if it has recognized SPACE CR and has set the
baud rate.
The scope sends ‘ESC RMLK=0’ (ESC=1B hex.) and exits the Remote state if the button LOCAL is activated
in Remote-ON state. The time between the reception of the RETURNCODE Remote-OFF and Remote-ON must
be at least
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Data transmission
After successfully setting the baud rate, the oscilloscope is in Remote state and is ready to accept commands.
The commands can be in capital or lower case. The commands can be divided into two basic groups:
Interrogation of parameters
This group of commands is distinguished by a question mark at the end of the command. When such a command
is transmitted to the scope, it answers by repeating the syntax followed by a colon and the parameters asked for.
These can be binary or ASCII data depending on the command. The number of data bytes to be received is
dependent on the command and can be seen from the command description.
Set parameter
The parameters of the scope can be influenced with this command. Here commands with and without parameter
can be differentiated.
All commands are answered either with parameters or with a RETURNCODE in ASCII format (see description
of commands). One must wait for all parameters or RETURNCODE for the previous command before a new
command can be sent to the scope.
WORD-parameters require first the low byte and then the high byte. The setting of the scope is effected over the
instrument data field (Device Data Field DDF) as binary array. Each byte of this data field can also be accessed
by individual commands.
The following tables show the build up of the instrument data field and the corresponding individual
commands.
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Table of commands:
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
CURCFG? CURCFG: (array) Delivers CURSOR CONFIGURATION
(3.24 (3
Activates and deactivates single cursor functions.
(Bit = 1 activates the function)
1. Byte: D0 frequency f Hz
D1 delta t ∆t s
D2 time cursor CX s
D3 amplitude cursor CY V
D4 amplitude difference ∆Y V
D5 amplitude maximum Y? V
D6 amplitude minimum Y? V
D7 amplitude peak to peak Ypp V
2. Byte: D0 dc voltage Y= V
D1 ac voltage Y˜ V
D2 rms value Y V
D3 – D7 reserved
3. to 6. Byte: reserved
CURCFG= (array) (R CR LF) Sets CURSOR CONFIGURATION
(3.24 (3
1. Byte: 01 frequency f Hz
02 delta t ∆t s
03 time cursor CX s
04 amplitude cursor CY V
05 amplitude difference ∆Y V
06 amplitude maximum Y? V
07 amplitude minimum Y? V
08 amplitude peak to peak Ypp V
09 dc voltage Y= V
0A ac voltage Y˜ V
__
0B rms value Y V
0C voltage CH1 ∆V1 V
0D voltage CH2 ∆V2 V
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
CURSET= (array) (R CR LF) Readout CURSOR SET
(3.09
Activates cursors and sets them for Vpp or period measurement
(depends on bit D10/12 in RODDF). In analog mode only Vpp is
available. The measurement relates to the signal used as the trigger
source.
1. Byte = 00 Cursors are set on the signal used for triggering.
01 to FF reserved
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
HLD<z>POS=(b)(3 (R CR LF) Sets HOLD 1/2 POSITION
LK? LK:(a) Delivers the function of LOCAL LOCK OUT key (AUTO SET)
a = 0: Locked
a = 1: Free (The Remote mode will be exited on activation of the
AUTOSET button and ‘RMLK=0’ will be sent to the
interface)
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
PSY1POS? PSY1POS:(a) Delivers PULSE SWITCH Y 1 POSITION
function of the rotary control: Y-POS. I
a = 0: Y1 Position setting
a = 3: Y Position setting of time base B (Trace sep.) in
alternating time base mode (9
PSCH<z>? PSCH<z>:(a) Delivers PULSE SWITCH CH1/2 function of the rotary control:
VOLTS/DIV (CH I or CH II)
a = 0: CHI or II COARSE (1-2-5 sequence)
a = 1: CHI or II FINE (variable)
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
RDREF<z>: RDREF<z>: READ REFERENCE 1/2
(w w)(3 (7 (W W array) (7 Delivers Signal data from Reference store <z> (1 or 2), from Offset
1st WORD Offset address (first WORD) with given length (second WORD)
hex. (2 Kbytes) Offset + length max. 2 Kbytes
2nd WORD length
hex. (2 Kbytes) See ‘RDWFM<z>’
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
STRMODE? (3 STRMODE:(b) Delivers STORE MODE
see table of instrument fields DDF
TB<x>VAR= (w) (R CR LF) Sets TIMEBASE A/B VAR setting (10 bit)
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
TRGSTA(CR LF) (R CR LF) TRIGGERSTATUS
Reset Automatic mono flop (≈ 200ms)
Enables immediate interrogation with ‘TRGSTA?’.
Weighting :
- WORD 1-3 : ca. 20mV/LSB
- WORD 4 : ca. 5mV/LSB and 250mV/DIV
(2.00:
1st WORD: Positive peak value
2nd WORD: Negative peak value
3rd WORD: Mean arithmetic value
4th WORD: Reserved
array:
1st WORD: Memory address at the time of trigger
2nd WORD: X resolution = 200 bit/DIV
3rd WORD: Y resolution = 25 bit/DIV
4th WORD: Y1 position standardized on the value of
WORD 3 (integer value)
5th WORD: Y2 position standardized on the value of
WORD 3 (integer value)
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Command: Acknowledgment Description
PC -> Scope Scope -> PC
WRREF<z>: (3 (6 (7 (R CR LF) WRITE REFERENCE 1/2
(w w array) writes signal data into the reference store <z> (1 or 2), from offset
1st WORD Offset address (first WORD) with given length (second WORD)
hex. (2 Kbytes) Offset + length max. 2 Kbytes
2nd WORD length
hex. (2 Kbytes) See ‘RDWFM<z>’
All commands will be internally checked for any conflicts and protocolled in RETURNCODE.
The following RETURNCODES (ASCII characters) have been implemented:
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
0 = no error
1 = syntax error
2 = data error
3 = buffer overflow
4 = bad data set
5 = adjustment error
6 = timing error (internal data transmission FC /STORE)
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Instrument data field (DDF)
D7 D6 D5 D4 D3 D2 D1 D0
CH1 GND AC INV1 ON VOLT/DIV - Counter 0-13
HM200x Counter 0 – 11 (1mV/DIV – 5V/DIV)
0000(1mV/DIV)...1101(20V/DIV)
CH2 GND AC INV2 ON VOLT/DIV - Counter 0-13
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Instrument data field 1 (DDF1)
TR A LEV 0 0 0 0 0 0 X X X X X X X X X X
TB A VAR 0 0 0 0 0 0 X X X X X X X X X X
X POS X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
Y2 POS X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
Y1 POS X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
TR B LEV 0 0 0 0 0 0 X X X X X X X X X X
TB B VAR 0 0 0 0 0 0 X X X X X X X X X X
DEL POS X X X X X X X X X X X X X X X X
(4.0 (4.0 (4.0 (4.0 (4.0 (4.0
CURSOR X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
XI
CURSOR X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
X II
CURSOR X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
Y I (11
CURSOR X X X X X X X X X X X X X X X X
(1.1 (1.1 (1.1 (1.1 (1.1 (1.1
Y II (11
(1.05
from FC-Version 1.05
(1.1
from FC-Version 1.10
(1.17
from FC-Version 1.17
(1.19
from FC-Version 1.19
(2.00
from FC-Version 2.00
(2.02
from FC-Version 2.02
(3.0
from FC-Version 2.02
(3.09
from FC-Version 2.02
(3.24
from FC-Version 2.02
(4.0
from FC-Version 2.02
(2
RES = 1 arms the trigger unit in combination with SINGLE and Analog mode
RES = 1 starts a new data recording and arms the trigger unit in combination with SINGLE and Digital
mode
RES = 1 starts a new data recording in Digital mode
(3
Only in Analog / Digital Scope
(4
The data will be loaded in an EEPROM. This consists of only a limited number (≥ 1 000 000) of
programming cycles. Therefore this command should not be used unless absolutely necessary.
(5
This function will be reset after a counter has run down (ca. 5s). Each further output before the end of the
interval sets the counter anew and thus prolongs the time until reset.
(6
The maximum interval permitted between the transmission of each trace byte is 2s, otherwise the scope
will exit the remote state.
(7
Valid for FC-Versions lower 1.05:
For (w w) stands (w,w); comma as ASCII character.
For (w w array) stands (w,w:array); comma and colon as ASCII character.
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
(8
Only HM1507 and HM1507-2
(9
Only for instruments with 2 time bases.
(10
16 Bit INTEGER value in two's complement based on the graticule center (1000 bit/DIV).
Ex. 1: Set Y position to graticule center Output: 0 dec. = 0 hex.
Ex. 2: Set Y position to +1 division Output: 1000 dec. = 3E8 hex.
Ex. 3: Set Y position to -1 division Output: 64536 dec. = FC18 hex.
(11
400 bit/DIV, since FC 2.09: 1000 bit/DIV
(12
only HM40x since FC 3.17 and HM200x
(13
only HM200x
(14
if D9 is set, D10 becomes invalid. Then “CURMOD1?” must be used for Cursor Mode query.
Examples
Some examples, with detailed explanations regarding the command, are given below.
Most of the commands are terminated with CR (ENTER)= 0Dhex and LF = 0Ahex. Also, the scope terminates
each acknowledgment string with these characters.
The command parameters (given in brackets) may be ASCII characters (a), or binary values (b).
BELL=(a)
CH1=(b)
Explanation: This command switches the channel on, with 5mV and AC.
See also byte 1 of DDF.
ERRBP?
RDWFM1:(ww)
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Explanation : Read signal trace from channel 1.
Parameter 2: Number of bytes to be read = 2048 = (08 00) hex. When transmitting word data, note that
the low byte must be output first.
It is possible to read only a part of the acquired signal by transmitting other values for the
start address and the number of bytes to read.
Character sequence
in hex representation: 52 44 57 46 4D 31 3A 00 00 00 08 0D
WFMPRE?
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
Calculating the voltage of the sampled signal form:
With this method it is only possible to evaluate the voltage difference of the acquired signal, since there is no
reference (Zero voltage). In order to calculate the absolute voltage of the sample one should include the Y
position in the calculations.
The deflection coefficient (V/DIV) is obtained from the DDF byte 1 or with the command CH1?.
TRGVAL?
With this command it is possible to evaluate the peak value and the arithmetical mean value of the measured
signal. This is shown in the following example.
Scope setting: Channel 1 on; 5mV deflection sensitivity; DC input coupling; probe 1:1; 1kHz calibration;
probe in the calibration socket; trigger source - channel 1; AC Trigger coupling; Timebase A
set to 200µs; analog mode.
A positive square wave signal with an amplitude of 4 div. can be seen on the oscilloscope display.
Positive and negative peak values are integer values referred to the mean value with the weighting of 1000/div.
Since the trigger amplifier is not calibrated there can be a deviation from the values.
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2
SOURCE FILE: TERM9X_D.TXT /CHEMNITZ /04.DEC.1994
1. Settings
^^^^^^^^^^^^^^^^^
1.1 term90.exe
^^^^^^^^^^^^^^
Under ' Settings \ Interface': Port: Your free serial port, e.g. COM2.
Baud rate: recommended 19200.
Data bits: 8 BITS
Parity: None
Stop bits: 2 BITS
Data exchange: Xon/Xoff to off.
RTS/CTS/ to on.
1.2 term95.exe
^^^^^^^^^^^^^^^
2. Remote control
^^^^^^^^^^^^^^^^
The transmission can be started after all settings have been correctly set,.
Remote On: Enter one after the other a SPACE and ENTER.
The instrument goes into remote mode, which is evident from the Remote LED.
Now you can enter any desired command such as, for example, 'vers?'.
Example: Switch on channel 2 of the instrument and at the same time set it to 5mV.
Enter 'ch2=', press the key "Alt Gr" and simultaneously enter from the number keyboard one
after the other the numbers 0,1 and 8. After releasing the "Alt Gr" key, the instrument will be
set.
The RETURNCODE will be displayed behind the transmitted command.
Interface commands for HM305-2, HM404, HM407, HM1004-2, HM1505-2, HM1507, HM1507-2