LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Differences between VI_IO_IN_BUF_DISCARD (64) and VI_READ_BUF_DISCARD (4)

It is said in help file
VI_IO_IN_BUF_DISCARD (64):  Discard the receive buffer contents (does not perform any I/O to the device).
VI_READ_BUF_DISCARD (4): Discard the read buffer contents (does not perform any I/O to the device).
But what's the meaning of "receive buffer"and"read buffer"? They are same meaning?
 
 
Thanks!
Jacky
0 Kudos
Message 1 of 3
(3,194 Views)

Hi Jacky!

The difference is that the VI_READ_BUF_DISCARD function is designed to be use with the formatted I/O functions like viScanf and viPrintf, while the VI_IO_IN_BUF_DISCARD is designed to be used with the viRead and viWrite functions.

I am sorry for any confusion.  I have made this issue known so we will be able to correct it in the next release.  Thank you for bringing it to our attention!

I hope this helps, but let me know if you have any other questions!

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,180 Views)
Note that the key difference is that specifying VI_READ_BUF_DISCARD will also flush the low-level io input buffer, whereas specifying VI_IO_IN_BUF_DISCARD will not flush the formatted input (aka "read") buffer.  Basically, if you are calling to viScanf, you should use VI_READ_BUF_DISCARD, whereas if you are calling viRead, you can use VI_IO_IN_BUF_DISCARD.  As the documentation states, you should not be mixing calls to viScanf and viRead.

Mert A.
National Instruments
0 Kudos
Message 3 of 3
(3,178 Views)