04-29-2008 04:57 AM
04-29-2008 07:11 AM
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.
05-01-2008 02:09 PM