02-08-2006 03:48 PM
02-09-2006 05:50 PM
Hi Mattyd,
The command is going to take the 3s to execute regardless of how you try to
work around it, because it is waiting for an operation to complete. That
means that if you want to run something else at the same time then you will
need to create a separate thread and have that running in parallel to the DAQmx
code.
If you were using LabVIEW I could show you in a heartbeat; unfortunately, I'm
not as familiar with multithreading in VB.
02-09-2006 06:17 PM - edited 02-09-2006 06:17 PM
Hi Otis,
surely there is a way to check for data in the buffer without holding up a thread.
I cant belive the lack of support for VB.
Personally i dont use VB but on this job i have to. I get the same response from NI in Australia.
I wish they did not provide what they cannot support.
Whats the deal with Starting & Stopping tasks anyway.
If i wnat to read an analogue value from a DAQ card why cant i just get the damn value without
the overhead of starting and stopping tasks ?
Anyway ive probably done myself out of an answer in flaming NI.
thanks for your response.
Message Edited by MAttyd on 02-09-2006 06:25 PM
Message Edited by MAttyd on 02-09-2006 06:25 PM
02-09-2006 06:17 PM
Hi Otis,
is there
02-09-2006 06:17 PM
Hi Otis,
is there not
02-09-2006 06:17 PM
Hi Otis,
is there not a way
02-09-2006 06:17 PM
Hi Otis,
is there not a way to set the
02-09-2006 06:28 PM
02-10-2006 09:38 AM
Assuming you're doing buiffered event counting, you can monitor the status of the buffer without blocking by using the Read Properties. I don't know the exact VB syntax, put the equivalent C funtion you need is:
DAQmxGetReadAvailSampPerChan(TaskHandle taskHandle, uInt32 *data)
You can use this function to poll within a loop and then call read only after a certain number of samples are available. You can also continue to use the Read function but pass in a timeout of 0 or pass -1 for the number of samples to read. Passing -1 will tell the driver to read all samples that are currently available and then return. Depending on the method, you'll either have to handle timeout errors or check the actual number of samples read to see if you actually read anything, but neither method will block until samples become available. You could also register a callback funtion for the Every N Samples Acquired Into Buffer Event and perform your read in that callback. I hope this helps.
02-10-2006 03:49 PM
Thanks for the response reddog.
i cant find a reference to the function "DAQmxGetReadAvailSampPerChan" in the help files i have for version 8.
any ideas ?