LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read a multiplexed voltage signal

Hi,

 

I have a 16 to 1 multiplexer which feeds its analog output to a PCI acquistion card connected to labview. My Question is:

 

How to demultiplex the analog output of the external 16 to 1 multiplexer? 

 

I can control the external multiplexer by 4 digital outputs from the PCI card using labview. But I do not know how to implement an analog "demultiplexer" in labview which should be synchronized with the external 16 to 1 multiplexer using the 4 digial output. 

 

Any ideas are greatly appreciated,

 

Best,

mdaghrah

0 Kudos
Message 1 of 7
(4,121 Views)

Personally, I would just go with something like the PCI-6010.  It has 16 Analog Inputs that you can read with a single DAQmx task.

 

But if you insist on going the complicated route, you need to sample your MUX select lines as well with analog inputs.  By looking at the state of the measured MUX select lines, you know which channel to put that voltage reading.


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 2 of 7
(4,088 Views)

Thanks Crossrulz, I already have my hardware so I cannot change. is there a way to implement something like a 1 to 16 analog demultiplexer?  Could you be kind to decribe the long possible way?

 

Perhaps this is easier done on MATLAB?

 

Best,

Muhammad

0 Kudos
Message 3 of 7
(4,068 Views)
If you have a better grasp of matlab, use it but the task is the same. You need to assign the voltage you read to the appropriate element in an array. When the mux is set for channel 0, update element 0 in a 1D array, etc. Use a shift register to accumulate a 2D array. This is essentially how DAQmx does it with an n channel, n sample read except your code will run much slower.
0 Kudos
Message 4 of 7
(4,060 Views)

@mdaghrah wrote:

Thanks Crossrulz, I already have my hardware so I cannot change.


That is never a good excuse.  Let me put it this way.  If you get paid $25/hour, you have 13 hours of your time to get this difficult way to work in order to be cheaper than just buying the card that does the job for you.  And if you are doing this for a company, they are probably charging more around $100/hour to the customer.  That gives you 4 hours.  And I'm pretty sure you have already burned that just asking how to do this here on the forum.

Yes, my charge numbers are quite low.  So those hours are actually more than you probably will actually have.

 


@mdaghrah wrote:

Could you be kind to decribe the long possible way?


You have to sample the MUX address lines along with the mux output voltage.  For each sample, you then have to decode the MUX address lines to figure out which location in your array to put the analog data.  Use shift registers to keep you data in.


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 7
(4,049 Views)
If you have the low level digital write and analog read inside a for loop, the the auto-indexing feature will automatically create a 16 element 1D array.
0 Kudos
Message 6 of 7
(4,043 Views)

@Dennis_Knutson wrote:
If you have the low level digital write and analog read inside a for loop, the the auto-indexing feature will automatically create a 16 element 1D array.

Good idea.  The sampling rate would be horribly slow (which you are probably stuck with anyways due to the nature of the digital IO).  You also need to add a small delay to allow the mux to actually switch before reading the voltage.


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 7 of 7
(4,034 Views)