01-16-2006 03:18 PM
01-17-2006 01:44 AM
01-17-2006 08:10 AM
01-17-2006 08:13 AM
01-17-2006 08:28 AM
01-17-2006 09:07 AM
01-17-2006 09:15 AM
01-17-2006 09:45 AM
You can approach your problem in a couple of ways. The way you've got it written now, as soon as the number of bytes is non-zero, you read and convert. This means that when a partial string is there, you conversion is nor correct. One way is to wait until non-zero bytes like you do now, and then in another loop, read until the byte count is equal to zero and then do the conversion. You can also read until the cr\lf is detected and then do the conversion on the string. You can also enable the termination character for the read but then you'll have to increase the number of bytes to read to something other than just the number of bytes first available. If the instrument always returns the same number of bytes, you can use that as a constant for the VISA Read. Then the read will terminate whenever the byte count OR the termination character is detected.
I modified your VI to show you how you might put it in a loop and what for the CR/LF to be detected. You would want to add a timeout to this so that if the character does not show up, the loop will not run infinitely
01-17-2006 10:42 AM