02-16-2018 05:27 PM
Hi,
I am using a NI 9221 module to read 3 analog signals in three different channels. I am reading continuously from Channel 3 in the main vi. I have a state machine diagram with case structure. In one of the cases, I am reading analog signal from channel 1 and 2 inside a subVI. I know that I can use same module for different tasks in the same VI. But as I am getting outside of main VI once I go inside the subVI, I get resource reserved error. How to solve this problem? I don't need to read signal from Channel 3 for the time period when I am reading from channel 1 and 2. Is there a way to hold reading from channel 3 only for that particular period and then resume again later. Please let me know. Thanks for your help.
Best,
Nil
02-19-2018 12:59 PM
Hi Niloy,
Please note it is very hard to troubleshoot code without actually being able to see it
You are likely trying to create a new task before releasing the original one. If you request to use a resource (i.e. AI sample clock) but it is already being used in a different DAQmx task you will get this error.
Is there a specific reason you can't configure the top-level task to have all three channels, and then read the channels as needed?
Regards,