LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read Bytes

Hi!!
 
I have some problems with the numer of bytes to read in the function VISA Read. Actually, I have to read some programs which are in my instrument(SOLARTRON 1250 (FRA) ). I can read those programs in labview. However, I can save those programs in a text file due to the number of bytes to read : When I put a number of bytes more than I have it doesn't save and I don't know why??
 
So can you tell me how to define automaticaly the number of bytes to read?????
 
 
Regards
 
(Excuse my bad english^^)
0 Kudos
Message 1 of 6
(3,226 Views)
Their is a property 'Bytes at Port:


Ton

Message Edited by TonP on 05-03-2007 11:36 AM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 6
(3,222 Views)
I try this function "VISA Bytes at Serial Port" but I still Have nothing in the buffer(in labview)!!!!!!!!Look at my Vi if you see an error...
 
"*P1" is the command which call the program
"OT0" is a command which configure the GPIB
 
 
Regards
0 Kudos
Message 3 of 6
(3,198 Views)
If it's a GPIB bus you're using then the "VISA Bytes at Serial Port" is of no use to you, since that applies to serial connections. In that case, simply wire a constant to the VISA Read. If you stated GPIB in error and you really have a serial connection, then the problem is likely that you're simply not waiting long enough after sending the "*P1" command. You have to give time for (1) the computer to send the command to the instrument, (2) the command to get to the instrument, (3) the instrument to process the command, (4) the instrument to generate the response, (5) the instrument to send the response, and (6) the response to get to your computer. So, put in a delay after the write. Also, check your serial port configuration to make sure it's set up properly in terms of using a termination character to end a read.
0 Kudos
Message 4 of 6
(3,184 Views)
Like you said, I put a wait time of 20sec and now I can see just one line of the program in the buffer
Download All
0 Kudos
Message 5 of 6
(3,176 Views)
Well, 20 seconds is overkill. I don't have the manual for the instrument, but I'd guess that even half a second is probably adequate. As to the error that you're getting, that's a timeout error. It means that the VISA Read was waiting for more data but did not receive it, and hence timed out. There are a number of reasons why this can happen. Most likely it's due to the fact that you're waiting too long. You should also verify that you did not inadvertently set the VISA Timeout to a really low value somewhere else in your code. In the picture that Ton posted above the VISA Timeout function is shown immediately to the left of the Bytes at Serial Port. Are you using this somewhere?

Another possibility is that the instrument is not using the EOS/EOI properly, or isn't configured properly for this. A temp chamber we have here in our lab is like that.

I doubt that this would be an asynchronous/synchronous issue, but for future reference, reading this article might be useful.
0 Kudos
Message 6 of 6
(3,150 Views)