Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

50103 error with multiple DAQ Assistant Express VIs

Hi,
 
I have an application where I am using 3 M-series modules in a CompactDAQ backplane to capture 5 different signals in a timed while loop. 
 
I have configured the DAQ Express Assistant Express VI to gather 3 analog input signals using virtual channels on an NI 9205 module (in slot 3 of the backplane).  If that's all I do in the loop, everything is wonderful and the application screams along.  I can take hundreds of samples per second.
 
I then add a 2nd DAQ Express Assistant Express VI pointing to either of the other two modules -- an NI 9219 module (in slot 2) where the Express VI is configured to measure a resistance value, or an NI 9401 module where the Express VI is configured to measure edge counts (that module is in slot 6 of the CompactDAQ backplane).
 
In either case I start getting 50103 errors.  So I did my homework and found a KnowledgeBase article that discusses what is happening ("Causes of NI-DAQmx Error 50103 "The Specified Resource is Reserved").  That was very helpful.  I tried connecting the Error Out of the first VI to the Error In of the 2nd VI and the error message went away.
 
However...  my application now runs *extremely* slowly.  Instead of being able to take hundreds of samples (loop executions) per second, I now can take only a sample every 2 - 3 seconds!
 
I thought the problem might have to do with the starting and stopping of the Express VIs - so I have been playing with connecting the Stop input to the boolean switch used to stop the loop as suggested in various template VIs.  This does not solve the problem though - actually, it causes the 50103 error to come back.  I really do think it has to do with the starting and stopping of the VIs though - or perhaps something subtle having to do with the modules being in a CompactDAQ backplane and USB communications.
 
So I am at an impasse.  If anyone has any insight into what is going on and what I should try next, I will be more than grateful.
 
Thanks in advance for your help.
Message 1 of 9
(5,042 Views)
Hi cbp,

You've correctly found the root cause of your problem -- because the CompactDAQ backplane only contains one analog input timing engine, you can only run one analog input task at a time.  Wiring the error terminals to sequence them makes the error go away, but it requires each of your two tasks to start and stop every time through the loop, which is time-consuming, particularly for the 9219.  The best solution is probably to put all of your analog input channels (voltage and resistance) in the same task (and Express VI), and make sure that you're set up for a continuous acquisition.  You should then be able to run your loop at the same rate as when you only use the 9205s.

You also referred to a counter task causing difficulties; that task should not use the same resources as the analog input tasks, so I wouldn't expect the same error.  If after combining the AI tasks an error still occurs with the edge count task, please post the specifics of that error message and we'll troubleshoot it also.

Regards,
Kyle
Message 2 of 9
(5,020 Views)

Hi Kyle,

Thanks for the quick response.  I was afraid that the problem might lie in the use of the CompactDAQ backplane.  So now I've got to see if I can move the resistance measurement being made on the 9219 over to the 9205, or the three voltage measurements being made on the 9205 over to the 9219.

Thanks again!

0 Kudos
Message 3 of 9
(5,014 Views)
Hi cbp,

Wait!  You can absolutely use the modules and measurement types that you already have.  You can add both voltage channels from the 9205 and resistance channels from the 9219 into the same DAQ Assistant Express VI.  CompactDAQ is designed specifically to use a mixed set of modules and measurement types, and will automatically synchronize and operate both modules in the same task.  Just click the Add Channels button, select the measurement type that you want, and select channels from the correct module.

I just tried out a similar case with simulated devices; a screenshot is attached.

Regards,
Kyle


Message 4 of 9
(5,010 Views)
Hi Kyle,
 
I see I should have spent more time with the documentation for the DAQ Assistant Express VI!  Your advice was right on and works great.
 
I now have all of the AI sampling taking place in one task (using the 9219 and the 9205), and the edge counting (using the 9401) taking place in another task -- all within the timed while loop.  The two sampling tasks can now be sequenced using Error In/Out -- or not (it doesn't seem to matter -- which makes sense to me as the tasks are independent of each other if I understand things correctly).  I also have the Stop input tied to the while loop control boolean which should keep the tasks from being started and stopped on each loop iteration.
 
The loop/sample time is now just over 500 ms - better by a factor of 10 from before (and quite acceptable for what I need to accomplish), but still a lot slower than I would have thought possible.  If I try to shave it down any further, I get loop timing errors and things slow way down.  Am I now getting down to the level where being single threaded through the common AI engine of the CompactDAQ backplane is the limiting factor?
 
My thanks again for a right-on and timely response!
 
Regards, Craig
0 Kudos
Message 5 of 9
(4,993 Views)
Hi Craig,

Post the sampling rate, number of samples, etc. for the AI task and also timing parameters for the edge counting task, or even upload your VI, and we'll see how fast it should be running.  The CompactDAQ Advisor will show you how fast to expect your AI task to run.

Regards,
Kyle
0 Kudos
Message 6 of 9
(4,982 Views)

Hi Kyle,

 

A question for your advice. I have 2 DAQ assistant Express in a loop to generate digital signal to on/off valve. DAQ assistant Express A is linked to channel 0 and 1 while another DAW assistant Express B is linked to channel 2 and 3. When the program runs, when DAQ assistant Express A is activated, it works well. But, when DAQ assistant Express B is activated, digital signal is generated for channel 0 instead of 2 and 3.

 

Please help.

 

Thanks n regards.

0 Kudos
Message 7 of 9
(4,303 Views)

You've posted to an old and unrelated thread. You should have posted a new question.

 

Why don't you attach your code. I have never used the DAQ Assistant but what you are decribing does not seem possible.

0 Kudos
Message 8 of 9
(4,295 Views)

Hi Blueberet,

 

Thanks for posting and welcome to the NI forums!  I agree with Dennis that posting your code might be helpful. 

 

I would imagine that you have the second DAQ Assistant configured in an undesirable way.  Each DAQ Assistant is associated with a task, so running two static (i.e. On Demand) digital I/O tasks at the same time should not be a problem in itself--does the second DAQ Assistant work independently of the first?  I believe if you are writing to the appropriate lines, the driver will mask out the unused lines so you can do software-timed updates in parallel tasks.

 

If you were using hardware-timing or triggering on the tasks (I'm not sure if this is possible for you since I don't know which hardware you are using), then you would need to consolidate the Digital I/O into one DAQ Assistant.  If you are not receiving an error message then I don't think this is the problem you are experiencing. 

 

-John 

John Passiak
0 Kudos
Message 9 of 9
(4,274 Views)