Downloading arbitrary waveforms – AMETEK Lx Series II Programming Manual User Manual
Page 152

Programming Manual
Lx \ Ls Series II
148
6.10 Downloading Arbitrary Waveforms
The Lx Series supports the use of arbitrary waveforms. The same is true for the Ls Series if the
-ADV option is installed. Up to 50 user defined waveforms can be downloaded to the Lx by
assigning a user defined name of up to 12 characters long and sending the formatted waveform
data over the bus. File names longer than 12 characters will be truncated on the WAVEFORM
LCD display and make it difficult to select the right waveform from the front panel, especially if the
first 12 characters are the same.
Note: Avoid using names that conflict with standard waveforms such as SIN, SINE, CLIPPED,
SQUARE.
Once downloaded, user waveforms can be recalled from either the front panel using the MENU
key or over the bus using the FUNCtion command. See section 6.2.1.
6.10.1 Waveform Record Data Format
The total number of datapoints required to define a waveform register is 1024. Each data points
should be scaled between
–1.000 and +1.000. If scaled differently, the Lx/Ls controller will
automatically scale the data received. The TRAC:DATA command is used to send the data in
comma delimited form to the power source controller.
The datapoints correspond to a single waveform period. When selected for output, the waveform
register will be output at the programmed frequency. Each register should be set up to conain a
single period of the desired output waveform only. It is important to ensure that the start and end
point of the waveform data matches (equal value). If not, a discontinuity will occur each time the
register repeats at the output while selected.
6.10.2 Download Sample
The Visual Basic 6 code sample below provides a simple illustration on how to download a user
defined waveform. The data points are passed in a single dimension array sWaveformPoints of
type Single. (single precision floating point).
Note: User defined waveforms are retained in non-volatile memory. The process of writing to this
memory takes a certain amount of time. Allow a 500 msec delay between sending the last
data value and sending the next bus command.
Sample code:
Global sWaveformPoints(1023) As Single 'Waveform datapoints, base 0
Private Sub Download(ByVal strWaveName As String, ByVal iPoints As Integer, _
ByRef sBuffer() As Single)
'============================================================================
'This procedure transfers a block of Data from the PC
'to the AC Source. The waveform name is passed as a parameter
'============================================================================
Dim i As Integer
Dim strCmd As String
'============================================================================
On Error GoTo XFRArbError
‘Define catalog entry user defined name (max length is 12 char)
strCmd = "TRAC:DEF " + Left$(strWaveName,12)
Send gl_iNIBrdId, AC_Adr, s, NLend
‘Send data buffer
strCmd = = "TRAC:DATA " + Left$(strWaveName,12)
‘Assemble data buffer string command