LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ComBreak synchronization

Hello,

I use the ComBreak function to generate a break on the RS232 Tx Line. My program sequence is :
ComBreak (1, 2);
ComWrtByte (1, 0x55);
ComWrtByte (1, octet1);
ComWrtByte (1, octet2);
ComWrtByte (1, octet3);

ComBreak (1, 2);
ComWrtByte (1, 0x55);
ComWrtByte (1, 0x61);
The problem is that the second ComBreak doesn't wait the end of the 3 ComWrtByte. So, the result is a mix of the 2 frames.If i use a waiting loop like while(GetOutQLen (1));, the delay between the 2 frames becomes too much long.
Is there a solution to my problem ?

Thanks for your help !
0 Kudos
Message 1 of 2
(2,845 Views)
Hello Francky,
If you have LabWindows/CVI 5.5.1, you can specify a negative value for the Output Queue Size when calling OpenComConfig(). This makes write operations synchronous -- when ComWrt() or ComWrtByte() return, they have completed their output operations. I would recommend this as well as switching from ComWrtByte() to ComWrt(). To upgrade online to CVI 5.5.1, go to http://www.ni.com/upgrade and select upgrade to Measurement Studio 1.0.1.

Jeremiah Cox
Applications Engineer
National Instruments
http://www.ni.com/ask
Message 2 of 2
(2,845 Views)