11-10-2016 12:48 PM
Hello,
We are going to communicate with a serial device. The nominal Baud Rate will be 2400, but because of the hardware, (on-board clock generation), this can vary by up to 10% depending on the unit. - But each individual unit will be stable.
On power-up, the unit will transmit a "u" (Hex 55).
Is there a way of getting LabView (2012) to capture this and set the Baud Rate to match automatically?
A VISA configuration setting perhaps?
One solution is to run through the range of Baud Rates until we get a valid response, but this may well be quite time consuming, and may involve cycling the unit power, as well as opening/closing/flushing the COM port.
Any pointers are welcome.
Thank you, Roland
11-10-2016 01:24 PM
I'm not sure about with a serial port being able to figure that out. But maybe you could use a counter to measure the pulse width and calculate the baude rate from that.
11-10-2016 01:34 PM
Hi Roland,
this is what NI recommends on baud rate tolerances. Other sources such as Wikipedia recommend using a crystal oszillator to set the baud rate…
As most COM ports will use the crystal oszillator I think they are using quite fixed baud rates following the standard ones described at Wikipedia. When your devices have such big tolerances you are probably lost! Can't you improve the hardware to follow "common sense"?
11-11-2016 04:59 AM
Thanks for the responses.
Unfortunately, the hardware is a customer unit, and of a fixed design, with many units already "out in the field".
Therefore we cannot get a "better quality" Baud Rate.
The other thing is that the only equipment is the serial port from a PC, so no oscilloscope to view the actual signal.
Fortunately, the communication will only involve reading one number from the unit, and writing a number back.
(Once for each unit.)
I think we will have to go for a "trial and error" routine, expanding from the nominal Baud Rate, until the response is the valid character.
The only question is what response will we get from the COM port if the Baud Rate is wrong?
A time-out, invalid character, parity error, nothing?
We will only find out when we get the hardware and try.
Thanks again.
Roland