AMETEK BPS Series Programming Manual User Manual
Page 58

AMETEK Programmable Power
BPS / MX / RS Series SCPI Programming Manual
58
Manual P/N 7003-961 Rev AA
4.5.2
Waveform Array Data Format Mode
MEASure:ARRay:MODe
This command selects the waveform array data format to be used. (Available in firmware
revision 2.32 or higher only.) The default mode is binary (BIN) which uses an IEEE floating
point data format in which each data sample is transferred as a 4 byte floating point binary
data word. Alternatively, an ASCII format may be selected (ASCii) in which each data
sample is sent as 8 ASCII Hex values representing the 4 byte IEEE floating point data. Note
that the transfer mode only applies to MEAS:ARR:VOLT and MEAS:ARR:CURR queries. All
other measurement queries always return ASCII data. Note that at power on, the default
mode is always set to binary (BIN).
Syntax MEASure:ARRay:MODe
Parameters
BIN | ASCii
Examples MEAS:ARR:MOD
ASC
Related Commands
MEAS:ARR:VOLT
MEAS:ARR:CURR
Note: The MEAS:ARR:MOD command is provided to allow waveform data transfers in
ASCII on DBCS versions of MS Windows. Examples of DBCS versions are Chinese,
Korean, Japanese etc. On most Windows versions, the binary mode can be used as it
reduces the amount of data transferred and thus provides better throughput.
The ASCII mode will double the number of characters transferred so provisions for a larger
receive buffer on the PC may have to be made. The maximum data size that can be sent
with one command is 16KB. To transfer the entire 4096 waveform acquisition buffer in ASCII
mode requires two separate data transfers of the first followed by the second buffer. The
block size and block offset parameters may be used to accomplish this.
Conversion function sample VB6. Converting waveform data from either transfer mode to a
single precision value can be accomplished using the following sample routine:
Public Function StringToIEEEFloat(ByVal sData As String, ByVal bAsciiMode As Boolean)
As Single
'=============================================================
'bAsciiMode flag is used if data is received as 8 ascii chars
'representing Hex 0-9,A-F. If bAsciiMode flag is false, then
'data is process as 4 char representing a byte each. Ascii
'mode is needed for DCBS windows
'=============================================================
Dim i As Integer
Dim j As Integer
Dim iChar As Integer
Dim expo As Long
Dim mantisse As Long
Dim expo_val As Variant
Dim mant_f As Single
Dim c(3) As Long 'Must use 32 bit integers to allow for
'intermediate result of 24 bit shift
Dim sign As Boolean
'=============================================================
Const MANT_MAX = &H7FFFFF
Const EXPO_MAX = 2 ^ 126
'=============================================================
On Error GoTo FloatConvError
If bAsciiMode Then
'Retrieve ASC values from eight hex byte input data
sData = UCase(sData)
For i = 0 To 3
c(i) = 0
For j = 0 To 1
iChar = AscB(Mid$(sData, i * 2 + j + 1, 1)) - 48