LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA GetInQLen

  In the old RS232 communications I would use GetInQLen to determine the amount of data in the buffer, is there something similar in the VISA commands?  I am receiving data between 4 and 30 bytes long.  Below is the code I have configured to read in 4 bytes.  Is their  a way to modify it such that it could very to depending on how many bytes are in the Buffer?  I am assuming I am missing something simple.
 
 // Parse a binary string
 ViNullChk(RxPacket = (ViBuf)malloc(4));
 ViErrChk(viScanf(resourceName, "%4c", RxPacket));
 
Thanks,
0 Kudos
Message 1 of 5
(4,026 Views)

I normally don't use VISA, preferring the traditional RS232 library, but I've found an attribute that may help you:

viGetAttribute (handle, VI_ATTR_ASRL_AVAIL_NUM, &bytes);

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(4,013 Views)
Thank you for the information, that is what I was looking for.  But as you stated I am thinking I will probably go back to the standard RS232 functions, I haven't seen the benefit of VISA for my applications.
 
Thanks.
0 Kudos
Message 3 of 5
(4,009 Views)

Hallo Roberto,

 

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 ?

 

BR,

Milan.

0 Kudos
Message 4 of 5
(3,755 Views)

Milan,

 

With a question like this, the best approach would be to make a new thread for your new question, which I can see that you have done on this duplicate post.  Once you have done that, there is no need to post on 9 other threads to ask the same question.  Please see the duplicate post for the answer that SFK has given.

 

Thanks,

 

Eric K

0 Kudos
Message 5 of 5
(3,730 Views)