It appears that when calling viReadAsync, it will not return until it times out or it receives at least as many bytes as I requested. Is there a way to make it return when it finds any data in the buffer? Currently, I am setting 'count' to 1, but this seems a bit inefficient.
Once viReadAsync and viWaitOnEvent have completed, I am having problems getting the number of bytes read. Is this always going to be the same number I requested? I tried using viGetAttribute to get VI_ATTR_RET_COUNT, but couldn't make that work. When I use the device session as the first arg, it returns VI_ERROR_NSUP_ATTR. When I use the job ID from viReadAsync or VI_EVENT_IO_COMPLETION, VI_ERROR_INV_OBJECT is returned. What is the secret to getting the number of bytes read?
Will viReadAsync ever return more bytes than I requested? What do I need to do to get all bytes in the input buffer? Do I need to check the number of bytes in the buffer, then request that many? How do I do this (I can't find that function/attribute)?