LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Port

I am having a problem getting my read buffer to provide me the correct string. My device terminates its strings with a carraige return line feed so i wasnt too sure how to input that into the instrument property node. Do i use two TermChar's? I keep getting an extra character in front of my string and I dont know where it is coming from. I have increased the buffer size to make sure that I am getting all the characters in the string but I still get the unknown character in front of my string. I have attached a photoshop of my code. Thnaks for your help.
0 Kudos
Message 1 of 6
(2,977 Views)
You don't need to use the property node here. You can setup the termination using Serial Configure.vi, but it should be not the problem. I think you may use Trim Whitespace.vi for removing all unneeded characters on the begin and end of your string line.
0 Kudos
Message 2 of 6
(2,964 Views)

Also, I would suggest wiring up your error terminals just to make sure your not getting any read errors.

 

You could change your string indicator from "normal display" to "hex display".  Knowing what the extra character(s) are in hexadecimal might help you debug the problem (i.e. -- is the extra charater white space, CR/LF, etc?)

Message Edited by vt92 on 07-13-2009 12:30 PM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 3 of 6
(2,961 Views)

You didn't wire any of the terminals of the "VISA Configure Serial Port.vi" so I expect your defice to be set up as the default values of that VI. Is it really so?

 

Adding a small delay in your while loop won't hurt anyone too Smiley Indifferent

0 Kudos
Message 4 of 6
(2,952 Views)
@Alain S, all the terminals have a default value, no connection needed here. A Wait is not needed because of the Timeout at Reading.
0 Kudos
Message 5 of 6
(2,947 Views)
I know, I know about the default values but if they don't match the settings of his device he could end up with some problems.
At least I think so, isn't it?
0 Kudos
Message 6 of 6
(2,943 Views)