still cannot figure out how to do the data collection via RS

Post beginners questions here. Don't be ashamed starting stupid topics.
Ответить
pengsun
interested
interested
Сообщения: 3
Зарегистрирован: 10 июн 2014, 11:30
Версия LabVIEW: 2013
Контактная информация:

still cannot figure out how to do the data collection via RS

Сообщение pengsun »

Dear Experts:
I still cannot figure out how to do the data collection via RS232, please help me, thank you in advance
my project:
i use PIC18f4553 to send data to computer via RS232, the pattern of data flow is: X_High bytes (8bits), X_Low bytes (8bits), Y_High bytes (8bits), Y_Low bytes (8bits), X_High bytes (8bits), X_Low bytes (8bits), ......
here is what i plan to do:
VISA read -->put "X_High bytes (8bits)*256 + X_Low bytes (8bits)" in x column, and put "Y_High bytes (8bits)*256+ Y_Low bytes (8bits)" in y column, in the mean time, save and show these data.
dadreamer gave me some hints, but, i still cannot make the labview program working
Аватара пользователя
dadreamer

Activity Professionalism Автор
professor
professor
Сообщения: 3926
Зарегистрирован: 17 фев 2013, 16:33
Награды: 4
Версия LabVIEW: 2.5 — 2022
Благодарил (а): 11 раз
Поблагодарили: 126 раз
Контактная информация:

Re: still cannot figure out how to do the data collection vi

Сообщение dadreamer »

Why did you start new thread? All threads on this forum are viewed equally.

What's your main problem? Is it data receiving with VISA VI's, data collecting into some buffer/array or data processing? If you don't know how to manipulate received array in order for it to get correct results (X,Y) I could suggest this snippet:
Snippet.png
I'd like to remind again that you need your VISA Read Loop instead of Producer Loop here, because I don't have your device so I cannot get real measurements. In VISA Read Loop you simply collect all data into one array. After you finish with it you can decimate array to odd/even pieces (high bytes X-Y array and low bytes X-Y array) and decimate the arrays again to get all numeric parts (high bytes X array, high bytes Y array, low bytes X array, low bytes Y array). Finally, you perform mathematical operations with the arrays and write them to text file.

I removed graph plotting here but it can be easily added from previous snippet.
Ответить

Вернуться в «For beginners»