Skip to content
Snippets Groups Projects
Commit e2ea8bcc authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Add samples number check in data callback (SCAN-522)

parent 0f454e74
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,16 @@ throw (ni660Xsl::DAQException)
void BufferedAcquisition::get_scaled_buffer(void)
throw (ni660Xsl::DAQException)
{
// check samples number > 0
if (this->nb_samples_ == 0)
{
this->state_ = UNKNOWN;
throw ni660Xsl::DAQException("reading data failed",
"internal error - samples number failed to null value",
"BufferedAcquisition::get_scaled_buffer",
-1);
}
ni660Xsl::InScaledBuffer* sb = new ni660Xsl::InScaledBuffer(this->nb_samples_);
long _samples_read;
int err = DAQmxReadCounterF64(this->task_handle_, this->nb_samples_, this->timeout_,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment