LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Break not being sent out by LabVIEW

Hello, 


After trying several ways my VI just won't send out a break on my serial port. Strange thing is when copying it from a (working) example it still doensn't have the expected behavior. This issue occurs with multiple serial dongles and even checked it with a Logic analyser, the break simply isn't generated on my laptop in this VI. I have already tried different lengths of breaks without avail. Attaced you can find my VI and a screenshot of the logic analyser.

 

Kind regards,

Erich M.

0 Kudos
Message 1 of 10
(4,643 Views)

This is most likely a physical issue.  It could be that your USB to Serial adapter doesn't support it, or if it does, it's some kind of "emulation mode" that doesn't always trick the serial port on the other end into thinking one was sent.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 10
(4,599 Views)

If you're lucky, your computer will have a real serial port.  It should work with that.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 10
(4,598 Views)

Nope sadly not and don't have anyy available to use with actual serial ports, just a acer aspire s3. 

0 Kudos
Message 4 of 10
(4,578 Views)

I thought of this as well, but still confuses me why the example for the break VI works, but as soon as I implement it in the rest it doesn't. 

0 Kudos
Message 5 of 10
(4,577 Views)

Proof that it acually works in the example VI with a setting of 2 for the length is provided in the screenshot down below. Also tested with both serial adapters I own (one FTDI based and the other using an MCP2200 chip). 

0 Kudos
Message 6 of 10
(4,542 Views)

@Tokolozi wrote:

Proof that it acually works in the example VI with a setting of 2 for the length is provided in the screenshot down below. Also tested with both serial adapters I own (one FTDI based and the other using an MCP2200 chip). 


Do you have the sample code so we can make some comparisons?  And I apologize that I misunderstood the part about working on the same computer and that you had to go and post a screen shot to prove it was working.  I thought you meant the example code was working on a different computer.  And it wasn't your fault.  I re-read it and it is perfectly clear that's what you meant.

 

The only thing I can think of is that the serial port is somehow not being set up the same way as in the example.  I can rule out an error that was swallowed somewhere, and I can also rule out that you don't know how to close a serial port properly.

 

Advice I can offer that's not related to the problem is to make use of subVIs.  You have a LOT of duplicated code there that you can fit into a small corner of your screen if you made proper use of subVIs.  Then you wouldn't feel the need to use stacked sequences to shrink your code into a small space.  A good habit to lose is using stacked sequences, period.  It obfuscates the code and makes it difficult to follow with backwards-running wires creating spaghetti code.  It's use is so discouraged that you'll have a hard time even finding the structure in recent versions of LabVIEW.  The fact it still even exists is probably for backwards compatibility.

 

I can't find anything inherently wrong with your code.  There must be some difference in the code.  is it possible to post the working code so we can do some comparing?

 

Thanks.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 10
(4,518 Views)

have you tried using a longer break?

 

The default is 250 ms and you are trying to do 2 ms which look legal...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 10
(4,499 Views)

 Hi again Bill, 

The example code I used was the "Set Serial Break Event.vi" of labview 13 under the help section.

On the sub VI's, I completely agree with you, should make use of it more. Will implement it in the next version of the code, inheritly I just wanted to test a small portion of code and then got carried away. Thanks for looking through the code anyways.

0 Kudos
Message 9 of 10
(4,458 Views)

Hi Ben, 
Yes I tried numerous values between 1 and 500ms. 

0 Kudos
Message 10 of 10
(4,457 Views)