GpCnvStrToDbl

image\BLTLRGSQ.gifBoards that Support the Function image\SETUP.gif image\SANBTN.gif

 

 

image\head10.gif Operation             ASCII string given to it is changed into the Double value.

 

image\head10.gif Format                 

(VB.NET)

Dim Ret As Integer

Dim Str As String

Dim DblData As Double

Ret = GpCnvStrToDbl(Str, DblData)

 

(C)

DWORD Ret;

char *Str;

double DblData;

Ret = GpCnvStrToDbl(Str, &DblData);

 

(C#)

uint Ret;

string Str;

double DblData;

Ret = gpib.CnvStrToDbl(Str, out DblData);

 

(Python)

Ret = ctypes.c_ulong()

Str = ctypes.create_string_buffer(xxxx) # (xxxx is the string length)

DblData = ctypes.c_double()

Ret.value = GpibPy.GpCnvStrToDbl(Str, ctypes.byref(DblData))

 

image\head10.gif Mode                   Master mode / Slave mode

 

image\head10.gif Parameters

Str                 : A string to change.

A string to change into the Double value is specified.
There is no problem even if a header is contained in this string.
And, a capital letter, small letter is judged as the same one character.

 

DblData           : Changed Double value is arranged. (return value)

 

Ret                 : Return value

0      : Normal completion

255   : Illegal call

(See "Return Values" for details.)

 

image\head10.gif Notes

1 This function does a change on the following condition.

When there is "a line" + string numerical value or "the string which shows numerical value".

 

* As for the header, it means the string composed of the string composed only of an alphabet, sign like "DV", or the combination of a character like "B1" and the number, and a header is ignored.
And, there is no problem even if one and more space is covered before and after the header. Don't cover the space within the header itself.

 

* As for the string which shows numerical value, it means the string composed of the temporary number [ either + coefficient suffix ], the temporary number, the temporary number + index number.
There is no problem even if more than one space is being inserted into the temporary number, an index number and coefficient suffix.
And, even if it is divided with "/", there is no problem in the temporary number and coefficient sadix.
But, don't put the space after "/".
Refer to "About Temporary Number, Index Number, Coefficient, Suffix" in Addtional Information category
and a GpCnvSettings function.

 

* The end of the space or the string must come behind the string which shows numerical value.
And, when SfxFlag is specified in 1, it is ignored as for the character which distinguishes only coefficient suffix and which isn't applicable.
Therefore the following difference is formed.

 

Example ) SfxFlag = 1

The string (Str): the returned value (DblData)

"DV +1.2M S": 0.0012 "

"DV +1.2MS": 0.0012 "

"+1.2m A": 0.0012 "

"+1.2m A": 1.2E+6

"+1.2 mA": 1.2E+6

 

* Coefficient suffix is ignored regardless of the designation of SfxFlag when the block which shows the block which shows an index number, and coefficient suffix is specified at the same time.

 

Example)
The string (Str)
: the value (DblData)

"1.2E-1": 0.12

"1.2E-1M": 0.12

 

* You must cover at least one space between the header and the string which shows numerical value.

 

* Or, the character of the string block at the head is changed as a numerical value when one string like "B1" is divided as an exception in more than one space and it stands in a line.

 

Example)

The string (Str): the value (DblData)

"B1": 1

"B100 C2": 100

"B100C2": error

"BD D3": 3

"BD": error

"D5 E0 1.2E-3": 5

 

2  It can be used even if this function 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 [3] GpCnvSettings function.