LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA equivalent function to GetOutQLen ?

 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.

0 Kudos
Message 1 of 4
(4,132 Views)

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

0 Kudos
Message 2 of 4
(4,109 Views)
Hi SFK,

 

I was thinking of using VISA serial COM write function for sending data to modem and not to some instrument. I wanted to be sure that modem has always enough data to send and that output queue of PC COM port always have some data waiting to be send to the modem.

So checking dynamically how much data are in output COM queue would be usefully for me. "VISA Write" function returns number of bytes written but it does not output any information if COM output queue is completely full, if it is about to overflow, or if there is hardly any bytes waiting to be send. So does it means that VISA functions does not do any check if output buffers are full ?


BR,
Milan.
0 Kudos
Message 3 of 4
(4,079 Views)

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

0 Kudos
Message 4 of 4
(4,025 Views)