LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial TX completion

In rs232 serial data transmission is there a way to know
when the data buffer and out shift register are empty? I need
this to be sure to have ended all data transmission, before
changing tx/rx state of my half duplex rs485 custom interface.
0 Kudos
Message 1 of 7
(4,221 Views)
This can be an issue as there is no way to know when the TX is complete unless you turn off flow control and use a timer.

However, if you're using a NI RS485 interface, you can use the "Two-wire Auto" mode which automatically turns on/off the transceiver for you.
0 Kudos
Message 2 of 7
(4,221 Views)
thank you very much!!
0 Kudos
Message 3 of 7
(4,221 Views)
It is not something I've tested actually but if you use VISA Write node, the help says: "Right-click the node and select Do I/O Synchronously from the shortcut menu to write data synchronously. The operation returns only when the transfer terminates."

Take also a look at VISA Flush I/O Buffer. With a mask 32, it is supposed to return after the TX buffer is emptied.


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 7
(4,221 Views)
Actually you gotta be careful with this one. This will return when the transfer to the serial driver is complete, which is not always the same as when the physical transmission is complete. For example, the UART FIFO may contain outbound data that hasn't yet shifted out. The driver has done its job by moving the data to the UART and thus returns, but the data has not yet left.

Another example is with some Ethernet Serial ports. The driver may return when the packet of TX data is sent via ethernet to the remote port. This means that the write can complete in the local system before the serial data reaches its destination (ie: transmitted out the serial port).

The problem is that there is no set way to handle this issue (what I called the "
FIFO effect"), and different serial drivers will all handle this differently.

This is one reason why the "2-Wire Auto" 485 transmission mode available on NI RS-485 interfaces is extremely helpful. Since the transmitter is turned on and off at the serial port and the mechanism is independant of the serial driver and application, you're able to immediately (or within a bit time or two) and automatically disable the tranmitter as soon as the last bit of your data shifts out.
Message 5 of 7
(4,221 Views)
I have used "VISA WRITE" synchronously and "VISA Flush I/O Buffer" but indeed the problem persists.
thanks
0 Kudos
Message 6 of 7
(4,221 Views)

I know this is a pretty old post but I'm having the same problem.  I haven't had any luck finding solution to this anywhere.

 

Is there any work around to this??

 

Thanks.. 

0 Kudos
Message 7 of 7
(3,764 Views)