2.3.2. WAVE Command
The WAVE
command allows to upload and reproduce a buffer of pre-stored setpoints. Using this command properly it is possible also to generate a waveform or to reproduce a sequence of setpoints.
The device takes a new setpoint from the buffer, at every PID calculation cycle (Update Frequency).
To verify the Update Frequency, see the UPFREQ Command. The length of the Buffer of setpoints is limited, and so it is possible to use a Prescaler in order to reduce the Update Frequency - \(f_{update}\). This can be useful in the case of waveform in order to enlarge the waveform length or to generate very slow waveforms.
Setting properly the buffer points it is possible to reproduce a waveform. To load the waveform points it is enough to put in the buffer the points of the desired waveform, sampled with \(f_{sampling} (f_s)\):
Command Format:
R/W |
Command |
Response |
Description |
---|---|---|---|
R |
WAVE:PERIODS:? |
#WAVE:PERIODS:<period-number> |
Read the number of periods setting |
W |
WAVE:PERIODS:<period-number> |
#AK / #NAK |
Set the number of periods setting |
R |
WAVE:PERIODS:INDEX:? |
#WAVE:PERIODS:INDEX:<period-index> |
Return the currently used index of periods |
R |
WAVE:POINTS:? |
#WAVE:POINTS:<p1>:<p2>:…:<pN> |
Returns the values stored in the internal buffer [1] |
W |
WAVE:POINTS:<p1>:<p2>:…:<pN> |
#AK / #NAK |
Fill the internal buffer with setpoints |
R |
WAVE:POINTS:NUM:? |
#WAVE:POINTS:NUM:<points-number> |
Read the number of points stored in the internal buffer |
R |
WAVE:POINTS:INDEX:? |
#WAVE:POINTS:INDEX:<points-index> |
Return the currently used index of the internal buffer |
R |
WAVE:PRESCALER:? |
#WAVE:PRESCALER:<prescaler> |
Read the prescaler value |
W |
WAVE:PRESCALER:<prescaler> |
#AK / #NAK |
Set the presclaer value |
R |
WAVE:TRIGGER:? |
#WAVE:TRIGGER:<trigger-mode> |
Read the trigger mode |
W |
WAVE:TRIGGER:<trigger-mode> |
#AK / #NAK |
Set the trigger mode |
W |
WAVE:START |
#AK / #NAK |
Start the execution of the stored values |
W |
WAVE:STOP |
#AK / #NAK |
Stop the execution of the stored values |
Parameter(s):
Name |
Type |
Range |
Description |
<period-number> |
integer string |
≥0 |
Indicates the number of times (periods) that the buffer has to be reproduced; if equal to 0 -> Infinite periods (The waveform can be stopped with |
<period-index> |
integer string |
[0, <period-number> - 1] |
Indicates the index of the currently applied period |
<p1>…<pN> |
floating string |
N ∊ [2, 500.000] |
Setpoints sequence - The min number of points is 5; the max number of setpoints is 500.000 |
<points-number> |
integer string |
≥0 |
Indicates the number of points that are stored in the buffer |
<points-index> |
integer string |
[0, <points-number> - 1] |
Indicates the index of the currently applied point |
<prescaler> |
integer string |
[1, 100] |
Specify the prescaler value (default value = 1) |
<trig-mode> |
Description |
START |
Start to reproduce the content of the buffer on trigger event. To stop the execution of the waveform it is necessary to use the |
POINTS |
Reproduce the next point on trigger event. To arm the execution it is necessary to send the |
GATE |
In this configuration the buffer is reproduced on trigger event. This mode is meant to be with |
GATERESET |
This option has the same behavior as |
Tip
The
WAVE:TRIGGER
mode is related to theTRIGGER
mode, please refer to TRIGGER Command.
Trigger mode Examples
For the next examples, the internal buffer was filled with a sine waveform points with the following settings:
Amplitude: 1
Frequency: 1 Hz
Number of periods: 3
Prescaler: 1
Example #1:
WAVE:TRIGGER:START
withTRIG:POS
option
In this example, the preloaded waveform starts when a trigger event is detected. In this example the trigger is set to POS
and so the trigger event is generated at positive edge of the trigger signal.
Example #2:
WAVE:TRIGGER:POINTS
withTRIG:POS
option
In this example, the preloaded waveform points are loaded when a trigger event is detected. In this example the trigger is set to POS
and so the trigger event is generated at positive edge of the trigger signal, which in this example is a square waveform of 50 KHz. When the square waveform is not executed, the trigger event is not generated and so the setpoint is not updated.
Example #3:
WAVE:TRIGGER:GATE
withTRIG:HIGH
option
In this example, the preloaded waveform points are loaded when a trigger event is detected. In this example the trigger is set to HIGH
and so the trigger event is generated when the trigger level is high. In this example the trigger signal is a square waveform of 1 Hz. When the trigger signal is high, the trigger event is generated and so the setpoint is updated.
Example #4:
WAVE:TRIGGER:GATERESET
withTRIG:HIGH
option
The configuration of this example are the same of the previous one, but the GATERESET
mode resets the buffer index when the trigger event is not valid, and so at next trigger level, the waveform starts from the beginning.
Warning
The
WAVE
andTRIGGER
commands allows also particular combinations, that does not make any sense for example:When
TRIGGER:OFF
is set, the trigger sensing is disabled and so the trigger event never occurs, thus the waveform is never updated.When the
WAVE:TRIGGER:GATERESET
is used withTRIGGER:POS
configuration, the waveform is reset at every negative edge of the trigger -> the buffer index is constantly in reset.
Example(s):
WAVE:PERIODS:5
#AK
WAVE:PERIODS:?
#WAVE:PERIODS:5
WAVE:POINTS:1:2:3:4:5:6:7:8:9:10
#AK
WAVE:POINTS:NUM:?
#WAVE:POINTS:NUM:10
WAVE:PRESCALER:2
#AK
WAVE:PRESCALER:?
#WAVE:PRESCALER:2
WAVE:TRIGGER:START
#AK
WAVE:START
#AK
WAVE:STOP
#AK