DioReadPulseMeasurementData


Function

Retrieves the pulse measurement data for the specified channel.

Format

Ret = DioReadPulseMeasurementData( Id , ChNo , ChNum , Status , Error , TimeValue , TimeUnit )

Parameters

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

ChNo [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the start address of the array that stores the channel numbers for which settings are to be retrieved.

ChNum [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the number of channels specified in ChNo.

Status [ C, C++: unsigned short * ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]
Specify the start address of the array that stores the pulse measurement status.

Bit

Description

Value

0

Pulse measurement status

0: Stop
1: In operation

1

Measurement data confirmed

0: Not confirmed
1: Measurement data confirmed

31:2

Reserved

-

Error [ C, C++: unsigned short * ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]
Specify the start address of the array that stores the pulse measurement period.

TimeValue [ C, C++: unsigned long long * ] [ Python: ctypes.POINTER(ctypes.c_ulonglong) ]
Specify the start address of the array that stores the pulse measurement times.

TimeUnit [ C, C++: unsigned short * ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]
Specify the start address of the array that stores the units of pulse measurement time.

Definition

Value

[Dec]

Description

DIO_PULSE_MEASUREMENT_TIME_UNIT_S

1

sec unit

DIO_PULSE_MEASUREMENT_TIME_UNIT_MS

2

msec unit

DIO_PULSE_MEASUREMENT_TIME_UNIT_US

3

usec unit

DIO_PULSE_MEASUREMENT_TIME_UNIT_NS

4

nsec unit

 

Return Value

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

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal completed.

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Driver cannot be called (failed in ioctl).

DIO_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

DIO_ERR_SYS_NOT_SUPPORTED

20001

This board couldn't use this function.

DIO_ERR_SYS_CH_NO

20105

Channel No. is outside the setting range.

DIO_ERR_SYS_CH_NUM

20106

Channel number is outside the setting range.

DIO_ERR_SYS_PULSE_MEASUREMENT_TIME_UNIT

20953

The pulse measurement time unit is out of range.

The others (See also: Details of Error Code)

Remarks

Retrieves the pulse measurement data for the specified channel.

The pulse measurement status (bit 0 of the argument status) becomes Active (1) from the execution of the DioStartPulseMeasurement function until it is stopped by the DioStopPulseMeasurement function.
The measurement data confirmation (bit 1 of the argument status) becomes Confirmed (1) when the pulse measurement data is finalized and stored in PulseMonitorTime.

Example

Retrieves the pulse measurement data of channel 0 and channel 1 in units of nanoseconds (nsec).

C, C++

long Ret;
short ChNo[2];
unsigned short Status[2];
unsigned short Error[2];

unsigned long long TimeValue[2];
unsigned short TimeUnit[2];

ChNo[0] = 0;
ChNo[1] = 1;

TimeUnit[0] = DIO_PULSE_MEASUREMENT_TIME_UNIT_NS;

TimeUnit[1] = DIO_PULSE_MEASUREMENT_TIME_UNIT_NS;
Ret = DioReadPulseMeasurementData( Id , &ChNo[0] , 2 , &Status[0] , &Error[0] , &TimeValue[0] , &TimeUnit[0] );
 

Python

Ret = ctypes.c_long()
ChNoType = ctypes.c_short * 2
ChNo = ChNoType()
StatusType = ctypes.c_ushort * 2
Status = StatusType()
ErrorType = ctypes.c_ushort * 2
Error = ErrorType()

TimeValueType = ctypes.c_ulonglong * 2
TimeValue = TimeValueType()
TimeUnitType = ctypes.c_ushort * 2
TimeUnit = TimeUnitType()

ChNo[0] = 0
ChNo[1] = 1

TimeUnit[0] = cdio.DIO_PULSE_MEASUREMENT_TIME_UNIT_NS

TimeUnit[1] = cdio.DIO_PULSE_MEASUREMENT_TIME_UNIT_NS
Ret.value = cdio.DioReadPulseMeasurementData( Id , ChNo , 2 , Status , Error , TimeValue , TimeUnit )
 

See Also

DioStartPulseMeasurement
DioStopPulseMeasurement

DioSetPulseMeasurementSetting