Reading
⑰ CNT Sampling [read_cnt_samp.vi]

 

Select to acquire sampling data of counter input

 

 


IN/OUT Terminal layout

 


Input terminal

CntSamplingTimes

Initial value 1000

Specify the number of data to be read by the sampling count per 1 Ch

Sampling count is irrelevant to the number of channels used
 For example, if 1000 samples are performed on 2 channels and 2000 data is acquired,

1000 is specified for CntSamplingTimes

  

Timeout

"-1" can be set

Initial value 10000

Specify the timeout time of read
The unit is milliseconds and the initial value is 10,000 (10 seconds)

If the number of data specified by CntSamplingTimes does not exist, it waits in the VI until data is accumulated
In addition, when the specified time of the Timeout has elapsed, read the number of data that can be read at that point in time

When this value is set to "0", this VI reads data without waiting
If you specify "-1", it will wait until the specified number of data is accumulated

Please note that the "-1" designation of this input terminal is different from other VIs

  

Output terminal

CntData

Acquire the read data in an array (1D array)
The data in the array is ordered by channel number

Example) Data array when 3-channel counter sampling is performed (Numbers are channel numbers)
 [0][1][2][0][1][2][0][1][2]...

 

CntDataNum

Get the number of data read

If the number of data specified by CntSamplingTimes exists, they will have the same value
If 0 is specified for Timeout or when timeout occurs, the number of actually read data is returned

 

CntSamplingReadStatus

Get reading status of sampled data

Value

Status

Meaning

0

Successful completion

Indicates that the number of data specified by CntSamplingTimes has been read

1

Lack of data

When 0 is specified for Timeout, it indicates that the number of data specified by CntSamplingTimes does not exist and could not be read

2

Time out

When 1 or more wait time was specified for Timeout, it indicates that the number of data specified by CntSamplingTimes was not accumulated even if waiting for the specified time

In this case, we will acquire data as much as we can obtain

3

Overflow

Indicates that the buffer secured by DAQ-LV-WIN has overflowed

All collected data is discarded and can not be read

4

Error

Indicates that some error occurred during reading