Boards that Support the Function
Operation ASCII characters divided with separator specified by the GpCnvSettings function is changed into the Float value (In VB, Single value), and stored for the array. The default of separator is "," (comma).
Format
(VB.NET)
Dim ArraySize, Ret As Integer
Dim Str As String
Dim FltData(xxxx) As Single ' (xxxx is max of data number)
Ret = GpCnvStrToFltArray(Str, FltData, ArraySize)
(C)
DWORD ArraySize, Ret;
char *Str;
float *FltData;
Ret = GpCnvStrToFltArray(Str, FltData, &ArraySize);
(C#)
uint ArraySize, Ret;
string Str;
float[] DblData = new float[xxxx]; /* (xxxx is max of data number) */
Ret = gpib.CnvStrToFltArray(Str, FltData, out ArraySize);
(Python)
ArraySize, Ret = ctypes.c_ulong(), ctypes.c_ulong()
Str = ctypes.create_string_buffer(xxxx) # (xxxx is the string length)
FltData = (ctypes.c_float * xxxx)() # xxxx is max of data number
Ret.value = GpibPy.GpCnvStrToFltArray(Str, FltData, ctypes.byref(ArraySize))
Mode Master mode / Slave mode
Parameters Str : A string to change.
Characters to change into the Float value (In VB, Single value) is specified. There is no problem even if a header is contained in this characters. And, a capital letter, small letter is judged as the same one character.
FltData : Array of changed Float value (In VB, Single value). (return value)
ArraySize : (IN) The size of the array of FltData.
(OUT) The number that data were actually stored.
Ret : Return value
0 : Normal completion
244 : There is a data block divided with separator beyond ArraySize.
255 : Illegal call
(See "Return Values" for details.)
Notes 1 This function does a change on the following condition.
When there is [<Header>+<The characters which shows numerical value>] or [< The characters which shows numerical value>], they are divided with separator.
*There is no problem even if more than one space is being inserted before and behind separator.
*Refer to the complement of GpCnvStrToDbl() for the details of the condition that it faces in the data block.
2 This function can be used even if it doesn't call GpIni().
3 The condition of 1. is applicable when it is removed when a header and so on is set up by the GpCnvSettings function.
4 Prevent the value of ArraySize from your exceeding the size of FltData array that it was secured. A movement can't be assured when it is set up beyond the size of the FltData array.