LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa read buffer extra byte problem

Solved!
Go to solution

@Laian wrote:

solved just by adding Visa close function to my while loop!!

I dont know why but I need to close and again reopen the port each time I read the bytes in my while loop

Thanks


And the text I highlighted above is a good reason for me to believe that does NOT fix your problem, but merely hides it.  Any time you cannot explain why something fixed it, it's probably not really fixed.  This "solution" will eventually come back to bite you in the behind.  Your next post might be, "I'm missing bytes from my message".  No, let's fix the problem, not hide it.

 

Hint: Issues of the type, "There's an extra byte", and similar things are usually due to an incomplete understanding of how to communicate with the instrument.  If you could upload the manual for this thing, maybe we can help you fix the problem for real.

 

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 21 of 22
(366 Views)

@billko wrote:

@Laian wrote:

solved just by adding Visa close function to my while loop!!

I dont know why but I need to close and again reopen the port each time I read the bytes in my while loop

Thanks


And the text I highlighted above is a good reason for me to believe that does NOT fix your problem, but merely hides it.  Any time you cannot explain why something fixed it, it's probably not really fixed.  This "solution" will eventually come back to bite you in the behind.  Your next post might be, "I'm missing bytes from my message".  No, let's fix the problem, not hide it.

 

 


I agree with Bill. This "solution" does not fix the underlying problem. There's no reason that you should have to open and close on every iteration of the loop. There is something wrong with your protocol, but since we don't have your instrument (and you've not shared the documentation as Eric1977 asked) it's difficult to help you with that.

Message 22 of 22
(358 Views)