LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DATA manipulation #2

I have one more question, since the sensor has a fix samples rate of 5 kHz, and it use two bytes to representive an actual number. I am wandering if it means that we will have 10K bytes come through the serial port in a second ?  If the computer do not pick up all these data,  what do they do with them?

zhi
0 Kudos
Message 21 of 23
(744 Views)

zhi,

There is a slight problem with your code.  Manual indicates that each reading from the instrument is split into two bytes.   HI byte is sent first, LO byte second.  Your vi currently swaps the two bytes.  That is actually wrong because you end up taking the HI byte from one reading and combining it with the LO byte of the previous reading.

If the first byte you read is the LO byte ( < hex 80 ), you need to ignore it and read two more bytes

If you want to average 100 samples, then you need to read 100 pairs of HI, LO bytes.  200 bytes.  Because you are not guaranteed if you will receive the HI or LO byte first, use the VISA read to get 201 bytes from the port.

0 Kudos
Message 22 of 23
(728 Views)
Thanks for all your help. i was able to get the data.  (i might have more problem coming up 😉 )


sincerely
zhi
0 Kudos
Message 23 of 23
(700 Views)