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?
DAQmxBase and array- How to read one channel from the data?
DAQmxBase and array- How to read one channel from the data?
- Вложения
-
- Read.vi
- (26.33 КБ) 358 скачиваний
Последний раз редактировалось przemmo 12 июн 2008, 16:58, всего редактировалось 2 раза.
-
Eugen Graf
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: DAQmxBase and array- How to read one channel from the data?
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.
If not, you can use AddArrayElements.vi from Numeric palette and than Divide the Sub through the Array size.
Re: DAQmxBase and array- How to read one channel from the data?
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?
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
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: DAQmxBase and array- How to read one channel from the data?
Use a For-Loop for autoindexing and place your Mean.vi into the For-Loop. So you will have one main value per channel.
Re: DAQmxBase and array- How to read one channel from the data?
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?
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
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: DAQmxBase and array- How to read one channel from the data?
Ok, my suggestion was this one.
- Вложения
-
- Mean2D.png (6.81 КБ) 8517 просмотров
Re: DAQmxBase and array- How to read one channel from the data?
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.
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
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: DAQmxBase and array- How to read one channel from the data?
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.
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
- 2 Ответы
- 500 Просмотры
-
Последнее сообщение Artem.spb
-
- 5 Ответы
- 271 Просмотры
-
Последнее сообщение AndreyDmitriev
-
- 5 Ответы
- 847 Просмотры
-
Последнее сообщение dadreamer