LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading analog input and synchronize it with digital data

Hello

I have to output 5 digital outputs to derive 32 LEDs in sequence. That is already taken care of. The sequence is tested and its working fine with a delay of 0.5s between the sequence.

The LEDs will be attached to 32 plastic optical fibre (POF)  deformation sensor. The other end of the 32 POF will be connected to transimpedance amplifier and then to an optical meter. The optical meter has a BNC analogue output that to be taken to DAQ card.

Now what I need is to read the analogue input from the optical meter (one channel only), display the value and store it in a file.

The analogue input should read 32 reading corresponding to the 32 LEDs, then store the data to a measurement or excel file, and rpeat the process again.

I.e. once the LED1 is flashed, I need to read its corresponding analogue value, then the 2nd and so on till the 32, and then store the 32 values in a file. And repeat the process gain after the 0.5s delay.

I have done a basic labview to do this. I think I can put the two programs in one and run them
However, I am not sure how to do the synchronization between each LED (light time) and the analogue reading value of it.

Can you offer any help?

Attached is the labview program done in version 7.1.
Download All
0 Kudos
Message 1 of 10
(3,838 Views)

Hello Love,

I'd just like to clarify exactly what you want to achieve.

At the moment you are powering 32 LEDs from 5 DIO lines from you NI DAQ card. Are you powering multiple LEDs from a single line or are they multiplexed in some way?

Every 500ms you want to drive the 5 digital signal to the LEDs and at the same time read the single analogue signal from your sensor. Is this correct?

Also what NI DAQ card are you using?

Cheers

Tom | NIUK

0 Kudos
Message 2 of 10
(3,820 Views)

Hi Tom,

 

The 5 DIO is deriving 2 decoders each handling 16 LEDs, so 4 lines addresses the decoders and the 5th as selector to enable the 32 LEDs in sequence.

 

It is not necessarily the time will be 500ms, it will be either, 100ms or 10ms or in between these two values.

 

I have 6024E and 6071E.

 

Cheers

 

Love

0 Kudos
Message 3 of 10
(3,817 Views)

Hello Love,

With the NI PCI-6071E your best bet would be to generate a clock a pulse width of your choice (500, 50 or 10ms) and then use this signal as your timing source for the other DAQmx tasks (the digital output and the analogue input.)

Examples of how to generate a clock, and how to use external clock timing for Analogue and Digital tasks can be found the LabVIEW Example Finder under Hardware Input & Output >> DAQmx.

Cheers

Tom | NIUK

 

 

0 Kudos
Message 4 of 10
(3,812 Views)

Hi Tom,

Thanks for your support.

Could you plz point out to a certain example, and how I can link it to my program.

Thanks

 

 

Message Edited by Love Electronics on 08-10-2007 05:25 AM

0 Kudos
Message 5 of 10
(3,811 Views)

Hello,

Using an external line to clock an Analogue Input task:

Hardware Input & Output >> DAQmx >> Analogue Measurements >> Voltage >> Acq&Graph Voltage - Ext Clk.vi

Using an external line to clock an Digital Output task:

Hardware Input & Output >> DAQmx >> Digital Generation >> Write Dig Channel - Ext Clk.vi

To generate a clock:

Hardware Input & Output >> DAQmx >>Generating Digital Pulses >> Gen Dig Pulse Train - Continuous.vi.


Cheers

Tom | NIUK

0 Kudos
Message 6 of 10
(3,802 Views)

Just to add a tidbit or two.  Remember that there may be some physical response time between firing the digital bit to turn on the LED and having your sensor reach its steady-state response value.  This will limit your max sequencing speed.

As far as I know, your E-series boards don't support hardware timed digital output.  So your digital output sequencing will need to be software timed.  I think you might also use software timing for your Analog input.  That being the case, I would make sure the software timing delay comes between the digital output and the analog input.  As soon as you take an analog input reading, you can immediately produce the next digital output.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 7 of 10
(3,796 Views)

Hi Kevin,

 

Thanks for the tips, but I am kinda lost here. I am not expert in Labview so you could imagine.

 

How to do a “software timing for your Analog input”. What I understand from the E series issue is that it depend on the speed and memory of the PC.

 

I qoute: “That being the case, I would make sure the software timing delay comes between the digital output and the analog input.” Does this mean to connect the delay of the DIO sequence to the AI input as well.

 

Thanks

0 Kudos
Message 8 of 10
(3,774 Views)

Hi Tom,

Using an external line to clock an Digital Output task:

Hardware Input & Output >> DAQmx >> Digital Generation >> Write Dig Channel - Ext Clk.vi

This example is not applicable to my DAQ cards!!

Have open the exmple finder and it shows that this example is not supported by both cards.

0 Kudos
Message 9 of 10
(3,744 Views)

If you configure a DAQmx analog input task without calling DAQmx Timing to identify a hardware timing signal, then the task will be "software timed."  In other words, each time you make a software call to DAQmx Read, the board will immediately sample all the AI channels and return this data to you.

With regard to sequencing, I meant something along the following lines.  You'll have a repetive loop.  Inside this loop, you'd first generate your digital output pattern.  Next you would wait for some short finite time to give your sensors a chance to fully respond.  Then you'd take your next analog sample.  Having finished this, your loop can progress to the next iteration and change the digital output pattern immediately.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 10 of 10
(3,728 Views)