Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a multiplexer with digital outputs

Hi there,
I am currently trying to use a 16-1 line multiplexer as my analog input to a DAQ6009 ,as I have 16 analog sensors and thus not enough analog input lines I am trying to use a multiplexer but I do not know how to program my Labview program to change the values the select inputs of the multiplexer recieve. As it is a 16-1 line multiplexer it has 4 select controls so therefore I need my program to count from 0000 to 1111 so that each value from each sensor can be read. Any help on how to achieve this would be much appreciated.
Many thanks,
James
0 Kudos
Message 1 of 17
(6,098 Views)

Easiest is probably a for loop with the iteration terminal wired to the data input of a DAQ Assistant. If you configure the DAQ Assistant for line ouput, you use the number to Boolean Array function between the iteration terminal and the data input. If you configure the DAQ Assistant for port output, then you use the Build Array function in between.

Message Edited by Dennis Knutson on 03-21-2007 07:27 PM

Message 2 of 17
(6,088 Views)
Hi,
Thanks for the reply it sound like it should work but would you be able to explain it to me in simplier terms, im not very experienced with Labview yet. Much appreciate the help.
Many thanks,
James
0 Kudos
Message 3 of 17
(6,081 Views)

What exactly is confusing. Is it the DAQ Assistants or the for loop? For help with DAQ, I would recomend going to http://zone.ni.com/devzone/cda/tut/p/id/5434. The DAQ Assistant allows you to get up and running quirckly with a variety of basic DAQ tasks. What I did was create on assistant for digital output/line mode (mux control). The other one is for analog input. When you drop an assistant on the block diagram, you will get a series of windows that will walk you through the process of setting things up.

The for loop has an interation terminal. This is the little 'i' in one corner. With each iteration of the loop, the count is incremented. The ount starts at zero. So, it is just a matter of converting this number to the data type that the DAQ Assistant requires. With this type of digital output, the assistant requires an array of Booleans (True/False) that define the logic states of the digital outputs. There is a built-in function in LabVIEW that will convert a number to a Boolean array.

For learning LabVIEW basics, one place to start is http://www.ni.com/academic/lv_training/how_learn_lv.htm.

Message Edited by Dennis Knutson on 03-22-2007 07:14 AM

0 Kudos
Message 4 of 17
(6,069 Views)
Thats great I totally understand how the loop works and the input value i that will change the boolean outputs and control the mux, what i dont understand is the second data aquisation block. Firstly I dont have the pink connectors that you have in your diagram (is this the error output or a task output). also I need the second data aquisation to display easch of the sesor outputs on different graphs. Thanks for all the help so far.
James
0 Kudos
Message 5 of 17
(6,054 Views)

The second DAQ Assistant is one for acquiring the analog signal. The wire between the two is the error in/error out connections. The colors of this wire changed with LabVIEW 8.x.

Use the Split Signal function to wire channels to separate charts.

0 Kudos
Message 6 of 17
(6,054 Views)

Hi again,

I tried running the program and it gave me an error. Im not sure if its something I setup wrong or what. I have attached the problem below, hopefully you might be able to tell me what has gone wrong.

Thanks again,

James

 

0 Kudos
Message 7 of 17
(6,024 Views)
You did nothing wrong. Sorry, I did. The Number to Boolean Array function creates an array with 32 elements because the 'i' is an I32 data type. Put an Array Subset between the  Number to Boolean Array and the Data input.
0 Kudos
Message 8 of 17
(6,017 Views)

Cheers,

That work a charm, i thought it was something that i had configured wrong with the daq assistant. Remember I was asking about plotting the output of each sensor on a seperate graph, how exactly did you say to do that? 

0 Kudos
Message 9 of 17
(6,011 Views)
The Split Signal function.
0 Kudos
Message 10 of 17
(6,007 Views)