LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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?


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 11 of 22
(765 Views)
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 Kudos
Message 12 of 22
(764 Views)

The device is a  loadecell transmitter .

and connection is through RS485 modbus .

i'm trying to read data with polling request .

0 Kudos
Message 13 of 22
(756 Views)
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 Kudos
Message 14 of 22
(747 Views)

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

for send command you are using "write serial ".

0 Kudos
Message 15 of 22
(739 Views)
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 Kudos
Message 16 of 22
(736 Views)

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.


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 17 of 22
(734 Views)

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 Kudos
Message 18 of 22
(724 Views)

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


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
Message 19 of 22
(714 Views)

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.
Message 20 of 22
(712 Views)