01-10-2011
07:58 AM
- last edited on
09-16-2024
05:21 PM
by
Content Cleaner
I'm suddenly getting this error when I try to run my program. I've looked at the following page for guidance:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8kmSAC&l=en-US
I've followed the steps for case 1 (resetting the traditional DAQ driver), but I'm still getting the error. All the other cases involve problems with the program itself, and this can't be my cause because my program was running fine when I left it before the holidays! Does anyone know if there's anything else not involving my program that could be causing this error?
Thanks!
Christina
Solved! Go to Solution.
01-10-2011 09:06 AM
Hi Christina,
this error usually occurs when you run the task from one place, and you run the same kind of task on the same device from other place.
For example, you are running AI measurement in MAX, and you try to run your application with AI. To, you run one DAQ Assistant in one part of your code, and somewhere else you call other DAQ Assistant which calls the same kind of task on the same device.
In your case, if you didn't change your program, close any other application accessign the DAQ board - especially measurement in MAX.
regards,
stefo
01-10-2011 10:33 AM
I can't see anywhere else where the device is being used. Let me provide some more details now that I've been messing around with it this afternoon. I'm sending signals to two analog channels in a for loop. If the first iteration sends a signal to both channels, they work fine, but if I only send a signal to one of the two channels on the next iteration I get the error. Similarly, if the first iteration sends a signal to channel 0 and not channel 1 (or vice versa) this works fine, but if I try to send a signal to the unused channel in the next iteration I get the error. I know this sounds like a problem with not properly starting or clearing the DAQmx, but I swear this loop has worked fine for months! I've attached the code for reference, even though it's unchanged from when it worked...
01-11-2011 01:37 AM
At glance I don't see anything in your program. I guess some other program might be running.
However, I would definitely create and clear tasks just once. At the beginning and at the end - this could theoretically help you. I would also suggest you to split your big for loop into 2 loops.
btw, which task throws you the error?
01-11-2011 06:12 AM
When I changed the program such that I only create and clear the task once I'm miraculously no longer getting the error! I have no idea why my program worked before and only now required this change, but I'm just happy that it's working again 🙂 Thanks so much for your help!
01-11-2011 06:36 AM
hm, it seems that task wasn't cleared properly. This can happen sometimes, though it shouldn't. In general it is good idea to keep opening and closing references as rarely as possible. Beside you eliminate some potentional issues, rour code might run much faster.
i'm glad it works,
stefo
08-06-2021 03:51 AM
I'm having the same problem....could you please share your code that's fixed?
How did you set up having only 1 start and clear task but still simultaneously read 2 different channels?
(I want to multiply the different channel values by different calibration factors, so I can't select multiple channels for the same start and read task.)
Thanks!
04-15-2025 02:24 AM
Did you find a solution?