LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication Problem using hexadecimal

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.

0 Kudos
Message 11 of 17
(389 Views)

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.

0 Kudos
Message 12 of 17
(381 Views)

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 ......

0 Kudos
Message 13 of 17
(378 Views)

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.

0 Kudos
Message 14 of 17
(366 Views)

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.

0 Kudos
Message 15 of 17
(364 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 17
(360 Views)

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?

 

 

 

0 Kudos
Message 17 of 17
(356 Views)