LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous serial data gives occasional junk

Solved!
Go to solution
Of course it can work. You are aware that serial transmissions are buffered by windows...?
0 Kudos
Message 11 of 22
(1,038 Views)

sorry,im not clear on how to use the termination character instead of the byte at serial port. About the flush,even without the flush,the junk data are still there. i Just add it because i think the leftovers in the buffer are the one that is causing the junk data

0 Kudos
Message 12 of 22
(1,026 Views)

If there is "junk data", then flushing the buffer isn't going to help.  If the device isn't sending those bytes, then how is it getting in there?  One possibly is that you have a bad communication cable, or picking up intereference and bits are getting flipped and bytes that are meaningless.

 

115,200 baud rate is a bit on the high side. Higher baud rates are more susceptible to noise. Also, it looks like you are using the serial configuration default of no parity.  So you don't get the benefit of possibly detecting corruped bytes.

 

Check your cable and try another one.  Is there anything enviromental that could be causing a problem such as a noisy motor running nearby?  What if you try running at a lower baud rate?  Put an oscilloscope on the serial port line and see if you ever detect anything noisy or spiky on top of what should like a clean bit stream.

0 Kudos
Message 13 of 22
(1,019 Views)

i dont think noise is the one that is causing the junk data because there is another software provided by the vendor,set with no parity and at the same bitrate and it works just fine. Even in teraterm,those junk data doesnt appear.

About the property node on the second sequence,its for the autoscrolling function of the string indicator. It will stop the autoscroll function once the user click inside the text indicator.

0 Kudos
Message 14 of 22
(1,016 Views)

Well there is no reason that LabVIEW or the VISA drivers would generate bad bytes if the other things aren't.

 

You are overlooking something somewhere with either settings or the cable.

0 Kudos
Message 15 of 22
(1,008 Views)

Is it possible that the "junk" strings include part of one string, some junk, and the end of a later string? With all the things you were doing in the image of your code, that may not be due to a few corrupted characters. Your screenshot of the front panel appears to show the termination character set to hex 0. I think I recall some problems with Bytes at Port and that character. (A quick search showed a problem with FF on the Mac, but not anything with 0).

 

Please post your code.  You have made some changes and we are not sure what you have now.

 

Lynn

0 Kudos
Message 16 of 22
(1,002 Views)

i already got the fix for the 'junk' characters. Its due to opening the port inside the while loop.

well thanks guys,now im on track to meet my schedule for this project

0 Kudos
Message 17 of 22
(998 Views)

That was stated in message 4.

 

What took so long to try that out and prove that was the problem?

0 Kudos
Message 18 of 22
(992 Views)

ugh..its posted yesterday.. i dont think its that ''long''..
Plus im working.I have other responsibilities too apart from this, and i cant install labview in my company PC.

I only got the chance to try it out during the night,and test the software on the next day. I cant bring the device home.

Hope this clear things out.

Thanks guys

0 Kudos
Message 19 of 22
(988 Views)

Just that when you get a tip, then you go back and forth with another dozen messages claiming it still doesn't work, it wastes everyone's time try to figure out what is so "special" about your problem, when you had the solution there all along if you had taken the time to try it without claiming things still weren't working.

 

Smiley Frustrated

0 Kudos
Message 20 of 22
(986 Views)