From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-26-2015 01:59 AM
Hello
briefly this is what i need to do .
1-Use Serial Write palette
2-Waite until all data are sent
3-Do some thing
How can i do number 2 ?
Best Regards
05-26-2015 02:30 AM
You need not worry, once it will write all data then only it will execution will proceed further.
05-26-2015 06:29 AM
just want to add that if you want to read a possible answer from the device after writing to it,
that there might be an inherent waittime until the answer bytes are available in the buffer.
:cheers: & good luck
05-26-2015 06:45 AM
05-26-2015 07:22 AM
@Ranjeet_Singh wrote:
You need not worry, once it will write all data then only it will execution will proceed further.
That's not really true. The write function says it is done once the data is sent to the UART buffer. That does not mean that the data has all been sent, just that is is primed to be sent.
05-26-2015 07:42 AM
So how can i be sure .
because of different baud rate i can't add wait time .
and it's not really good way .
05-26-2015 07:53 AM
@mori64 wrote:
So how can i be sure .
because of different baud rate i can't add wait time .
and it's not really good way .
What are you trying to communicate with? Can you ask it for a response? Once you get that response, you know you are ready to move on.
If that is not an option, you could use a loop back so that you use another port to read the data. Once you read it all, you know it has been sent.
05-26-2015 08:04 AM
Could i do st like this :
(baud rate /8)*data length = wait time
?
05-26-2015 08:54 AM
That will give you the minimum time to write the data. However, serial (RS-232) communications are asynchronous and there is no guarantee that all bytes are transmitted without delay. Typically no delay occurs but it could happen. If the communications protocol includes any handshaking, delays could be arbitrarily long.
What is the reason you need to wait? What is the device at the other end?
I think crossrulz is right. You need a response or some form of monitoring to be sure.
Lynn
05-26-2015 09:03 AM
there is reponse .
these are all for calculate time out .