08-15-2005 12:58 PM - edited 08-15-2005 12:58 PM
Message Edited by DaytonaEd on 08-15-2005 02:05 PM
08-16-2005 03:19 AM
You mention 4 separate tasks to control 4 channels: if you suspend 3 of the 4 tasks do you still get the error on the one remaining running task? If not it looks like you may have to implement a system of controlling shared access to the driver.
JR
08-16-2005 07:12 AM
Yesterday I started wondering if the problem might be with multiple-thread access to the driver. I was under the impression that the driver was thread-safe and I shouldn't have to worry about this. All four tasks are accessed about the same time by four different threads. After posting this yesterday I put a short delay and then a retry after getting the fault and monitored it, the retry always worked probably indicating this is the problem.
If this seems to be the culprit, then a critical section can be implemented and should eliminate the problem. This worries me a little because there are counters being read in addition to analog inputs by other threads - I'm wondering how extensive is this problem and are others dealing with it as well?
Ed
08-16-2005 07:16 AM
By the way, when I posting this yesterday I somehow came across a key sequence by accident that created 6 copies - no idea how that happened. Need to delete the others and can't locate a moderator to help, anybody know how to get rid of them?
Ed
08-16-2005 08:33 AM
One of the items on the Options drop-down (to the right of the title of every message) is "Report to a Moderator". Never tried it myself but it might be what you are looking for?
JR
08-17-2005 02:20 PM
Got rid of the duplicate posts by contacting the moderator - thanks. OK, the critical section eliminated the problem and the need for retries. Cannot understand why this would be necessary, each thread accesses a unique TaskHandle but at almost the same instant so it doesn't seem like this should cause a problem. Another detail - my application uses the Free theading model if that would affect this problem.
I have at least 3 other threads performing AI and Counter functions as well but they don't seem to be affected. Anyway, an understanding of why this was a problem would help me avoid it in the future.
Thanks, Ed
08-18-2005
08:51 AM
- last edited on
07-08-2025
03:12 PM
by
Content Cleaner
Ed,
I don't know why you would see this problem. It's possible it is a driver issue. You could try upgrading to the newest version of DAQmx.
https://www.ni.com/en/support/downloads/drivers/download.ni-daq-mx.html
-Jeff
08-18-2005 09:49 PM - edited 08-18-2005 09:49 PM
Message Edited by Tom W. on 08-18-2005 09:51 PM