03-07-2008 04:05 AM
03-07-2008 03:54 PM
03-10-2008 03:48 AM - edited 03-10-2008 03:57 AM
03-10-2008 04:06 AM
03-10-2008 04:39 AM
Hi, Roberto,
Thank you very much! Your info is very helpful and I believe I can use part of it in my code. Just to confirm one thing. Is it correct to set RelativeTo property to DAQmx_Val_CurrReadPos and set OffSet to zero?
But I think you code may have a little problem. If ProcessSystemEvents()takes too much time and the task is finished when you return from it, you may leave some data unread in the buffer. Am I right? Anyway, I understand you point and thanks again for your tips.
David
03-10-2008 05:04 AM - edited 03-10-2008 05:06 AM
David,
you're right regarding the read attributes. Loosing some data should be an issue only in case you set RelativeTo property to DAQmx_Val_MostRecentSamp: in this case a "long" activity executed on ProcessSystemEvents may lead you to loose some data; to completely prevent this to happen (while keeping that attribute to DAQmx_Val_CurrReadPos), you may want to increase the buffer size using DAQmxCfgInputBuffer to increase it thus preventing a "loose data" error.
Rearging processing of system events, this is necessary in my application since I want the user to be able to stop the test via Esc or return key, more intuitive than the usual red push button (which indeed is also present! 😞 I have tailored the application so that no other user actions can happen and no other tasks are active at this time but I understand your warning and you can cut from the code if you don't need it. In this case, nevertheless, I would suggest you add a simple ProcessDrawEvents () to guarantee your graph is updated regularly.
03-10-2008 05:07 AM
03-10-2008 05:17 AM
03-10-2008 08:00 AM - edited 03-10-2008 08:03 AM
03-11-2008 07:50 PM