LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run DAQ 6009 in differents VIs at the same time

Solved!
Go to solution

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?

Download All
0 Kudos
Message 1 of 10
(3,185 Views)
Solution
Accepted by topic author rvenge

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(3,182 Views)

Thanks.

Appear the error (-50103), where can I see the meaning?

 

 

0 Kudos
Message 3 of 10
(3,179 Views)

HI rvenge,

 

right-click the error cluster, then choose "explain error"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,177 Views)

It's not a error window, see the image please.

0 Kudos
Message 5 of 10
(3,173 Views)

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.

0 Kudos
Message 6 of 10
(3,172 Views)

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,

 

 

Tom L.
Message 7 of 10
(3,154 Views)

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.

 

0 Kudos
Message 8 of 10
(3,129 Views)

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:

 

Queue Arrays.png

 

Regards,

Tom L.
0 Kudos
Message 9 of 10
(3,092 Views)

That looks like a great idea!. My LV version is 2010, I can't open your example, sorry.

 

Thanks a lot!

0 Kudos
Message 10 of 10
(3,080 Views)