11-09-2017 06:53 AM - edited 11-09-2017 06:56 AM
When I set baudrate 19200(written in manual), there(labview) is an error in visaread(frame error which i mentioned before).
When i use other program, teraterm, 19200 isn`t work. 57600 works.
So I set baud 57600 and In case of this there(labview) is no error but output is different with manual.
I attached output in former reply.
11-09-2017 07:11 AM
That response 0x1B5B356E1B does not make any sense.
Header
0x1B => 0b00011011
00011 Address and 011 (3) data bytes
Command
0x5B => no such command in the manual. It should echo "Sent" Command
The manual says the serial port is permanantly set to "1" & Should only get 1 data byte in the response.
Maybe the VISA Flush is not flushing properly. You may have some stale data left over. Set the # of Bytes to read to a very large number (like 1000) and let it time out. That should get rid of all data. See what data you get with the timeout.
Try doing that large number of reads twice/three times. See if the response is the same after the timeouts? Different? It may be that the 57600 doesn't work and it's just sending back garbage.
11-09-2017 07:26 AM
after time out I got a error massage about timeout and output.
output is 1B5B 356E 1B5B 3570 1B5B 356E 1B5B 3570 1B5B 356E 1B5B 3570 1B5B 356E 1B5B 3570 1B5B 356E 1B5B 3570 1B5B 356E 1B5B 3570 1B5B ......
11-09-2017 08:05 AM
I expected the timeout. Look like the output response is repetitive
1B5B 356E
1B5B 3570
1B5B 356E
1B5B 3570 .....
What were the last 20 or so bytes? Did it repeat to the very end of transmission?
Have you tried doing this multiple times? If so, what do the first few and the last few output bytes look like? Add an indicator to display how many bytes were actually read each time.
11-09-2017 08:19 AM - edited 11-09-2017 08:20 AM
first time the number of bytes is 208
second 212
third 212
and output is similar.
1B5B 356E 1B5B 3570 ....
last trial gives last bytes 3570.
11-09-2017 08:41 AM
Is the instrument constantly sending data? If so, you really need a loop that does nothing but read from the port and process the data that comes in.
11-09-2017 08:50 AM
what you mean exactly"Is the instrument constantly sending data If so, you really need a loop that does nothing but read from the port and process the data that comes in.?"
I wrote command 00 in write buffer, output is same with 0232640011(write buffer)
if i understand right, It is constantly sending data.
"loop that does nothing but read from the port and process that come in" meas that I have to separate read buffer and write buffer?