ZmSingleCMeasure


Function

Perform a C (Capacitance) measurement only once.

Format

Ret = ZmSingleCMeasure ( Id , ChannelNo , CValue , DValue , Status )

Parameters

Id [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from ZmInit.

ChannelNo [ C, C++ : unsigned short ] [ Python: ctypes.c_ushort ]
Specify the channel number.

CValue [ C, C++:  float * ] [ Python: ctypes.POINTER(ctypes.c_float) ]
Specify the variable address for storing the capacitance. The unit is F (Farad).

DValue [ C, C++:  float * ] [ Python: ctypes.POINTER(ctypes.c_float) ]
Specify the variable address for storing the dissipation factor.

Status [ C, C++ : unsigned long * ] [ Python: ctypes.POINTER(ctypes.c_ulong) ]
Specify the variable address for storing the measurement status.

Bit number of Status

Description

16

Result of contact check before measurement(L measurement end side)

17

Result of contact check before measurement(H measurement end side)

18

Result of contact check after measurement (L measurement end side)

19

Result of contact check after measurement (H measurement end side)

24 - 25

Equivalent circuit mode
  1 : Serial circuit
  2 : Parallel circuit

※Undefined bit numbers are unused.

Return Value

Ret [ C, C++: long ] [ Python: ctypes.c_long ]

Definition

Value
[Dec]

Description

ZM_ERR_SUCCESS

0

Normality completion

ZM_ERR_SYS_CHANNEL_NO

20100

Channel No is out of the settable range.

ZM_ERR_SYS_MEASURE_STOP

20116

Measurement stopped.

The others (See also: Details of Error Code)

Initial Value

None

Remarks

Perform a C (Capacitance) measurement only once.
Only the specified channel will be measured.

This function will not return until the measurement is complete.
The process will return when the measurement is complete, so check the measurement results contained in the parameters.

Measurement will stop when the ZmResetDevice function is executed.

For details about the equivalent circuit mode in the measurement status, please refer to the glossary "Equivalent Circuit Mode".
For details about the contact check in the measurement status, please refer to the glossary "Contact Check".

Example

Get the capacitance, dissipation factor and measurement status for ChannelNo=1.

C, C++

long Ret;
float CValue;

float DValue;
unsigned long Status;
Ret = ZmSingleCMeasure ( Id , 1 , &CValue , &DValue , &Status );
 

Python

Ret = ctypes.c_long()

CValue = ctypes.c_float()
DValue = ctypes.c_float()
Status = ctypes.c_ulong()

Ret.value = czm.ZmSingleCMeasure ( Id , 1 , ctypes.byref(CValue) , ctypes.byref(DValue) , ctypes.byref(Status) )
 

See Also

ZmResetDevice