10-26-2013 06:26 AM
Hi, I need to use the DAQ 6009 in two or more differents subVIs at te same time.
I have a main VI that runs two subVIs in parallel. Both subVI reads two different channels.
The problem is when a subVI "open" or inizializes the DAQ before others and It just read two channels.
Can I use the DAQ in subVIs at te same time?
Solved! Go to Solution.
10-26-2013 06:33 AM
Hi rvenge,
you cannot share a single resource (like your USB6009 AI channels) in more than one place.
Solution:
Create one VI that handles all AI channels and stores the current values in a place accessible by other VIs (notifier, global variables, FGV...). All other VIs can access the data at that place...
10-26-2013 06:46 AM
Thanks.
Appear the error (-50103), where can I see the meaning?
10-26-2013 06:47 AM
10-26-2013 07:05 AM
It's not a error window, see the image please.
10-26-2013 07:11 AM - edited 10-26-2013 07:13 AM
Then if I need three queues to operate with the DAQ of two channels, I will need twelve queues to eight channels?
This is crazy.
10-26-2013 10:43 AM
Hello rvenge,
As for your first question- you can look up errors via Help>>Explain error... Some errors will have multiple listings, which means that different scenarios or toolkits may return the same error code for a different reason. Refer to this KnowledgeBase for more information on common DAQmx errors:
KnowledgeBase 2XQEAPQJ: Common NI-DAQmx Error Codes and Solutions: Codes -50103 and -200000 to -200299
http://digital.ni.com/public.nsf/allkb/001DA4DB6A31CF8886256D33006FA857
On to the queues- it's not clear what you're trying to do here- it looks like you're doing some operations on the two input channels and then enqueuing them as well as the output of the operation. I think you should take a step back and look at why you need to operate on the data asynchronously to begin with- do you need to stream all of your data from each channel to separate VIs? Would it be possible to process the data and then send the final value on to its destination? If you do need to do this sort of operation, then yes, you'll need one queue for each location you want to read in. I would recommend creating an Action Engine Queue handler to isolate the data transfer mechanism from your acquisition code rather than wiring everything through as you have.
Regards,
10-27-2013 03:58 AM
Thanks a lot Outlaw.
If Ican't use differents subVIs I have to start again.
I don't know how action engine queue are created, if you could give me that information I'll be grateful.
10-28-2013 12:52 PM
Hi rvenge,
After taking another look at your stated needs and current VI, my impression is that a queue handler might be more than you need and you'd likely find that it would become unmaintainable quickly.
Instead, storing and accessing the queues in arrays will keep your block diagram neater and easier to develop without adding too much complexity. Something like this might work:
Regards,
10-28-2013 01:26 PM
That looks like a great idea!. My LV version is 2010, I can't open your example, sorry.
Thanks a lot!