Hello everyone,
I got a problem when I read the data from buffer.
The data is transmited from TCA 2003(Total station). I first send the command to instrument, then it returns the data/response.
But it always act like this: the reponse i get is always the corresponding one for the prior command.
e.g I send the command to measure point 1, the result returns to my vi when i send the command to meausre point 2.
It's alway one step delay. is this normal for reading data from serial port?
(I use write "visa write" to write in commands and "visa read" to read out the responses.)
Delay when read data from serial port
-
Eugen Graf
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
-
Eugen Graf
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: Delay when read data from serial port
Very important settings are the Timeout Value and Termination Character on Configuration of VISA. What did you set there?
- Mars
- beginner
- Сообщения: 14
- Зарегистрирован: 19 май 2010, 19:52
- Версия LabVIEW: 2009
- Откуда: Stuttgart, Germany
- Контактная информация:
Re: Delay when read data from serial port
The timeout is set 5 second which is fairly long enough.eg писал(а):Very important settings are the Timeout Value and Termination Character on Configuration of VISA. What did you set there?
The terminal character is set according to the protocal description.
-
Eugen Graf
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: Delay when read data from serial port
One question more - how many characters do you read if you are waiting on the response from the device? The count better should be more then you expect.
- Mars
- beginner
- Сообщения: 14
- Зарегистрирован: 19 май 2010, 19:52
- Версия LabVIEW: 2009
- Откуда: Stuttgart, Germany
- Контактная информация:
Re: Delay when read data from serial port
I get the bit count via reading out "Bytes at port" through "property node". Thus this shouldn't be the problem.eg писал(а):One question more - how many characters do you read if you are waiting on the response from the device? The count better should be more then you expect.
And yes you are right. As you mentioned, it's important to take care of the terminal character. I find out the reason is that I omitted the "return code" in my terminal charaters.
Thanks a lot.
I wish you have a nice holiday (weekend + monday).
Best regards.