09-02-2005 03:34 AM
09-02-2005 08:51 AM
You haven't given a lot to work with. What's the instrument and what commands are you sending? Posting the VI you've written would also help enormously. And, using the abort button will result in unexpected results and should not be used except when you're debugging the program. Sometimes, the best thing to do is to reset the instrument before rerunning the VI just because it may be in some really weird state.
Doing a VISA Clear should work but do it after the VISA Open. Also, when doing a read, make sure that number of bytes to read is high enough to get the entire buffer of the instrument. The number you specify can be much higher than what you might expect. Since the VISA Read will terminate automatically when the instrument sends EOI at the end of it's data, whether you specify 10 or 10000 bytes to read, it will take the same amount of time to read 10 or less bytes. But, if you specify 10 bytes and the instrument is actually sending 11, the last byte will remain in the buffer and mess up your next read. Another thing to do is to have a VI that will read the instrument's error status. Every time you write a command with a syntax error or illegal parameters, most instruments will generate an error message that's stored. You should be reading this often during debug. Watch for an error indicator on the instrument to go on. Almost all instrument drivers from NI have an error query function that you can look to for an example.
09-02-2005 11:21 PM
09-06-2005 08:08 AM
09-06-2005 10:38 PM