LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read Garbage

Our company uses an IRDA dongle that we communicate via serial command to read/write data from some of our products.  I am working on a test program that one of the tests is to read the EEprom and check for valid information.  However, when I do that I frequently get garbage characters that show up.  It only seems to happen in the first block (of 4 total blocks) of the EEprom and I don't get this garbage at all when using Hyperterminal.  I'm wondering if it is either how I create the VISA session or how I am using it to read the data.  Any advice is appreciated.

 

I have tried adding or removing various waits between reads and adjusted for how many bytes are available to wait for a certain amount and nothing seemed to help.  See attached screenshots, there is a lot going on in other parts of my program so if you need more information on why and what I am doing please ask.

 

Thanks,

Jeff

0 Kudos
Message 1 of 14
(5,167 Views)

Never rename bmp files to jpg to get around the ban on bmp files.

0 Kudos
Message 2 of 14
(5,146 Views)

Sorry, I'd change it if I could but I can't figure out how to edit my post.  I can add the new files here if it helps any, were they just too big or what?

 

No help for the topic though?

0 Kudos
Message 3 of 14
(5,140 Views)

Re-initializing the serial port on every iteration may be part of the problem.  Move the iteration code outside the loop.

 

Lynn

0 Kudos
Message 4 of 14
(5,127 Views)

I assume you are referring to the Detect vi.  If so, that is my initialization where I auto-detect the Com port.  It is only done at program start where I loop through the listed channels until I find my device.  After I find the right Com then I just read/write as needed.  I just wanted to show how I initialized it in case there was something I missed.

 

Thanks.

0 Kudos
Message 5 of 14
(5,121 Views)

Hi,

what are you doing in your IRDA Read.vi? The one you call in your "read continuous.vi"?

 

Mike

0 Kudos
Message 6 of 14
(5,079 Views)

Change your front panel string display to HEX and see what it looks like. That garbage could just be a preamble of some sort.

Richard






Message 7 of 14
(5,036 Views)

Coming back to this discussion late.  Attached is a sample of the garbage and the /code as well as hex display of the same chunk of EEprom data.  There should be 16 lines and it gets all garbled at that one spot.  Sometimes it is just one character and others it looks something like this.

0 Kudos
Message 8 of 14
(4,950 Views)

Also, to answer a question from above.  In my "IRDA Read" I just read the number of bytes left on the Com port to make sure I "clean-up" anything that might be left over.  That call would happen after the garbage comes through.

0 Kudos
Message 9 of 14
(4,944 Views)

Hi again.

Your problem could be in the way you are reading the bytes. If the incoming data gets "out of synch", you might start to read the last part of one byte as if it were the first part of a byte and this may continue until it gets back "in synch".

 

The last time I read EEPROM data with LabVIEW was approximately a billion years ago, but the code looked like this...

 

18741i4A6A6FE49338E71E

 

... note that I was reading ALL of the data (may take several seconds) and then making sense of it. I also read it into an array. This was for a PIC16-something and it worked fine.

Richard






Message 10 of 14
(4,916 Views)