LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

share same resource across different VI's

Hi all, 

I am trying to acquire to Accerometer sensor data using cDAQ-9174 chassies thro NI 9234 module (Channel 0). I am using the same channel across different VI's to view the waveform graph. I get an error saying the resource is reserved by another task. How do i get over this.

Regards,
KM
0 Kudos
Message 1 of 5
(2,709 Views)

hi, i dont think you can access the same channel concurrently from multiple vis, but you could pass the reference around, and have to take care that two vis dont block each other, each vi would have its own part of the whole data then.

 

best would be to aquire the data in one loop and pass/access the data to/from another loop which controls your UI.

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 2 of 5
(2,694 Views)

You want a single acquisition loop and then send the data to your other loops via a Queue or User Event.  Note that if you use the queue, you need different queues for each loop that will want to read it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(2,673 Views)

Hi all,

Thanks for your time, sorry if i was not clear about my problem.

I have two different VI's. I am trying to read the accelerometer sensor signal from Ch0 of Module 9234 across this 2 diff VI's at the same time. 

Basically i am calling this two VI's in the SubPanel. This is a problem since both the VI's are sharing the same resource, it throws an error.

 

Regards,
KM
0 Kudos
Message 4 of 5
(2,667 Views)

Perhaps you did not understand the solution.

 

You cannot have two DAQmx tasks using the same resource.  In this case, CH0 of your 9234.  You what you want to do if have 1 task to read it and then send that data to whoever needs it.  You have an architecture issue.  Break the reading of the DAQ into a seperate module (parallel VI) that does nothing but read the DAQ and send the data to your two VIs that need the data via Queues or a User Event.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 5
(2,657 Views)