Delay when read data from serial port

VISA; TCP/IP, CAN and similar protocols
Ответить
Аватара пользователя
Mars
beginner
beginner
Сообщения: 14
Зарегистрирован: 19 май 2010, 19:52
Версия LabVIEW: 2009
Откуда: Stuttgart, Germany
Контактная информация:

Delay when read data from serial port

Сообщение Mars »

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.)
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Delay when read data from serial port

Сообщение Eugen Graf »

No, it's not. Is this an pure ASCII protocoll?
Аватара пользователя
Mars
beginner
beginner
Сообщения: 14
Зарегистрирован: 19 май 2010, 19:52
Версия LabVIEW: 2009
Откуда: Stuttgart, Germany
Контактная информация:

Re: Delay when read data from serial port

Сообщение Mars »

Yes it is. It's pure ASCII protocoll.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Delay when read data from serial port

Сообщение Eugen Graf »

Very important settings are the Timeout Value and Termination Character on Configuration of VISA. What did you set there?
Аватара пользователя
Mars
beginner
beginner
Сообщения: 14
Зарегистрирован: 19 май 2010, 19:52
Версия LabVIEW: 2009
Откуда: Stuttgart, Germany
Контактная информация:

Re: Delay when read data from serial port

Сообщение Mars »

eg писал(а):Very important settings are the Timeout Value and Termination Character on Configuration of VISA. What did you set there?
The timeout is set 5 second which is fairly long enough.
The terminal character is set according to the protocal description.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Delay when read data from serial port

Сообщение Eugen Graf »

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
beginner
Сообщения: 14
Зарегистрирован: 19 май 2010, 19:52
Версия LabVIEW: 2009
Откуда: Stuttgart, Germany
Контактная информация:

Re: Delay when read data from serial port

Сообщение Mars »

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.
I get the bit count via reading out "Bytes at port" through "property node". Thus this shouldn't be the problem.
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.
Ответить

Вернуться в «Communcation with devices»