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: 

commbreak

Solved!
Go to solution

Hello,


I need to generate a break on the rs232 COM port in CVI real-time system.

 

I tried to use the ComBreak() CVI function, but there is not enough resolution (i need a 650 µs break) and there is an important timeout between the break and the next frame.

 

I also tried to use SetCommBreak() and ClearCommBreak().

But these function doesn't support CVI real-time system.

 

Is there any solution to solve this problem ?

Thank you for your help!

0 Kudos
Message 1 of 5
(3,084 Views)

Hello Vincent,

 

Looking through our libraries and functions for LabWindows CVI we are unable to give anything better than a ms resolution for setting a break.

Daniel

0 Kudos
Message 2 of 5
(3,063 Views)
Solution
Accepted by topic author VincentY

Unfortunately the CVI RS-232 library does not support setting the break state for less than 1 ms. Another option would be to program the serial port using VISA, which does allow you to set and clear the break state directly, so you can leave it asserted for however long you need. To do so, you would call viSetAttribute with VI_ATTR_ASRL_BREAK_STATE.

 

Mert A.

National Instruments

0 Kudos
Message 3 of 5
(3,055 Views)

Hello,

 

I am trying to generate a break sequence that should be 1ms long.

In a topic in the forum from 2009 I have found a "solution created by the member "diver" that is using the SetCommBreak() and ClearCommBreak()-functions in LabWindows.

Unfortunately I cannot find those 2 functions in my CVI2017 installation.

Were they removed in the newer versions or where can I find them? Searching in the help I could not find any records only the function ComBreak() but this one is not giving a stable timing.

I should mention that the used COM-port is a virtual COM-port realized with a FTDI-chip.(FT-232R)

 

Thank you very much for your help!

 

don_quijote

0 Kudos
Message 4 of 5
(2,129 Views)

Is this one the discussion you are referring to? If it is, it clearly states these functions pertain to the SDK: you must install the interface to Win32 APIs and set it up properly in order to use these functions.

Also, take care of jr_2005, mvr and LuisG caveats on the possibility and repeat-ability of so short a delay in a Windows system.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(2,125 Views)