DioReadPulseMeasurementData


Function

Retrieves the pulse measurement data for the specified channel.

Format

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

Parameters

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

ChNo [ VB.NET: Short ] [ C, C++: short * ] [ C#: out 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 [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the number of channels specified in ChNo.

Status [ VB.NET: UShort ] [ C, C++: unsigned short * ] [ C#: out ushort ] [ 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 [ VB.NET: UShort ] [ C, C++: unsigned short * ] [ C#: out ushort ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]
Specify the start address of the array that stores the pulse measurement period. 

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

TimeUnit [ VB.NET: UShort ] [ C, C++: unsigned short * ] [ C#: out ushort ] [ 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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal completed.

DIO_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute DioResetDevice function because the device has recovered from standby mode.

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Not call the driver (Failure on DEVICE I/O CONTROL).

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).

VB.NET

Dim Ret As Integer
Dim ChNo(1) As Short
Dim Status(1) As UShort
Dim Error(1) As UShort

Dim TimeValue(1) As ULong

Dim TimeUnit As UShort

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 , 2 , Status , Error , TimeValue , TimeUnit)
 

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] );
 

C#

int Ret;
short[] ChNo = new short[2];
ulong[] Status = new ushort[2];
ushort[] Error = new ushort[2];

ulong[] TimeValue = new ulong[2];
ushort[] TimeUnit = new ushort[2];


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

TimeUnit[0] = DIO_PULSE_MEASUREMENT_TIME_UNIT_NS;

TimeUnit[1] = DIO_PULSE_MEASUREMENT_TIME_UNIT_NS;
Ret = dio.ReadPulseMeasurementData( Id , out ChNo , 2 , out Status , out Error , out TimeValue , out TimeUnit );
 

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