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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't stably write to COM port

Hello,everybody.
I wrote a program using CVI5.5 232 library,in my program I install a COM callback function (Function InstallComCallback()),in which bytes is continuously received(using function ComRd()) and processed.During the processing I need to send some bytes through COM
port some time(ComWrt()).But sometimes I can't send the data to destination stably,in debug enviroment,I am sure that the program sentence including ComWrt() was executed,but the data was not physically sent out immediately,they still remained in the output queue likely.
My OS is Chinese win2000(sp3),and I initiate Com port(OpenComPort()) with baud rate 9600.
???
Thanks in advance.
0 Kudos
Message 1 of 2
(2,542 Views)
Hello

Try running one of the serial examples installed with CVI. This should allow you to check whether its something wrong with your application or not. They are installed under ..\CVI\samples\rs232\
Also try doing simple COM reads and writes and use the GetOutQLen() function to check how many bytes are available in the output port

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(2,542 Views)