取消
显示结果 
搜索替代 
您的意思是: 

serial write finished time


@mori64 wrote:

Could i do st like this :

(baud rate /8)*data length = wait time 

 

?


Not quite.  There is typically a start and a stop bit that you have to include.  So the time to send a message is: 10/baud rate * # bytes.  As Lynn stated, that is assuming no gaps between bytes.

 

Again, what are you trying to communicate with?  Why do you even need to wait?



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 项奖励
11 条消息(共 22 条)
2,164 次查看
The other problem with your math is that you have the number of bits wrong. In addition to the 8 databits, you also have at least 1 start bit and 1 stop bit (for a total of 10) and if you have parity, that could take the total to 11.

Finally, as a point of comparison at 9600 bps, one byte takes just a hair longer than a millisecond.

How long are these messages you are sending? And at what datarate?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 项奖励
12 条消息(共 22 条)
2,163 次查看

The device is a  loadecell transmitter .

and connection is through RS485 modbus .

i'm trying to read data with polling request .

0 项奖励
13 条消息(共 22 条)
2,155 次查看
You aren't making much sense to me. The timeout setting would only apply to a read. There is absolutely no correlation between the number of bytes that are written to the number of bytes that need to be read. Are you actually getting timeout errors? Unless you are, I'd just leave things as the default.
0 项奖励
14 条消息(共 22 条)
2,146 次查看

As you know in modbus you send read command and then wait for response .

for send command you are using "write serial ".

0 项奖励
15 条消息(共 22 条)
2,138 次查看
If you are using modbus, use the modbus drivers -- the rest of this conversation is moot.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 项奖励
16 条消息(共 22 条)
2,135 次查看

I'm with Dennis here.  You should know how many bytes are coming back from the instrument (Modbus is a standard after all), so just tell the VISA Read to read that many bytes.  Just leave the timeout at the default of 10 seconds.



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 项奖励
17 条消息(共 22 条)
2,133 次查看

10 sec !!

imagine just once the data is lose .

then we have to wait 10 sec for retry ?

in this device in a boot you have about 1 sec for reading comunication setting by default setting 

just in case you forget the comunication setting .

 

so you need fast polling .

0 项奖励
18 条消息(共 22 条)
2,123 次查看

@mori64 wrote:

10 sec !!

imagine just once the data is lose .

then we have to wait 10 sec for retry ?

in this device in a boot you have about 1 sec for reading comunication setting by default setting 

just in case you forget the comunication setting .

 

so you need fast polling .


The timeout is just part of the VISA Read.  It is not saying it will take 10 seconds to read.  It is saying it will wait up to 10 seconds for the data to come in.  And if you have a data drop like that, you have more important issues than trying to poll again.



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
19 条消息(共 22 条)
2,113 次查看

you obviously can set the timeout lower,

but try to make sure that you leave enough time in all cases

 

 

on a side note:

not everyone is a native-english speaker. please be more grammatically/syntactically correct, to help us understand you better.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
20 条消息(共 22 条)
2,111 次查看