LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 analog input and 1 digital

hi,

i attach the vi..

in the following vi i have a problem with the analogs..

when i'm running the vi.. At the results.. olly one of the analog will show me the measuerements..

at the one time maybe the clock analog will give me the results..

and the other analog nothing.. and opposites..

why they don't work together? and and the 2 analog give measurements at the same time..

andrikos
0 Kudos
Message 1 of 10
(3,216 Views)
Have you looked at your error clusters?  Assuming you're not changing the default value of the channel names, one of your analog cycles will not work, as you are trying to acquire data from the same channel in both cases.  You should get an error in one your analog code modules because the channel is already reserved for data collection.
0 Kudos
Message 2 of 10
(3,211 Views)
hi,

at the vi,

i have a device that collect measurements and has got anather one sensor which collects measurements again..

i have the device which it works with its own clock (external clock). we read the sensor with analog input

i read the device input with digital and i read the external clock with the analog

i want when the device stop to collect, to stop all the input to collect data

what is the problem in the vi??

why i have problem with analog?

andrikos


0 Kudos
Message 3 of 10
(3,207 Views)
The problem is simple. You cannot run more than one analog input task at the same time. You have two. Combine both channels into a single task and your analog will run.
 
Other problems are: 1) There is absolutely no reason to use a sequence structure. 2) You could put the digital read in the same loop as your analog read. 3) You are throwing away data (and data that you never see), because you have the indicators outside the while loops. By doing this, you only get the results of the very last iteration of the while loop.
0 Kudos
Message 4 of 10
(3,197 Views)
hi,

i attach the new attach

how can i get the data from the 2 waveforms in a 2 2-D array?

the one array for the waverofm 2 and the other for the waveform 3

because i can't use the "Get Waveform Components"

y?

andrikos
0 Kudos
Message 5 of 10
(3,176 Views)

Hi andrikos,

use the "convert from dynamic data" function from the express palette and select "1D Array of Waveform", you can index the array and then you can use the "Get Waveform Components" function.

Or you can use the index array function directly after your waveform variable.

I would prefer a direct wire instead of the local valriable.

Mike



Message Edited by MikeS81 on 04-20-2008 06:24 PM
0 Kudos
Message 6 of 10
(3,174 Views)
Hi,

it works!

thank you..

but.. the objective of this vi is that i want to know the real time that each pulse was created from the external clock...

but i get all the pulses with dt=40e-6 s

but it is not the real time..

because.. if the device ,which has the external clock (the device is an optical mouse), don't move the external clock don't create pulses

but i can't get these times..

have you got any ideas?

i tried to read the external clock with analog input and then to see when each pulses created without solution..

thank you!

andrikos
0 Kudos
Message 7 of 10
(3,168 Views)
hi,

if the two analog has different sample rate...

how can i do this?

because if i try to execute the 2 analog with the same task, the two analog will work with the same sample rate..

andrikos
0 Kudos
Message 8 of 10
(3,150 Views)


andrikoscy wrote:
hi,
...
because if i try to execute the 2 analog with the same task, the two analog will work with the same sample rate..


Hi andrikos,
because of you said it is possible to run both channels on the same task, i think it is not possible  to use different tasks for it. You should read every channel with the lowest sample rate you need.
Mike
0 Kudos
Message 9 of 10
(3,120 Views)

Hello Andrikoscy,

 

For most multi-function DAQ boards what you're trying to do is not possible.  If you want each analog input to run on a different sample clock then you'll need to look into a NI R Series Intelligent Data Acquisition Device.  These DAQ boards have a built in FPGA and allow for more customization than M Series boards, including independent sample clocks.

 

To address your questions:

1.  On a non-intelligent DAQ board all analog input channels must share the same sample clock--if you need two different rates I would suggest sampling both channels at the faster of the two frequencies and then just ignore some of the data points on the slower channel.

 

2.  In order to find out the exact time between samples from an external trigger (instead of the constant dt inserted by the waveform acquisition), you will need to take a period or frequency measurement of your signal using a counter on your card.  By taking a buffered period measurement you will get an array of the times between samples and with that you can graph your samples on a precise x-axis.  Normal analog input tasks that use an external clock do not associate any exact timing information with when a trigger was received.

 

I hope this helps, and if you'd like more information on the R Series Intelligent Data Acquisition Devices please feel free to contact National Instruments directly at www.ni.com/contact.

 

Have a great day!

Brooks
0 Kudos
Message 10 of 10
(3,095 Views)