LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Looping channels on the NI 9214

Hi,

 

Can you help?

 

What I need to do, without using a setup in MAX(if I can avoid it), is to read
3 channels of the NI 9214 and store the result of each to a file.

 

If the first channel is given and the number of channels to be read is also given and so loop to each channel and store the temperature in my case to a file.

 

I can manually do one channel at a time but not the looping bit.

 

Thanks

Simon

0 Kudos
Message 1 of 6
(4,532 Views)

Hi Simon,

 

Have you taken a look at the examples in the help dropdown? There are some examples of multi-channel acquisition in there. Are you using the DAQmx drivers or writing this yourself?

 

Seasons Greetings,

Gavin

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

Gavin,

Thanks for your response.

 

I am using the example ContThrmcplSamps-IntClk.prj as the basis for my own single read using a very simple UIR I did myself.

 

Now what I need to do is supply the starting channel and the number of channels to be read and display each value in turn.

 

I thought for loop would do the job but it is crashing and I cannot see why.

 

Thanks

Simon

0 Kudos
Message 3 of 6
(4,496 Views)

That example program can actually read from multiple channels at a time: you can test this feature simply by modifying the channel list so that it look like "cDAQ1Mod1/ai0:2" or whichever combination of channels you want (my string will read channels 0 through 2: this document explains how to create lists or ranges of channels to pass to DAQmx functions)

You can use this structure as a framework to adapt your application to multichannel acquisition.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(4,487 Views)

If for some reason the multichannel solution is not feasible, you should post your code so that we can look at it and see what's happening. Do not forget to report also any error code you recive while running the code.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 6
(4,477 Views)

Roberto,

 

Excellent, it looks like I have the foundation to continue and expand on this.

 

It works with channels hard coded, as you pointed out with a simple display of two temperatures to a popup,

so now to make in flexible and what I originally set out to do, a job for the New Year.

 

Thank you

Simon

0 Kudos
Message 6 of 6
(4,446 Views)