# cbCIn()

Reads the current count from a counter channel.

## Function Prototype

C/C++

int cbCIn(int BoardNum, int CounterNum, unsigned short *Count)

Visual Basic

Function cbCIn(ByVal BoardNum&, ByVal CounterNum&, CBCount&) As Long

## Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99. The specified board must have a counter.

CounterNum

The counter to read the current count from. Valid values are in the range of 0 to 20, depending on the device and the number of counters available on the device. See product-specific information in the Universal Library User's Guide.

Count

Counter value is returned here. Refer to the Notes section below.

## Returns

- Error code or 0 if no errors

## Notes

- Count: The range of counter values returned are: 0 to 65,535 for C or PASCAL languages.
- Refer to your BASIC manual for information on BASIC integer data types. -32,768 to 32,767 for BASIC languages. BASIC reads counters as:

- 65,535 reads as –1
- 32,768 reads as –32,768
- 32,767 reads as 32,767
- 2 reads as 2
- 0 reads as 0

- cbCIn() vs cbCIn32() vs cbCIn64()
- Although the cbCIn(), cbCIn32(), and cbCIn64() functions perform the same operation, cbCIn32() is the preferred method to use in most situations.
- The only difference between the three is that cbCIn() returns a 16-bit count value, cbCIn32() returns a 32-bit value, and cbCIn64() returns a 64-bit value. Both cbCIn() and cbCIn32() can be used, but cbCIn64() is required whenever you need to read count values greater than 32-bits (counts >4,294,967,295) or the upper (more significant) bits will be truncated.