Setup Example

image\head10.gif VB.NET

Dim ArraySize, i, Ret As Integer

Dim Str As String

Dim FltData(100) As Single

 

Str = "DV +0.123E-3, DV -0.456E-3"

For i = 0 to 99

    FltData(i) = 0

Next

ArraySize = 100

Ret = GpCnvStrToFltArray(Str, FltData, ArraySize)

 

(Result)

FltData[0] : 0.000123

FltData[1] : -0.000456

ArraySize : 2

 

image\head10.gif C

DWORD ArraySize, i, Ret;

char Str[256];

float FltData[100];

 

lstrcpy(Str, "DV +0.123E-3, DV -0.456E-3");

for(i = 0; i < 100; i++) {

 FltData [i] = 0;

}

ArraySize = 100;

Ret = GpCnvStrToFltArray(Str, FltData, &ArraySize);

 

(Result)

FltData[0] : 0.000123

FltData[1] : -0.000456

ArraySize : 2

 

image\head10.gif C#

uint ArraySize, i, Ret;

string Str;

float[] FltData = new float[100];

 

Str = "DV +0.123E-3, DV -0.456E-3";

for(i = 0; i < 100; i++) {

    FltData [i] = 0;

}

ArraySize = 100;

Ret = gpib.CnvStrToFltArray(Str, FltData, out ArraySize);

 

(Result)

FltData[0] : 0.000123

FltData[1] : -0.000456

ArraySize : 2

 

image\head10.gif Python

ArraySize, Ret = ctypes.c_ulong(), ctypes.c_ulong()

Str = ctypes.create_string_buffer(256)

FltData = (ctypes.c_float * 100)()

 

Str.value = b"DV +0.123E-3, DV 0.456E-3"

for i in range(0, 100):

    FltData[i] = 0

ArraySize.value = 100

Ret.value = GpibPy.GpCnvStrToFltArray(Str, FltData, ctypes.byref(ArraySize))

 

(Result)

FltData[0] : 0.000123

FltData[1] : -0.000456

ArraySize : 2