04-16-2009 12:08 PM
Hi,
I need to write data to serial asynch. COM port and to check at any time how many data are still to be sent. RS 232 library function for such purpose is GetOutQLen. What is equivalent VISA function ?
VI_ATTR_ASRL_AVAIL_NUM flag can be used in order to determine the amount of data in the INPUT serial asynch. COM buffer, but what about determining number of bytes in OUTPUT buffer ? Is there any VISA function which query number of bytes in OUTPUT buffer/queue ?
br,
Milan.
04-17-2009 05:14 AM
Hi Milan,
to my knowledge there is no VISA function or attribute to query the waiting byte count in the VISA output buffer, as this information would be useless as soon as the connected device signals reception readiness again and the next bytes are sent.
I assume you have already tried summing up the "VISA Write" return byte count?
Best regards,
SFK
04-19-2009 04:10 PM
04-27-2009 04:17 AM
Hi Milan,
VISA Write does not explicitly check the buffer fill state internally. It simply tries to transfer all given data to the output buffer. If this operation does not complete within the specified resource timeout (default=2sec), VISA will throw an error, I believe it ist -1073807339.
Unfortunately, there are no additional functions to monitor the write buffer available through LabVIEW. The only idea that comes to my mind would be to test for the timeout error and re-send the missing bytes in the next loop iteration - and maybe also reduce the loop iteration frequency programmatically.
Best regards,
SFK