Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplexing a 128 to 1 MUX ( Four 32 to 1 mux's with their outputs to a 4 to 1 mux.

I have designed a 128 to 1 multiplexer using four ADG732 (32 to 1) multiplexers with their outputs connected to a 4 to 1 multiplexer (ADG1404).  I have a PXI 6030E which I am positive has digital I/O lines.  There are 5 address lines on each mux (A0-A4).  I will connect these address lines to the I/O pins on my 6030E.  There is an enable on each mux which when set HIGH will turn the multiplexer "on".  When it is LOW all of the switched are shut off.  I want to set the enable on the first mux HIGH and switch through 25 channels, then turn the 2nd mux on and switch all 25 channels etc. until 100 channels have been switched through.  I can use DAQ assistant with a for loop to switch through the channels on each mux.  The problem I am having is switching the enables on and off for each mux. so that I can select which mux is enabled.  My idea is to create another for loop that will have the sole purpose of switching each mux on and off.  All suggestions are welcomed.

 

Thank you,

EngineeringEE

Download All
0 Kudos
Message 1 of 12
(19,387 Views)

You would use nested for loops - one inside the other.

0 Kudos
Message 2 of 12
(19,375 Views)

I see.  So, the inner for loop will switch the channels on the 32 to 1s, and the outter for loop will switch which mux is on.

0 Kudos
Message 3 of 12
(19,372 Views)

Hello Dennis,

 

I have attached the VI created.  As stated above:

 

"I have designed a 128 to 1 multiplexer using four ADG732 (32 to 1) multiplexers with their outputs connected to a 4 to 1 multiplexer (ADG1404).  I have a PXI 6030E which I am positive has digital I/O lines.  There are 5 address lines on each mux (A0-A4).  I will connect these address lines to the I/O pins on my 6030E.  There is an enable on each mux which when set HIGH will turn the multiplexer "on".  When it is LOW all of the switched are shut off.  I want to set the enable on the first mux HIGH and switch through 32 channels, then turn the 2nd mux on and switch all 32 channels etc. until 128 channels have been switched through.  I can use DAQ assistant with a for loop to switch through the channels on each mux.  The problem I am having is switching the enables on and off for each mux. so that I can select which mux is enabled.  My idea is to create another for loop that will have the sole purpose of switching each mux on and off.  All suggestions are welcomed."

 

I receive an error message which can be seen in the JPEG image file attached.  I am pretty sure that I have configured DAQ assistant correctly.  I am using a NI 6251 USB.  Any suggestions would be helpful!

 

Thank you

S.L.

Download All
0 Kudos
Message 4 of 12
(19,298 Views)

S.L.-

 

This error is occurring because you have fewer task channels than you do channels of data.  Look at this link: http://digital.ni.com/public.nsf/allkb/6EF311E502936B9286256D27007CF9EC?OpenDocument.

 

It might help if you posted a wiring schematic of your intended setup, as I am unfamiliar with your MUXs.

 

Thanks,

 

Sean

 

 

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 5 of 12
(19,281 Views)

Hello Sean,

 

The output of the 32:1 mux's are connected to the switches (inputs) on the 4:1.  I connected the address lines of the 32:1 mux's.  So the first 32:1 mux has its address lines connected to the second then the second to the third then the third to the fourth.  The address lines and enable lines for the 32:1 and the 4:1 are connected to a NI 6527 Digital I/O.

If you need anymore details please let me know.   

I do not understand how to fix the problem.  I am supplying data for each address line and input.

 

Thank you for your help,

s.L.

0 Kudos
Message 6 of 12
(19,277 Views)

S.L.-

 

So you have the enable lines of the MUX connected to the digital out of the 6527?  I am unfamiliar with the MUXs, so what are the address lines for and are they connected to an input or an output of the device?  Let me know as I will try to discuss your issue with other engineers tomorrow morning.

 

Thanks,

 

Sean

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 7 of 12
(19,259 Views)

Hi Sean,

 

So, the enable lines are used to select which 32:1 MUX is on or off.  If the enable is LOW all the switches are off.  If it is HIGH the MUX is on.  They are connected to the Digital Outputs of the 6527 like you said.  The address lines (5 bits: A0-A4)  are to control which switch (S1..S2..S3 etc.) is selected on the 32:1 MUX and are also connected to the output of the 6527.  I have updated my program and attached it to this message.

 

NEW PROGRAM:

 

In the new program the outer for loop is to control the 4:1 MUX.  The inner for loop is to control the 32:1 switching.  The problem I am having now is selecting which MUX is on or off and synchronizing this action with the switching of my 32:1 MUX.  Meaning, I want the first 32:1 mux to be switched on, then to switch through all 32 channels.  Next switch the the second 32:1 mux, switch through all 32 channel. etc. until all 128 channels have been switched.  In the new program I am using an arduino to control the ENABLE lines.  I use VISA to automatically write a value through the serial port to turn each MUX on individually and one at a time.  The code for the arduino can be seen below:

 

const int ledPin = 13; // the pin that the LED is attached to
int incomingByte;      // a variable to read incoming serial data into

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
}

void loop() {
  digitalWrite(2,HIGH);
  if (Serial.available() > 0) {                  // see if there's incoming serial data.
    incomingByte = Serial.read();                // read the oldest byte in the serial buffer.
    if (incomingByte == '0') {
      digitalWrite(ledPin, HIGH);                // if it's a 0, turn on the LED.
      digitalWrite(3,HIGH);                      // 32:1 Mux #1 ON.
    }
    if (incomingByte == '1') {                   // if it's an 1 turn off the LED:
      digitalWrite(ledPin, LOW);
      digitalWrite(4,HIGH);                      // 32:1 Mux #2 ON
    }
    if (incomingByte == '2') {                   // if it's a 2 turn off the LED:
      digitalWrite(ledPin, HIGH);
      digitalWrite(5,HIGH);                      // 32:1 Mux #3 ON
    }
    if (incomingByte == '3') {                   // if it's a 3 turn off the LED:
      digitalWrite(ledPin, LOW);
      digitalWrite(6,HIGH);   //32:1 Mux #4 ON
    }
  }
}

 

The program is turning the first mux on and switching through all 128 channels, the the third and switching through all 128 channels etc.  I do not want it to do this because this is part of a long term experiment.  Sorting the data will be a nightmare if I leave it this way.  I hope I was able to answer the questions.

 

Thank you for your help,

S.L.

 

 

 

0 Kudos
Message 8 of 12
(19,255 Views)

S.L.

 

I am looking into this test setup, but knowing what you are trying to do will definitely help me figure out why the program you have written is not working.  I will get back with you ASAP!

 

Thanks,

 

Sean

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 9 of 12
(19,241 Views)

Hi Sean.

 

The purpose is to monitor 128 devices for an accelerated lifetime study.  The voltage will be measured on each device from the output of the wheatstone bridge (as desbribed in the previous thread).  The program is suppose to Enable/turn on the 1st 32:1 mux, switch to the first switch (S1) on the enabled 32:1 mux and take a voltage measurement.  Then repeat this process until all 32 channels have been switched to and a voltage measurement taken for each device.  This process will then repeat for the 2nd, 3rd, and 4th 32:1 muxs.  I want this process to repeat every hour meaning I only want to take a measurement every hour.  The problem I am having is synchronizing the ENABLE lines of my 32:1 muxs with the switching of my 4:1 muxs.  It is a complicated set up I know.  What is happening is all 128 channels are being switched through while the first mux is on.  Then 128 channels when the 2nd mux is on etc.  Sorry for any confusion.  I tried my best to describe in detail everything.

 

Thank you

S.L.

0 Kudos
Message 10 of 12
(19,238 Views)