Reading
⑤ DI Sampling [read_di_samp.vi]

 

Select to acquire sampling data of digital input

 

 


IN/OUT Terminal layout

 


Input terminal

DiSamplingTimes

Initial value: 1000

Specify the number of data to be read by the sampling times

 

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 DiSamplingTimes 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

DiData

Acquire the read data in an array (1D array)
For sampling data, the input of all input bits is acquired as one data (U32)

For example, When only input bits 0 and 7 are ON (1), the data is "10000001" in binary, the value that can be acquired will be 129 decimal

 

DiDataNum

Get the number of data read
If the number of data specified by DiSamplingTimes 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

 

DiSamplingReadStatus

Get reading status of sampled data

Value

Status

Meaning

0

Successful completion

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

1

Lack of data

When 0 is specified for Timeout, it indicates that the number of data specified by DiSamplingTimes 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 allocated 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