Clear Serial Port Buffer Using iclear, iflush

Hello,

I am having trouble clearing the serial port buffer using the iclear and iflush commands. The code runs without errors being returned, but when I check the buffer again there is still data.

The only way I have so far is to read until there is nothing left in the buffer. Shouldn't one of these commands do the job? I just want to discard everything in the buffer. Thanks.

x = iclear(deviceHandle);
x = iclear(intfHandle);
x = iflush(deviceHandle, I_BUF_DISCARD_READ | I_BUF_DISCARD_WRITE);
x = iflush(deviceHandle, I_BUF_READ | I_BUF_WRITE);
x = iflush(intfHandle, I_BUF_DISCARD_READ | I_BUF_DISCARD_WRITE);
x = iflush(intfHandle, I_BUF_READ | I_BUF_WRITE);
...
int n = iserialstat(intfHandle, I_SERIAL_READ_DAV, &actualCnt);

system: hp-ux 11, vxi chassis

I think you would do better to get support from the Agilent website - this is their library isn't it?

You could luck out and find somebody here who really knows this - I'm not one of them. Otherwise try this:
http://cp.literature.agilent.com/litweb/pdf/5989-6134EN.pdf