LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read data from two channels at the same time

Dear all,

 

I am  a newbie in the labview. I am using C-DAQ NI9237 for data acquisition from 2 wheatstone full bridge . So i want to use two channels one for each bridge to get data at the same time using 1 qty  C-DAQ NI9237  I was able to get the data when it was only 1 full bridge .i.e 1 channel. So i do have my block diagram for reading from 1 channel. But i want to modify this block diagram so i can read 2 channels at the same time. 

For that , i modified the present DAQ vi by  adding another channel . But i am wondering how to separate data coming from the DAQ into two i.e one from left full bridge and other from right full bridge. Because in the DAQ vi wiring what i can see is only data. So my question is  how to see  data from two channels separately at the same time?

 

Any suggestions will be highly appreciated . Will be highly appreciated  with kudos if anyone can spare their valuable time checking my VI that i have attached herewith .

 

Thank you.

 

Sachet

0 Kudos
Message 1 of 17
(8,350 Views)

sk1 wrote:  But i am wondering how to separate data coming from the DAQ into two i.e one from left full bridge and other from right full bridge. Because in the DAQ vi wiring what i can see is only data. So my question is  how to see  data from two channels separately at the same time?

1. You need to tell your DAQ Assisant to read 2 channels.

2. Your From Dynamic Data Type needs to output an array of waveforms in order to get all of the waveforms out.

3. Use Index Array to get the different waveforms.


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
Message 2 of 17
(8,341 Views)

I would suggest the following:

 

-Create a task to read 2 channels with the DAQ assistant like Cross said

-Set sampling mode to continuous, frequency to however fast you want to read data, and samples to the same number. If prompted to create a while loop choose no

-When finished, right-click the assistant and select "generate DAQ-mx code"

 

You should wind up with something like this, where the SubVI is the created task, and the read function will deliver your data. On the options for polymorphic VI choose analog > multiple channels >multiple samples > 2D DBL. As you have probably guessed, that will give you a 2D array, one row equals one channel. I used traspose for readability purposes only.

daq.png

0 Kudos
Message 3 of 17
(8,334 Views)

Hi, 

I was able to get 2D array by changing the dynamic data into 2D array with channels as rows option. Thanks for that if thats what  you meant.  

But i am still having having problem using that 2D in my block diagram. Could you please check my block diagram and suggest me how i can use it ? In my diagram the data type i was using was waveform type. But now its 2D array so i am unable to think of how to use it in my diagram.

 

What i want to do is to use the block diagram to get strains from two channels separately. So i think i should have two different Y1 and Y2 as waveform component. 

 

Also how can i separate the columns of two channels into two different separate arrays by using index array? 

 

Thanks.

 

Sachet

0 Kudos
Message 4 of 17
(8,304 Views)

Hi, 

I was able to get 2D array by your method too. Thanks for the help .

But i am still having having problem using that 2D in my block diagram. Could you please check my block diagram and suggest me how i can use it ? In my diagram the data type i was using was waveform type. But now its 2D array so i am unable to think of how to use it in my diagram.

 

What i want to do is to use the block diagram to get strains from two channels separately. So i think i should have two different Y1 and Y2 as waveform component and filter them separately in two different loops, right? 

 

Also how can i separate the columns of two channels into two different separate arrays ? 

 

Thanks.

 

Sachet

0 Kudos
Message 5 of 17
(8,301 Views)

You just need to use Index Array to get your two waveforms separated.


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 6 of 17
(8,288 Views)

Hi, Thanks . But what does index exactly mean? So if i have two channels i.e channel 0 and channel 1 . So to get the row of channel 0 i need to put index 0 and for channel 1 index 1?  

 

Thanks.

 

Sachet

0 Kudos
Message 7 of 17
(8,275 Views)

@sk1 wrote:

Hi, Thanks . But what does index exactly mean? So if i have two channels i.e channel 0 and channel 1 . So to get the row of channel 0 i need to put index 0 and for channel 1 index 1? 


Or you can just expand the Index Array to show 2 outputs.  The first will default to index 0 (channel 0) and the second index 1 (channel 1).


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 8 of 17
(8,263 Views)

Hi,

Thanks. Well i also used index waveform vi instead . I hope this does the same as taking one waveform out of two waveforms, right???

 

( Like , below the wires coming from the DAQ is first sent to top graph to visualize both the channels at the same time. After that the same wire also goes Index waveform vi with index 0 and displays in the middle graph . Again the same wire goes to another index waveform with index 1 and display in the lower graph.)

 

Thanks.

 

Sachet

pic.JPG

0 Kudos
Message 9 of 17
(8,257 Views)

Before you go any further, step back and google "labview in 3 hours"

 

The way you're wiring shows a lot of bad practices that will haunt you soon enough.  Break those bad habits now.  Index Array just means it will take the element at that index(location).  It's a way to work with part of an array.

0 Kudos
Message 10 of 17
(8,242 Views)