LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx interactive read

Good morning i'm new with DAQmx, until yesterday i used traditional DAQ.

I must to do some readings in a while loop that i stop when i need.

I read single channels.

If in prova 3 esempi i use three subroutine with the same filename it works good, if i change one subroutine with a perfect copy but with file name different, i've got an error 50103 "The specified resource is reserved. The operation could not be completed as specified."

I end my ideas, i need help.

Thank you

0 Kudos
Message 1 of 6
(2,992 Views)

Buongiorno Gigatrek,

 

you are trying to read 3 channels from one module in your cDAQ chassis - but you are trying to allocate them in 3 different DAQmx tasks: this will not work (with a MUX device) as you have learned by now!

 

Put those three channels into one task!

(LabVIEW comes with a lot of example VIs, there are also examples showing how to use more than just one channel.)

 

On your "Prova 3" VI: don't create and kill DAQmx task in each iteration of your loop. This is also explained in the example VIs!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,976 Views)

I had the problem that i cant' read vith multichannel read and the problem was explained to me by NI support.

The new releases of Labview work in parallel, so if yuo put three single channel read with relative tasks in three row from top to bottom, they go simultaneusly.

I solve the problem using a flat sequence with one single channel red in every flat frame.

 

Thank you

0 Kudos
Message 3 of 6
(2,928 Views)

No, you did not solve the problem. You just created a bad workaround using flat sequence structure. This is not a proper way to use DAQmx. You need to specify multi channels in a single task, and read an array using the proper polymorphic instance of the DAQmx Read functions. Did you look at the DAQmx examples?

0 Kudos
Message 4 of 6
(2,913 Views)

GIGATREK wrote:  I solve the problem using a flat sequence with one single channel red in every flat frame.

That is a horrible solution.  There are many things wrong with your setup.  Here is how you should be doing it.  Notice we create one task to handle all of the channels.  Then we read all of the channels together and do the same math on the arrays.  This makes the program a lot more scalable and easier to maintain.  And also notice that we have the creation before the main loop and we stop after that loop.  This makes life a lot easier on the hardware and the drivers.  You will also get better readings faster.


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
0 Kudos
Message 5 of 6
(2,904 Views)

Thank you crossrulz  for your answer but i wrote that i can't use multiple reading.

Now i know multichannel read and i use it in a subVI but in other i can't.

I need slow reading and the way that i use work perfectly.

Probably if i need speedy reading or waveform analisys, i'm agree with you that the best way to use DAQmx is multiple read.

 

Best regards

0 Kudos
Message 6 of 6
(2,895 Views)