DAQmxBase and array- How to read one channel from the data?

Signal acquisition, processing and output
Ответить
przemmo
interested
interested
Сообщения: 4
Зарегистрирован: 11 июн 2008, 14:29
Контактная информация:

DAQmxBase and array- How to read one channel from the data?

Сообщение przemmo »

Hi,
I have some problem. After logging data using the DAQmxBase Read function which returns 2D array i want to calculate the mean value. Can anyone help me to process the received data?
Вложения
Read.vi
(26.33 КБ) 357 скачиваний
d.jpg
d.jpg
Последний раз редактировалось przemmo 12 июн 2008, 16:58, всего редактировалось 2 раза.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение Eugen Graf »

Sorry, I have no DAQmxBase LLB installed, but can't you easy connect your 2D-Array on the input of the Mean.VI ?

If not, you can use AddArrayElements.vi from Numeric palette and than Divide the Sub through the Array size.
przemmo
interested
interested
Сообщения: 4
Зарегистрирован: 11 июн 2008, 14:29
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение przemmo »

ok, but the dimmension of the array is (number of channels)x(samples_per_channel). How to divide the array into single channels (one dimmensional arrays).
It is not possible to directly connnect the mean to the Read output. Once i saw an example in which they connect the output of Read function to an arran, and after it was possible to read just one set of data.

The question is how to write the output of the Read function to an array and then how to read from the array?
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение Eugen Graf »

Use a For-Loop for autoindexing and place your Mean.vi into the For-Loop. So you will have one main value per channel.
przemmo
interested
interested
Сообщения: 4
Зарегистрирован: 11 июн 2008, 14:29
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение przemmo »

if i had the data ia an array i would handle the rest. What to connect between Read output and Mean input? Please find the picture in the first post.

Ok, i did it. The function i was looking for if Index Array. You simply connect the block to the Read output and using indexes for rows and columns you can read every element.

Now i want to add every calculated mean value to a new array. how to do it?
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение Eugen Graf »

Ok, my suggestion was this one.
Вложения
Mean2D.png
Mean2D.png (6.81 КБ) 8454 просмотра
przemmo
interested
interested
Сообщения: 4
Зарегистрирован: 11 июн 2008, 14:29
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение przemmo »

ok, done.
How, using the For loop, can i toggle between rows? i did it by the use of "Numeric2". When=1 calculates the mean of canal 1, when=0 calculates the mean of canal 0. I want to do it in for loop in every while loop and results store in an array.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: DAQmxBase and array- How to read one channel from the data?

Сообщение Eugen Graf »

You don't need to toggle, it will be automatically toggeled by the for loop I shown. It names "autoindexing". So the output array contains aready all your mean values. Easy place my example into the while loop, you don't also need Index Array.vi for this.
Ответить
  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Signal processing»