08-25-2016 07:28 AM
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.
08-25-2016 09:29 AM
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.
08-25-2016 09:31 AM
If you're lucky, your computer will have a real serial port. It should work with that.
08-25-2016 01:14 PM
Nope sadly not and don't have anyy available to use with actual serial ports, just a acer aspire s3.
08-25-2016 01:16 PM
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.
08-26-2016 03:24 AM
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).
08-26-2016 09:26 AM
@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.
08-26-2016 10:13 AM
have you tried using a longer break?
The default is 250 ms and you are trying to do 2 ms which look legal...
Ben
08-29-2016 03:22 AM
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.
08-29-2016 03:23 AM
Hi Ben,
Yes I tried numerous values between 1 and 500ms.