Digital Storage Oscilloscope: GDS-806/810/820/840 Programming Manual
Digital Storage Oscilloscope: GDS-806/810/820/840 Programming Manual
Digital Storage Oscilloscope: GDS-806/810/820/840 Programming Manual
Programming Manual
0
GDS-806/810/820/840 Programming Manual
1. INTRODUCTION................................................................................................................... 2
5. STATUS REPORTS............................................................................................................ 71
E-mail - marketing@goodwill.com.tw
http://www.goodwill.com.tw
1
GDS-806/810/820/840 Programming Manual
1. Introduction
Users can drive this digital storage oscilloscope by using the GPIB (General
Purpose Interface Bus) system with a computer, or from a computer across the
RS-232 serial connection. Commands sent over either interface can read or set
any GDS-806/810/820/840’s instructions. This chapter explains how to carry out
the following tasks.
If you are setting up the oscilloscope with a GPIB system, please check the
following regulations:
z Each device on the bus needs a unique device address. No two devices can
share the same device address.
z Turn on at least two-thirds of the devices on the GPIB system while you use
the system.
z Do not use loop or parallel structure for the topology of GPIB system.
2
GDS-806/810/820/840 Programming Manual
Pin Assignments
The pin assignments for RS-232 interface of the oscilloscope are listed below.
1. No connection
2. Receive Data(RxD) (input)
3. Transmit Data(TxD) (output)
4. No connection
5. Signal Ground (GND)
6. No connection
7. No connection
8. No connection
9. No connection
Figure 1-1: Pin assignments for the RS232 connector
The wiring configuration is used for computer with DB9 connectors that configured
as Data Terminal Equipment.
Computer
Oscilloscope
(DB9, DTE)
(DB9, DTE)
Pin2 Pin2
Pin3 Pin3
Pin5 Pin5
3
GDS-806/810/820/840 Programming Manual
When the oscilloscope is set up with a RS-232 interface, please check the
following points:
z Do not connect the output line of one DTE device to the output line of the
other.
z Many devices require a constant high signal on one or more input pins.
z Ensure the same configurations are used on the device as the one used
on PC terminal.
z Ensure the connector for the both side of cable and the internal
connected line are met the demand of the instrument.
A personal computer with a COM port is the essential facilities in order to operate
the digitizing oscilloscope via RS-232 interface.
II. Connect the other end of the cable to the RS-232 port on the oscilloscope.
Figure 1-3, shows the GPIB port and RS-232 port’s locations on the rear panel of
the oscilloscope.
4
GDS-806/810/820/840 Programming Manual
5
GDS-806/810/820/840 Programming Manual
2. Computer’s Connection
A personal computer with a GPIB card is the essential stuff in order to operate the
oscilloscope via GPIB interface.
II. Connect the other end of the GPIB cable to the GPIB port on the Oscilloscope.
6
GDS-806/810/820/840 Programming Manual
SR1 (Service Request): The oscilloscope asserts the SRQ (Service request)
line to notify the controller when it requires service.
DC1 (Device Clear): The oscilloscope has Device clear capability to return
the device to power on status.
z Press the UTILITY button on the front panel. The utility menu provides
Interface Menu sub menu by pressing F2 softkey which GPIB sub menu is
included. Press F1 softkey to select GPIB setting menu.
7
GDS-806/810/820/840 Programming Manual
If you want to test the GPIB connection is whether working or not, use the National
Instrument’s “Interactive Control utility” for instance, you communicate with the
GPIB devices through calls you interactively type in at the keyboard.
The Interactive Control can help you to learn about the instrument and to
troubleshoot problems by displaying the following information on your screen after
you enter a command:
z Mnemonic value of the error variable (iberr) if an error exists (the ERR bit is
set in ibsta)
You can access online help in Interactive Control by entering help at the prompt, or
you can get help on a specific function by entering help <function> at the prompt,
where <function> is the name of the function for which you want help.
2. Open either a board handle or device handle to use for further NI-488.2 calls.
Use ibdev to open a device handle, ibfind to open a board handle, or the set
488.2 command to switch to a 488.2 prompt.
8
GDS-806/810/820/840 Programming Manual
The following example uses ibdev to open a device, assigns it to access board
gpib0, chooses a primary address of 7 with no secondary address, sets a timeout
of 10 seconds, enables the END message, and disables the EOS mode.
:ibdev
enter board index: 0
enter primary address: 7
enter secondary address: 0
enter timeout: 13
enter ‘EOI on last byte’ flag: 1
enter end-of-string mode/byte: 0
ud0:
Note: If you type a command and no parameters, Interactive Control prompts you
for the necessary arguments. If you already know the required arguments, you can
type them at the command prompt, as follows:
:ibdev 0 7 0 13 1 0
ud0:
Note: If you do not know the primary and secondary address of your GPIB
instrument, right-click on your GPIB interface in Measurement & Automation
Explorer and select Scan for Instruments. After Explorer scans your interface, it
displays your instrument address in the right window panel.
3. After you successfully complete ibdev, you have a ud prompt. The new
prompt, ud0, represents a device-level handle that you can use for further
NI-488.2 calls. To clear the device, use ibclr, as follows:
ud0: ibclr
[0100] (cmpl)
9
GDS-806/810/820/840 Programming Manual
5. To read data from your device, use ibrd. The data that is read from the
instrument is displayed. For example, to read 28 bytes, enter the following:
ud0: ibrd 28
[0100] (cmpl)
count: 28
47 57 2C 20 47 44 53 2D GW, GDS-
38 32 30 2C 20 50 39 32 820, P92
30 31 33 30 2C 20 56 2E 0130, V.
31 2E 30 39 1.09
6. When you finish communicating with the device, make sure you put it offline
using the ibonl command, as follows:
ud0: ibonl 0
[0100] (cmpl)
:
The ibonl command properly closes the device handle and the ud0 prompt is no
longer available.
If you do not receive a proper response from the oscilloscope, please check the
power is on, the GPIB address is correct, and all cable connections are active,
10
GDS-806/810/820/840 Programming Manual
If you want to test whether the RS-232 connection is working or not, you can send
a command from computer. For instance, using a terminal program send the query
command
*idn?
should return the Manufacturer, model number, serial number and firmware
version in the following format:
GW,GDS-820,P920130,V.2.01
If you do not receive a proper response from the oscilloscope, please check if the
power is on, the RS-232 configurations are the same on both sides, and all cable
connections are active.
11
GDS-806/810/820/840 Programming Manual
This oscilloscope can be operated from computer via the GPIB port or RS-232 port.
The remote commands of this oscilloscope are compatible with IEEE-488.2 and
SCPI standards partially.
SCPI
SCPI
Interface Function
D C B A A B C D
12
GDS-806/810/820/840 Programming Manual
As shown in the figure 3-1, the IEEE-488.1 standard locates at layer A, the layer A
is belonged to the protocol of interface function on the GPIB bus. The source
handshake (SH), acceptor handshake (AH) and talker are included in this layer (10
interface functions totally).
At layer B, the syntax and data structure could be the essence of entire
IEEE-488.2 standard. The syntax defines the function of message communication,
which contain the <PROGRAM MESSAGE> (or simply “commands”) and
<RESPONSE MESSAGE>. The two kinds of messages are represented the
syntax formation of device command and return value. The data structure is the
constitution of status reporting, which IEEE-488.2 standard have been defined.
The common commands and queries are included with layer C. Commands and
queries can be divided into two parts: mandatory and optional. Commands modify
control settings or tell the instrument to perform a specific action. Queries cause
the instrument to send data or status information back to the computer. A question
mark at the end of a command identifies it as a query.
Layer D is interrelated with device information. Different devices have different
functions. SCPI command sets are belonged to this layer.
Command Syntax
If you want to transfer any of the instructions to an instrument, and comply with
SCPI, there are three basic elements must be included.
z Command header
13
GDS-806/810/820/840 Programming Manual
Command Header
:DELay :SLOP ?
Lower-
level
nodes
:TIMe ? :TYPe
The top level of the tree is the root level. A root node is located at the root level. A
root node and one or more lower-level nodes form a header path to the last node
called the leaf node.
The command header is configured by header path and leaf node. Figure 3-3
shows the command header for the leaf node.
:TRIGger:DELay:EVENt ?
Root Node
Command Header
14
GDS-806/810/820/840 Programming Manual
Parameter
If the command has parameters, the values have to be included. In this manual,
when we expressed the syntax of the command, the < > symbols are used for
enclosing the parameter type. For instance, the syntax of the command in Figure
8-5 includes the Boolean parameter type
NOTE: Do not include the <, >, or | symbols when entering the actual value
for a parameter.
:TRIGger:DELay:MODe <Boolean>
Parameter
Type
Space
Table 3-1 defines the Boolean and other parameter types for the oscilloscope.
NR1 Integers 0, 1, 18
15
GDS-806/810/820/840 Programming Manual
For the actual value of the parameter type <Boolean>, you have to enter 0 instead
of “OFF” or enter 1 instead of “ON”.
The following example includes both the header and a value for the parameter
type:
:TRIGger:NREJ 0
Parameter values that appeared in this manual are often separated by a vertical
line. This vertical line means the same thing as the word "or," For example, values
for the parameter <Boolean> are
0|1
This is the same thing as saying "0 (off) or 1 (on)" Any single value is a valid
parameter.
In accordance with IEEE 488.2 standard, this oscilloscope accepts any of the
following message terminators:
A semicolon separates one command from another when the commands appear
on the same line.
16
GDS-806/810/820/840 Programming Manual
Entering Commands
The standards that govern the command set for this oscilloscope allow for a
certain amount of flexibility when you enter commands. For instance, you can
abbreviate many commands or combine commands into one message that you
send to the oscilloscope. This flexibility, called friendly listening, saves
programming time and makes the command set easier to remember and use.
Command Characters
This oscilloscope is not sensitive to the case of command characters. You can
enter commands in either uppercase or lowercase.
You can precede any command with white space characters. You must, however,
use at least one space between the parameter and the command header.
Abbreviating Commands
Most commands have a long form and a short form. The listing for each command
in this section shows the abbreviations in upper case. For instance, you can enter
the query
:TIMebase:SCALe ?
simply as
:TIM:SCAL ?
17
GDS-806/810/820/840 Programming Manual
Combining Commands
You can use a semicolon (;) to combine commands and queries. This oscilloscope
executes coherent commands in the order it receives them. When you coherent
queries, the oscilloscope will combine the responses into a single response
message. For example, if the frequency and amplitude of the signal are equal to
100kHz and 1V, the command
:MEASure:FREQuency?;:MEASure:VAMPlitude?
100kHz 1v
18
GDS-806/810/820/840 Programming Manual
Clears all event status data register. This includes the Output Queue, Operation
Event Status Register, Questionable Event Status Register, and Standard Event
Status Register.
Syntax
*CLS
Examples
*ESE
Sets or returns the bits in the Event Status Enable Register (ESER). The ESER
enables the Standard Event Status Register (SESR) to be summarized on bit 5
(ESB) of the Status Byte Register (SBR).
Syntax
*ESE<NR1>
*ESE?
Arguments
<NR1> is a number from 0 to 255. The binary bits of the ESER are set according
to this value.
Returns
<NR1> is a number from 0 to 255 that indicates the decimal value of the binary
bits of the ESER.
19
GDS-806/810/820/840 Programming Manual
Examples
If the ESER contains the binary value 1000 0010, the *ESE? will return the value
of 130.
Returns and clears the contents of the Standard Event Status Register (SESR).
Syntax
*ESR?
Returns
<NR1> is a number from 0 to 255 that indicates the decimal value of the binary
bits of the ESER.
Examples
If the ESER contains the binary value 1100 0110, the *ESR? will return the value
of 198.
Syntax
*IDN?
Examples
*IDN?
20
GDS-806/810/820/840 Programming Manual
Syntax
*LRN?
Returns
*OPC?
The command form (*OPC) sets the operation complete bit (bit 0) in the Standard
Event Status Register (SESR) when all pending operations finish.
The query form (*OPC?) tells the oscilloscope to place an ASCII 1 in the Output
Queue when the oscilloscope completes all pending operations.
Syntax
*OPC
*OPC?
Returns
21
GDS-806/810/820/840 Programming Manual
*RCL
Recall the setting data from memory which previous saved. The settings of RS-232
(or GPIB) can be stored in memory of M1~M15. However, if users recall the stored
memory which the settings of RS-232 or GPIB are different with present settings,
the RS-232 (or GPIB) settings will keep with the present situation. The RS-232 (or
GPIB) settings will not to be influenced by the recall setting of RS-232 (or GPIB)
for this moment.
Syntax
*RCL <NR1>
Arguments: 1~15
Examples
*RCL 1 recalls the setting data which located at first position of memory address.
Sets all control settings of oscilloscope to their default values but does not purge
stored setting.
Syntax
*RST
*SAV
Syntax
*SAV <NR1>
Arguments
1~15
Examples
*SAV 2 saves the setting data to the second position of memory queue.
22
GDS-806/810/820/840 Programming Manual
*SRE
Setup the contents of the Service Request Enable Register (SRER). The query
form returns the contents of the SRER. Bit 6 of the SRER is always zero. The bits
on the SRER correspond to the bits on the SBR.
Syntax
*SRE <NR1>
*SRE?
Arguments
Returns
<NR1>
Examples
Query of the Status Byte register (SBR) with *STB? will return a decimal number
representing the bits that are set (true) in the status register.
Syntax
*STB?
Returns
<NR1>
Examples
23
GDS-806/810/820/840 Programming Manual
Syntax
*WAI
:ACQuire:AVERage
Select the average number of waveform acquisition. The range for averaging is
from 2 to 256 in powers of 2.
Syntax
:ACQuire:AVERage {1|2|3|4|5|6|7|8}
:ACQuire:AVERage?
Arguments
Returns
<NR1>
24
GDS-806/810/820/840 Programming Manual
:ACQuire:LENGth
Select the number of record length. This oscilloscope provides record length of
500, 1250, 2500, 5000, 12500, 25000, 50000, and 125000.
Syntax
:ACQuire:LENGth {0|1|2|3|4|5|6|7}
:ACQuire:LENGth?
Arguments
Returns
<NR1>
:ACQuire:MODe
Select the waveform acquisition mode. There are four different acquisition mode:
sample, peak detection, average and accumulate.
Syntax
:ACQuire:MODe {0|1|2}
:ACQuire:MODe?
Arguments
Returns
<NR1>
Note: Please select the specific acquire mode before implement any acquisition.
25
GDS-806/810/820/840 Programming Manual
:ACQuire<X>:MEMory? (query only) (Available for firmware 2.03 and above only)
Transfer the total waveform data from the acquisition memory. (The memory
capacity can be selected as 500, 1250, 2500, 5000, 12500, 25000, 50000, or
125000 points. See Page 25 for details.)
Syntax
:ACQuire<X>:MEMory?
Arguments
<X>→Specify the channel number (1|2)
Returns
The string of data is following.
# Data size digit Data size Sample rate Channel indicator Reserved data Waveform data
Data size digit: Indicate the digits of following data string amount (1 digit).
Data size: the amount of current data string (4, 5, or 6 digits). Next table lists the
relations between data size digit, data size and record length.
26
GDS-806/810/820/840 Programming Manual
Sample Rate: Indicates the corresponding sample rate of received waveform data
(4 bytes). The sample rate is indicated by floating point format which compatible
with IEEE 754 standards.
Note: This block uses little-endian byte ordering. See Appendix A for more
conversion information
Channel indicator: Show the channel which sent the waveform data (1 byte).
Waveform data: Depends on the specify record length, the effective waveform
data which covers 500 points (1000 bytes), 1250 points (2500 bytes), 2500 points
(5000 bytes), 5000 points (10000 bytes), 12500 points (25000 bytes), 25000 points
(50000 bytes) , 50000 points (100000 bytes) or 125000 points (250000 bytes).
Each point is composed by two bytes (the integer value of 16 bits). The high byte
(MSD) will be prior transferred.
Example 1
Transfer the waveform data (sample rate = 100MSa/s) of channel 1 at 250000
points record length:
Note: Please select the specific memory length before implement any acquisition.
See explanation for “:ACQuire:LENGth”.
27
GDS-806/810/820/840 Programming Manual
Transfer the displayed waveform data (always 500 points data totally) from the
oscilloscope. Each point is composed by two bytes (the integer value of 16 bits).
The high byte (MSD) will be prior transferred.
Syntax
:ACQuire<X>:POINt
Arguments
<X>→Specify the channel number (1|2)
Returns
The string of data is following.
# Data size digit Data size Horizontal Channel indicator Waveform data size Waveform data
scale
Data size digit: Indicate the digits of following data string amount (1 digit).
Channel indicator: Show the channel which sent the waveform data.
Waveform data size: The total amounts indicator of waveform data (4 bytes).
Waveform data: The effective waveform data which covers 500 points (1000
bytes) totally
Example
Transfer the waveform data of channel 1 at 250μs per division:
:ACQuire1:POINt , the oscilloscope will return the following messages:
28
GDS-806/810/820/840 Programming Manual
:AUToset
Syntax
:AUToset
:CHANnel<X>:BWLimit
Syntax
:CHANnel<X>:BWLimit {0|1}
:CHANnel<X>:BWLimit?
Arguments
Returns <NR1>
:CHANnel<X>:COUPling
Syntax
:CHANnel<X>:COUPling {0|1|2}
:CHANnel<X>:COUPling?
Arguments
<X>→Specify the channel number (1|2)
Returns
<NR1>
29
GDS-806/810/820/840 Programming Manual
:CHANnel<X>:DISPlay
Syntax
:CHANnel<X>:DISPlay {0|1}
:CHANnel<X>:DISPlay?
Arguments
Returns
<NR1>
:CHANnel<X>:INVert
Syntax
:CHANnel<X>:INVert {0|1}
:CHANnel<X>:INVert?
Arguments
Returns
<NR1>
30
GDS-806/810/820/840 Programming Manual
:CHANnel<X>:MATH
Syntax
:CHANnel<X>:MATH {0|1|2|3}
Arguments
Returns
<NR1>
:CHANnel<X>:OFFSet
Syntax
:CHANnel<X>:OFFSet <NR3>
:CHANnel<X>:OFFSet?
Arguments
Offset Range:
31
GDS-806/810/820/840 Programming Manual
Next table shows the relationship between the <NR3> value and matching offset
voltage.
Returns
<NR3>
:CHANnel<X>:PROBe
Syntax
:CHANnel<X>:PROBe {0|1|2}
:CHANnel<X>:PROBe?
Arguments
Returns
<NR1>
32
GDS-806/810/820/840 Programming Manual
:CHANnel<X>:SCALe
Syntax
:CHANnel<X>:SCALe <NR3>
:CHANnel<X>:SCALe?
Arguments
<NR3> is the desired gain value in volts per division. The range is 2mV/div to
5V/div (with 1X probe).
Next table shows the relationship between the <NR3> value and matching scale.
Returns
<NR3>
Examples
33
GDS-806/810/820/840 Programming Manual
:CURSor:X<X>Position
Syntax
:CURSor:X<X>Position <NR1>
:CURSor:X<X>Position?
Arguments
<NR1> is the desired position. For x-axis operation, the range is 1 to 249; for y-axis
operation, the range is 1 to 199.
Returns
<NR1>
CURSor:Y<X>Position
Select the cursors position of Y axis.
Syntax
:CURSor:Y<X>Position <NR1>
:CURSor:Y<X>Position?
Arguments
<NR1> is the desired position. For x-axis operation, the range is 1 to 249; for y-axis
operation, the range is 1 to 199.
Returns
<NR1>
34
GDS-806/810/820/840 Programming Manual
Return the time or voltage diversity between the two vertical or horizontal cursors.
Syntax
:CURSor:XDELta?
:CURSor:YDELta?
Arguments
<NR3>
:CURSor:XDISplay
Syntax
:CURSor:XDISplay {0|1}
Arguments
:CURSor:YDISplay
Enable or disable the cursors display for Y axis.
Syntax
:CURSor:YDISplay {0|1}
Arguments
0→Disable cursors display 1→Enable cursors display
Returns
<NR1>
35
GDS-806/810/820/840 Programming Manual
:CURSor:SOURce
Syntax
:CURSor:SOURce {1|2|3}
:CURSor:SOURce?
Arguments
Returns
<NR1>
:DISPlay:ACCumulate
Syntax
:DISPlay:ACCumulate {0|1}
:DISPlay:ACCumulate?
Arguments
Returns
<NR1>
36
GDS-806/810/820/840 Programming Manual
:DISPlay:CONTrast
Select contrast level of LCD screen for data readout and waveform displays.
Syntax
:DISPlay:CONTrast <NR1>
:DISPlay:CONTrast?
Arguments
<NR1> is the desired brightness level. The range is from 0~20 (0% to 100%).
Returns
<NR1>
:DISPlay:GRATicule
Syntax
:DISPlay:GRATicule {0|1|2}
:DISPlay:GRATicule?
Arguments
Returns
<NR1>
37
GDS-806/810/820/840 Programming Manual
:DISPlay:WAVeform
Syntax
:DISPlay:WAVeform <0|1>
:DISPlay:WAVeform?
Arguments
Returns
<NR1>
Clear the total and failure counter value on the screen. This command is equal to
the function key “F5” of GO/NO-GO template edit menu.
Syntax
:GONogo:CLEar
Examples
38
GDS-806/810/820/840 Programming Manual
Syntax
:GONogo:EXECute {0|1}
:GONogo:EXECute?
Arguments
Returns
<NR1>
This command is used to initialize or relieve the GO/NO-GO function. Before the
GO/NO-GO comparison is started. This command must be executed to enable the
comparison unit. This command is equal to the function key “F4” of GO/NO-GO
menu.
Syntax
:GONogo:FUNCtion {0|1}
:GONogo:FUNCtion?
Arguments
Returns
<NR1>
39
GDS-806/810/820/840 Programming Manual
:GONogo:NGCount? (query only) (Available for firmware 2.0 and above only)
Syntax
:GONogo:NGCount?
Returns
<NR1>
Sets and query the user-defined NO-GO conditions. This command is equal to
the function key “F4” pressing for UTILITY menu of second page.
Syntax
:GONogo:NGDefine {0|1}
:GONogo:NGDefine?
Arguments
Returns
<NR1>
40
GDS-806/810/820/840 Programming Manual
Sets and query the user-defined GO/NO-GO comparison source channel. This
command is equal to the function key “F2” pressing of GO/NO-GO menu.
Syntax
:GONogo:SOURce {0|1}
:GONogo:SOURce?
Arguments
Returns
<NR1>
Sets and query the user-defined GO/NO-GO violation conditions. This command is
equal to the function key “F3” pressing of GO/NO-GO menu.
Syntax
:GONogo:VIOLation {0|3}
:GONogo:VIOLation?
Arguments
Returns
<NR1>
41
GDS-806/810/820/840 Programming Manual
Return the value of timing measurement that taken for falling edge of the first pulse
in the waveform.
Syntax
:MEASure:FALL?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:MEASure:FREQuency?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Return the value of timing measurement of the first negative pulse in the
waveform.
Syntax
:MEASure:NWIDth?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
42
GDS-806/810/820/840 Programming Manual
Return the ratio of the positive pulse width to the signal period.
Syntax
:MEASure:PDUTy?
Returns
<NR2>. is the percentage of ratio. The range is from 1 to 99.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:MEASure:PERiod?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
43
GDS-806/810/820/840 Programming Manual
Return the value of timing measurement of the first positive pulse in the waveform.
Syntax
:MEASure:PWIDth?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Return the value of timing measurement that taken for rising edge of the first pulse
in the waveform.
Syntax
:MEASure:RISe?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
44
GDS-806/810/820/840 Programming Manual
:MEASure:SOURce
Select the measured channel (channel 1 or 2). The default setting of measured
channel is channel one.
Note: Please select the specific channel before implement any measurement.
Syntax
:MEASure:SOURce {1|2}
Arguments
Returns
<NR1>.
Syntax
:MEASure:VAMPlitude?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
45
GDS-806/810/820/840 Programming Manual
Syntax
:MEASure:VAVerage?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:MEASure:VHI?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:MEASure:VLO?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
46
GDS-806/810/820/840 Programming Manual
Syntax
:MEASure:VMAX?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:MEASure:VMIN?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:MEASure:VPP?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
47
GDS-806/810/820/840 Programming Manual
:MEASure:VRMS?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See
explanation for “:MEASure:SOURce”
Syntax
:REFResh
Refresh the waveform data of LCD screen and re-display the waveform data.
Syntax
:REFResh
:RUN
Controls the RUN state of trigger system. The acquisition cycle will follow each
qualified trigger in the RUN state.
Syntax
:RUN
:STOP
Controls the STOP state of trigger system. The acquisition cycle only triggered
when the :RUN command is received.
Syntax
:STOP
48
GDS-806/810/820/840 Programming Manual
:SYSTem:UNLock
The front panel keyboards and knobs of the oscilloscope will be disabled after any
one of the remote control command received. Use this command in order to
re-activate the front panel keyboards and knobs.
Syntax
:SYSTem:UNLock
Syntax
:TEMPlate1:DOWNload?
Arguments
Returns
Format:
The string of data is following.
# Data size digit Data Package Template Position Text Reserved Check Template
size type number string sum data
Data size digit: Indicate the digits of following data string amount (1 digit), The
value is ‘3’ in ASCII code.
Data size: The amount of current data string (3 digits). The value is “548” in
ASCII code.
Package type: The GO/NO-GO template package type (1 bytes). The value is
0x03 in hex.
49
GDS-806/810/820/840 Programming Manual
Template number: The location of template stored in memory. The valid range is
from 1 to 100 dots. The content is a single byte in hex (0x01 ~ 0x64).
Position: The position of template. The valid range is from -300 to +300 dots. The
content is a two bytes signed integer in hex (0xFED4 ~ 0x012C). (2 bytes, high
byte first)
Text string: The user defined string that will be shown on the screen. Here we
support English only. The string must include an ending character 0x00. (39
bytes).
Check sum: The check sum value is coming from the sum of 500 bytes of template
data. This value is 32 bits unsigned integer in hex (4 bytes, high byte first).
Template data: The effective template data which covers 250 points totally(500
bytes). Each point is two bytes signed integer in hex. The valid range is
from –100 to 100(0x0064 ~ 0xFF9C)
Example
The following is a partial of returned data from template location 1:
50
GDS-806/810/820/840 Programming Manual
Syntax
:TEMPlate1:UPLoad#3548………
Format:
The string of data is following.
# Data size Data size Package Template Position Text Reserved Check Template
digit type number string sum data
Data size digit: Indicate the digits of following data string amount(1 digit), The
value is ‘3’ in ASCII code.
Data size: The amount of current data string (3 digits). The value is “548” in
ASCII code.
Package type: The GO/NO-GO template package type (1 bytes). The value is
0x03 in hex.
Template number: The location of template stored in memory. The valid range is
from 1 to 100 dots. The content is a single byte in hex (0x01 ~ 0x64).
Position: The position of template. The valid range is from -300 to +300 dots. The
content is a two bytes signed integer in hex (0xFED4 ~ 0x012C). (2 bytes, high
byte first)
Text string: The user defined string that will be shown on the screen. Here we
support English only. The string must include an ending character 0x00. (39
bytes).
51
GDS-806/810/820/840 Programming Manual
Check sum: The check sum value is coming from the sum of 500 bytes of template
data. This value is 32 bits unsigned integer in hex (4 bytes, high byte first).
Template data: The effective template data which covers 250 points totally(500
bytes). Each point is two bytes signed integer in hex. The valid range is
from –100 to 100(0x0064 ~ 0xFF9C)
Arguments
Example
The following is a partial of command file including the command. It’s used for
transmitting template data to location 1:
Note: In this case the position is –50 (0xFFCE) dots. The check sum is
0x000016DA
Sets and query the number of template used for maximum boundary.
Syntax
:TEMPlate:MAX {1|100}
:TEMPlate:MAX?
Returns
<NR1>
52
GDS-806/810/820/840 Programming Manual
Sets and query the number of template used for minimum boundary.
Syntax
:TEMPlate:MIN {1|100}
:TEMPlate:MIN?
Returns
<NR1>
Sets and query the template mode. When we select Auto mode, the auto
template source is coming from CH1 or CH2. When we set normal mode, the
template is coming from 1 of the 100 templates.
Syntax
:TEMPlate:MODe {0|1}
:TEMPlate:MODe?
Arguments
Returns
<NR1>
53
GDS-806/810/820/840 Programming Manual
Sets and query the position of maximum template. This command will not change
the position value that stored in flash ROM. Unless you press the “Save & Create”
key in GO/NO-GO edit menu. That means if you exit from the GO/NO-GO
function, we will recall the value from flash ROM.
Syntax
:TEMPlate:POSition:MAX <NR2>
:TEMPlate:POSition:MAX?
Arguments
<NR2> is the desired template position. The range is from -12.0 ~ +12.0 div.
Returns
<NR2>
Note: 1 division = 25 dots
Sets and query the position of minimum template. This command will not change
the position value that stored in flash ROM. Unless you press the “Save & Create”
key in GO/NO-GO edit menu. That means if you exit from the GO/NO-GO
function, we will recall the value from flash ROM.
Syntax
:TEMPlate:POSition:MIN <NR2>
:TEMPlate:POSition:MIN?
Arguments
<NR2> is the desired template position. The range is from -12.0 ~ +12.0 div.
Returns
<NR2> Div
Note: 1 division = 25 dots
54
GDS-806/810/820/840 Programming Manual
Syntax
:TEMPlate:TOLerance <NR2>
:TEMPlate:TOLerance?
Arguments
<NR2> is the desired tolerance percentage. The range is from 0.4~40 (0.4% to
40%).
Returns
<NR2> %
TIMebase:DELay
Syntax
:TIMebase:DELay <NR3>
:TIMebase:DELay?
Arguments
Returns
<NR3>
55
GDS-806/810/820/840 Programming Manual
:TIMebase:SCALe
Syntax
:TIMebase:SCALe <NR3>
:TIMebase:SCALe?
Arguments
Returns
<NR3>
Examples
56
GDS-806/810/820/840 Programming Manual
:TIMebase:SWEep
Syntax
:TIMebase:SWEep <0|1|2|3|4>
:TIMebase:SWEep?
Arguments
0→Main timebase
1→Window
2→Window Zoom
3→Roll mode
4→XY mode
Returns
<NR1>
:TIMebase:WINDow:DELay
Setting and query the zoomed area (the gray color area) for window zoomed
display.
Syntax
:TIMebase:WINDow:DELay <NR3>
:TIMebase:WINDow:DELay?
Arguments
Returns
<NR3>
57
GDS-806/810/820/840 Programming Manual
:TIMebase:WINDow:SCALe
Sets and query the scale (length) of the windows zoomed timebase.
Syntax
:TIMebase:WINDow:SCALe <NR3>
:TIMebase:WINDow:SCALe?
Arguments
Returns
<NR3>
:TRIGger:COUPle
Syntax
:TRIGger:COUPle <0|1>
:TRIGger:COUPle?
Arguments
0→AC 1→DC
Returns
<NR1>
58
GDS-806/810/820/840 Programming Manual
:TRIGger:DELay:TIMe
Syntax
:TRIGger:DELay:TIMe <NR3>
:TRIGger:DELay:TIMe?
Arguments
<NR3> is the desired user-defined delay time. The range is from 100ns~1.3ms.
Returns
<NR3>
Note: Please select the specific delay type before implement any measurement. See
explanation for “:TRIGger:DELay:TYPe”
:TRIGger:DELay:EVENt
Syntax
:TRIGger:DELay:EVENt <NR1>
:TRIGger:DELay:EVENt?
Arguments
<NR1> is the desired user-defined delay trigger events. The range is from
2~65000.
Returns
<NR1>
Note: Please select the specific delay type before implement any measurement. See
explanation for “:TRIGger:DELay:TYPe”
59
GDS-806/810/820/840 Programming Manual
:TRIGger:DELay:LEVel
Syntax
:TRIGger:DELay:LEVel <NR3>
:TRIGger:DELay:LEVel?
Arguments
<NR3> is the desired user-defined start trigger signal level. The range is ±12.
Returns
<NR3>
:TRIGger:DELay:MODe
Select and query the different start trigger (i.e. external trigger) signal level.
Syntax
:TRIGger:DELay:MODe <0|1|2>
:TRIGger:DELay:MODe?
Arguments
0→TTL
1→ECL
2→USR
Returns
<NR1>
60
GDS-806/810/820/840 Programming Manual
:TRIGger:DELay:TYPe
Syntax
:TRIGger:ADVance:TYPe <0|1>
:TRIGger:ADVance:TYPe?
Arguments
0→Time setting
1→Event setting
Returns
<NR1>
:TRIGger:FREQuency?
Returns
<NR3>.
61
GDS-806/810/820/840 Programming Manual
:TRIGger:LEVel
Syntax
:TRIGger:LEVel <NR3>
:TRIGger:LEVel?
Arguments
Returns
<NR3>
:TRIGger:MODe
Syntax
:TRIGger:MODe <0|1|2|3>
:TRIGger:MODe?
Arguments
0→Auto Level
1→Auto
2→Normal
3→Single
Returns
<NR1>
62
GDS-806/810/820/840 Programming Manual
:TRIGger:NREJ
Syntax
:TRIGger:NREJ <0|1>
:TRIGger:NREJ?
Arguments
0→OFF 1→ON
Returns
<NR1>
:TRIGger:PULSe:MODe
Syntax
:TRIGger:PULSe:MODe <0|1|2|3>
:TRIGger:PULSe:MODe?
Arguments
0→<
1→>
2→=
3→≠
Returns
<NR1>
63
GDS-806/810/820/840 Programming Manual
:TRIGger:PULSe:TIMe
Syntax
:TRIGger:PULSe:TIMe <NR3>
:TRIGger:PULSe:TIMe?
Arguments
<NR3> is the desired time value of pulse width, the unit is in second.
Returns
<NR3>
:TRIGger:REJect
Syntax
:TRIGger:REJect <0|1|2>
:TRIGger:REJect?
Arguments
0→OFF
Returns
<NR1>
64
GDS-806/810/820/840 Programming Manual
:TRIGger:SLOP
Syntax
:TRIGger:SLOP <0|1>
:TRIGger:SLOP?
Arguments
Returns
<NR1>
:TRIGger:SOURce
Syntax
:TRIGger:SOURce <0|1|2|3>
:TRIGger:SOURce?
Arguments
0→Channel 1
1→Channel 2
2→External trigger
Returns
<NR1>
65
GDS-806/810/820/840 Programming Manual
:TRIGger:TYPe
Syntax
:TRIGger:TYPe <0|1|2|3>
:TRIGger:TYPe?
Arguments
0→Edge
1→Video
2→Pulse
3→Delay
Returns
<NR1>
66
GDS-806/810/820/840 Programming Manual
:TRIGger:VIDeo:FIELd
Select and query the field on which the video trigger mode will be triggered.
Syntax
:TRIGger:VIDeo:FIELd <0|1|2>
:TRIGger:VIDeo:FIELd?
Arguments
Returns
<NR1>
:TRIGger:VIDeo:LINe
Syntax
:TRIGger:VIDeo:LINe <NR1>
:TRIGger:VIDeo:LINe?
Arguments
For NTSC system, the range of line is from 1~263 for Odd frame, 1-262 for even
frame.
For PAL system, the range of line is from 1~313 for Odd frame, 1-312 for even
frame.
Returns
<NR1>
67
GDS-806/810/820/840 Programming Manual
:TRIGger:VIDeo:POLarity
Syntax
:TRIGger:VIDeo:POLarity <0|1>
:TRIGger:VIDeo:POLarity?
Arguments
Returns
<NR1>
:TRIGger:VIDeo:TYPe
Syntax
:TRIGger:VIDeo:TYPe <0|1|2>
:TRIGger:VIDeo:TYPe?
Arguments
0→PAL
1→NTSC
2→SECAM
Returns
<NR1>
68
GDS-806/810/820/840 Programming Manual
:WMEMory<X>:DISPlay
Select whether the stored waveform will be displayed after being saved.
Syntax
:WMEMory<X>:DISPlay <NR1>
:WMEMory<X>:DISPlay?
Arguments
0→OFF
1→ON
Returns
<NR1>
:WMEMory<X>:ERASe
Select whether the stored waveform will be erased after being saved.
Syntax
:WMEMory<X>:ERASe
Arguments
:WMEMory<X>:LOCate
Syntax
:WMEMory<X>:LOCate <NR1>
Arguments
<X>→Specify the location of RefA or RefB memory (1|2)
69
GDS-806/810/820/840 Programming Manual
:WMEMory<X>:OFFSet
Syntax
:WMEMory<X>:OFFSet <NR1>
Arguments
<NR1> is the desired offset position. The rage is from –100 to +100.
:WMEMory<X>:SAVe
Syntax
:WMEMory<X>:SAVe <1|2|3>
Arguments
1→Channel 1
2→Channel 2
3→Math function
70
GDS-806/810/820/840 Programming Manual
5. Status Reports
A set of status registers allows the user to quickly determine the Digital storage
oscilloscope’s internal processing status. The status register, as well as the status
and event reporting system, adhere to SCPI recommendations.
Structure of System
The sketch of the status and event reporting system is showed on figure 5-1. Each
component of the sketch represents a set of registers and queues which can read,
report, or enable the occurrence of certain events within the system.
If a specific event in the Digital storage oscilloscope that sets a bit in a status
register, reading the status registers can tell you what types of events have
occurred.
Each bit in the status register corresponds to a bit in an enable register; the enable
bit must be high for the event to be reported to the Status Byte Register.
A Service Request (SRQ) is the last event to occur. The SRQ requests an interrupt
on the GPIB to report events to the system controller.
Status Registers
There are two kinds of status registers are included with this oscilloscope.
z OPERation Status Registers ( CONDition, EVENt, and ENABle)
z QUEStionable Status Registers (CONDition, EVENt, and ENABle)
The STATus subsystem is the hierarchical set of commands (Figure 5-2) that read
the SCPI defined status registers.
The lower level nodes: QUEStionable and OPERation each have three 16 bits
registers: CONDition, EVENt, and ENABle. Figure 5-3 shows the sequential
relationship between these three types of registers and the commands that relate
to each register.
71
GDS-806/810/820/840 Programming Manual
Figure 5-1. A graphic represents the status registers and their connections.
72
GDS-806/810/820/840 Programming Manual
STATus
EVENt? EVENt?
To SBR
The read-only EVENt register latches any false-to-true change in condition. Once
the bit in the EVENt register is set, it is no longer affected by changes in the
corresponding bit of the CONDition register. The bit remains set until the controller
reads it. The command *CLS (Clear Status) clears the EVENt registers.
73
GDS-806/810/820/840 Programming Manual
Table 5-1 shows the bit designations of the 16 bit QUEStionable Status Register.
NU NU NU NU NU NU NU NU
128 64 32 16 8 4 2 1
Table 5-2 shows the bit designations of the 16 bit OPERation Status Register.
NU NU NU NU NU NU NU NU
NU NU NU NU NU NU NU NU
128 64 32 16 8 4 2 1
∗
NU: not used
74
GDS-806/810/820/840 Programming Manual
Status Registers.
There are two status registers are included with this oscilloscope which defined by
IEEE-488.1 and IEEE-488.2 standards.
Status Byte Register (SBR): The SBR (Table 5-3) summaries the status of all other
registers and queue.
128 64 32 16 8 4 2 1
75
GDS-806/810/820/840 Programming Manual
Use serial poll or the *STB? Query to read the contents of the SBR. The bits in the
SBR are set and cleared depending on the contents of the Standard Event Status
Register (SESR), the Standard Event Status Register (SESR), and the Output
Queue.
Standard Event Status Register (SESR): Table 5-4 shows the SESR
128 64 32 16 8 4 2 1
The bit 0 (OPC, Operation Complete) shows that the operation is complete. This
bit is active when all pending operations are complete following an *OPC
command.
The bit 1 is always zero.
The bit 2 (QYE, Query Error) indicates a command or query protocol error. The bit
3 (DDE, Device Error) shows that a device error occurred.
The bit 4 (EXE, Execution Error) shows that an error occurred while the
oscilloscope was execution a command or query.
The bit 5 (CME, Command Error) shows that an error occurred while the
oscilloscope was paring a command or query.
The bit 6 (USR, User Request) is ignored here for this oscilloscope.
The bit 7 (PON, Power On) shows that the oscilloscope was powered on.
Use the *ESR? Query to read the SESR. Reading the SESR clears the bits of the
registers so that the register can accumulate information about new events.
76
GDS-806/810/820/840 Programming Manual
Enable Registers.
The enable registers determine whether certain events are reported to the Status
Byte Register and SRQ. This oscilloscope has the following enable registers.
z Event Status Enable Register (ESER)
z OPERation Enable Register
z QUEStionable Enable Register
z Service Request Enable Register (SRER)
When one of the bits of the enable registers is high and the corresponding bit in
the status register is high, the enable registers will perform a logical OR function,
the output that controls the set bit of the Status Byte Register is high.
Various commands set the bits in the enable registers. The following sections
describe the enable registers and the commands that set them.
Event Status Enable Register (ESER): The ESER controls which types of events
are summarized by the Event Status Bit (ESB) in the SBR. The bits of the ESER
correspond to the bits of the SESR.
Use the *ESE command to set the bits in ESER. Use the *ESE? command to read
it.
OPERation Enable Register: Even though the OPERation Enable Register is
present in this digital storage oscilloscope, the OPERation registers do not report
any conditions.
QUEStionable Enable Register: The QUEStionable Enable Register controls which
types of events are summarized by the QUES status bit in the SBR.
Service Request Enable Register (SRER): The SRER controls which bits in the
SBR generate a service request.
Use the *SRE command to set the SRER. Use the *SRE? command to read it.
77
GDS-806/810/820/840 Programming Manual
Queues
78
GDS-806/810/820/840 Programming Manual
6. Error Messages
Table 6-1 lists the SCPI error messages for this digital storage oscilloscope.
Error
SCPI Error Code/Explanation
Code
/*Execution Error*/
79
GDS-806/810/820/840 Programming Manual
/* Filename - gds820ex1.c
*
* This is an example program written in C. We use a NI's GPIB interface
* card and one X86 PC to control GDS-806/810/820/840. This program could
* get the waveform data from GDS-806/810/820/840, and save them to a file.
* You can use Microsoft Visual C++ or Borland C++ Builder to compile this
* file. And you must link this file with an object file
* (BORLANDC_GPIB-32.OBJ) for Borland C++ or GPIB-32.OBJ for Visual C++ )
* that provided by National Instruments Corporation. DECL-32.H is a
* Win32 C/C++ include file, that contains NI-488.2 function prototypes
* and various pre-defined constants. It's also provided by NI.
*
* Copyright GOOD WILL INSTRUMENT
* All Rights Reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* Include the WINDOWS.H and DECL-32.H files. The standard Windows
* header file, WINDOWS.H, contains definitions used by DECL-32.H and
* DECL-32.H contains prototypes for the GPIB routines and constants.
*/
#include <windows.h>
#include "decl-32.h"
80
GDS-806/810/820/840 Programming Manual
81
GDS-806/810/820/840 Programming Manual
Delay(1000);
ibwrt (Dev, "*IDN?\n", 6L); /*Get the unique identification */
printf("*IDN?\n\r"); /*code of the GDS-806/810/820/840.*/
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
while(1){
ibrd (Dev, ReadBuffer, 100); /*Read datas from input bufer. */
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(0);
return 0;
}
for(i=0;i<ibcntl;i++){
ch=ReadBuffer[i];
WaveBuf[count++]=ch;
}
if(ch=='\n'){
WaveBuf[count]=0x00;
printf("%s\n\r",WaveBuf);
break;
}
}
Delay(1000);
ibwrt (Dev, ":RUN\n", 5L); /*Let the GDS-806/810/820/840 run. */
printf(":RUN\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
82
GDS-806/810/820/840 Programming Manual
Delay(1000);
ibwrt (Dev, ":CHANnel1:DISPlay 1\n", 20L);/*Set channel 1 display on */
printf(":CHANnel1:DISPlay 1\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
Delay(1000);
ibwrt (Dev, ":TIMebase:SCALe 2.5e-4\n", 23L);/*Set timebase: 200us/div*/
printf(":TIMebase:SCALe 2.5e-4\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
Delay(1000);
ibwrt (Dev, ":CHANnel1:OFFSet 0\n", 19L); /*Set offset voltage: 0V */
printf(":CHANnel1:OFFSet 0\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
Delay(1000);
ibwrt (Dev, ":CHANnel1:SCALe 0.5\n", 20L); /*Set vertical scale:
500mV/div */
printf(":CHANnel1:SCALe 0.5\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
83
GDS-806/810/820/840 Programming Manual
Delay(1000);
ibwrt (Dev, ":ACQuire:MODe 0\n", 16L); /*Set acquire mode:
sample mode */
printf(":ACQuire:MODe 0\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
Delay(1000);
ibwrt (Dev, ":TRIGger:LEVel 0.3\n", 19L); /*Set trigger level: 0.3V*/
printf(":TRIGger:LEVel 0.3\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
Delay(1000);
ibwrt (Dev, ":TRIGger:MODe 1\n", 16L); /*Set trigger mode: AUTO */
printf(":TRIGger:MODe 1\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
return 0;
}
84
GDS-806/810/820/840 Programming Manual
void Acquire(void)
{
short i, j;
FILE *writeP;
char writeFilename[15] = "wavedata.txt";
short wave;
int tmp, count=0;
ibwrt (Dev, ":ACQUIRE1:POINT\n", 16L);
printf(":ACQUIRE1:POINT\n\r");
Delay(1000);
if((ibsta&ERR)||(ibsta&TIMO)){
ibclr (Dev);
ibwrt (Dev, "*CLS\n", 5L);
ShowIbsta(1);
Delay(100000);
ibwrt (Dev, ":ACQUIRE1:POINT\n", 16L); /*Try again! */
printf(":ACQUIRE1:POINT\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(1);
Delay(100000);
exit (1);
}
}
85
GDS-806/810/820/840 Programming Manual
while(1){
ibrd(Dev, ReadBuffer, 100);
if((ibsta&ERR)||(ibsta&TIMO)){
ShowIbsta(0);
Delay(100000);
exit (1);
}
for(i=0;i<ibcntl;i++)
WaveBuf[count++]=ReadBuffer[i];
printf("\rReceived: %7d ", count);
if(count>=1014){
printf("\rReceived: %7d bytes.\n\r", count);
break;
}
}
86
GDS-806/810/820/840 Programming Manual
void Delay(int i)
{
int j,k;
for(j=0;j<i;j++){
for(k=0;k<30000;k++)
;
}
}
void ShowIbsta(char c)
{
if(ibsta & ERR){
if(c)
printf("\n\rUnable write to device(ibsta= %x),
(iberr=%x)\n\r",ibsta,iberr);
else
printf("\n\rUnable read from device(ibsta= %x),
(iberr=%x)\n\r",ibsta,iberr);
}
else{
if(c)
printf("\n\rWrite, ibsta= %x",ibsta);
else
printf("\n\rRead, ibsta= %x",ibsta);
}
}
87
GDS-806/810/820/840 Programming Manual
Question: As the previous example listed on page 27, how can the hexadecimal
value of “0×4C 0×BE 0×BC 0×20” transfer to 100M(Sa/s)?
Answer:
just use the attached C language program:
#include <stdio.h>
int main()
{
union data
{
char a[4];
float f;
} myData;
myData.a[0]=0x20; /* little-endian byte ordering here, */
myData.a[1]=0xbc; /* so, the last of 0x20 should be placed */
myData.a[2]=0xbe; /* in the first order. */
myData.a[3]=0x4c;
printf("Here is the Data:\n%0x\n%0x\n%0x\n%0x\n%.3e\n",\
myData.a[0]&0xff,
myData.a[1]&0xff,
myData.a[2]&0xff,
myData.a[3]&0xff,\
myData.f );
return 0;
}
88