GxCntReadStatusRegister

Purpose

Read the counter status register.

Syntax

GxCntReadStatusRegister (nHandle, , pnData, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a counter board.
pnData
PSHORT
Returns status register value. See Comments.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The status register is a 16-bit register (bits 0 – 15) configured as follows:

15-9
8
7
6
5
4
3
2
1
0
TBD
ODR
ERR
TBD
POV
TGD
TLB
TLA
ARM
GATE

Where:

Bit #
Bit name
Description
0
GATE
Gate is open no signal was detected.
1
ARM
Waiting for arm signal. High when arming is used, and the counter is waiting for an arming signal to start or to end the measurement. It is also high during the delay in the Time Interval with Delay mode.
2
TLA
Trigger Level A is settled. This is useful for making sure that the auto trigger already determines the trigger level before using the Hold option or reading out the trigger levels.
3
TLB
Trigger Level B is settled. See the description for the TLA above.
4
TGD
Gated Totalize measurement is Done.
5
POV
Pace Overrun Warning. A Acquisition Overrun occurs when a paced measurement does not complete soon enough to allow the next scheduled measurement to start on time. Skipping of measurements will occur, which may be of concern if it is necessary to know exactly when each data point was taken.
6
TBD
Reserved
7
ERR
An error has occurred. You can read the error code string with the GTI_CTR_rd_err() function. The error bit is cleared with the GxCntReset function.
8
ODR
Output Data Ready. The output buffer has measurement data or other data that you requested ready to be read by your program. You can check this bit before reading measurements to ensure that your program will never wait for data.
9-15
TBD
Reserved

 

To determine if a bit is set you need to “mask” it by using the AND operator in the specific language used.

Reading the status register does not disturb the measurement in progress or the measurement data.

Example

The following example counter status register:

 

SHORT nHandle, nData, nStatus;

GxCntReadStatusRegister (nHandle, &nData, &nStatus);

 

See Also

GxCntIsMeasurementReady, GxCntReadMeasurement, GxCntReadMeasurementString, GxCntGetFunction, GxCntGetErrorString