EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Stream device with non-standard baudrate
From: Dirk Zimoch <[email protected]>
To: <[email protected]>
Date: Tue, 12 Jun 2018 11:51:26 +0200
Hello Konstantin,

StreamDevice does not talk to hardware and thus has no idea about baud rates. It talks to the asyn driver which in turn cares about baud rates and such.

In asyn there is a selection of supported baud rates which reflects the "typical" baud rates supported by many systems. Look at the code in asyn/drvAsynSerial/drvAsynSerialPort.c. There you will find the supported baud rates in the setOption() function.

The function uses the pre-defined baud rate macros from /usr/include/bits/termios.h. In my version, there is no entry for 3062500 baud.

In fact I find:
#define __MAX_BAUD B4000000
That means my Linux does not know how to do 3062500 baud.

If your OS knows how to do 3062500 baud, you probably have an entry like
#define  B3062500 .....
in your termios.h. In that case add it to drvAsynSerialPort.c.

If you don't find it, your OS does not know how to do that baud rate.

Maybe you still can program your USB/serial device for that baud rate, but not using the standard way that asyn uses. Maybe the documentation of your USB/serial device mentions how to do that. If you are lucky, you simply have to send the correct baudCode, which you can add to setOption(). But I cannot tell you what the code for 3062500 baud is.

Dirk

On 12.06.2018 10:20, Konstantin Kr wrote:
Dear All,

I have a device which can be communicated with via serial port but at a strange baudrate of 3062500. This value has been set by the manufacturer and cannot be changed.  So, I created a simple IOC using StreamDevice to communicate with it. But when I run the IOC it gives me this:

*drvAsynSerialPortConfigure("SERIALPORT","/dev/ttyUSB5",0,0,0) *
*
*
*asynSetOption("SERIALPORT",-1,"baud","3062500") setOption failed Unsupported data rate (3062500 baud)*

So, the question is:  is it possible to make StreamDevice work with such non-standard baudrate and how?  If not, is there any way around it?

Thank you.
Konstantin

========================================
Dr. Konstantin Kruchinin
Researcher
ELI-Beamlines
Institute of Physics of the Czech Academy of Science
Fyzikální ústav AV ČR, v.v.i.
Za Radnicí 835
Dolní Břežany 252 41
========================================

Replies:
Re: Stream device with non-standard baudrate Mark Rivers
References:
Stream device with non-standard baudrate Konstantin Kr

Navigate by Date:
Prev: Stream device with non-standard baudrate Konstantin Kr
Next: Re: Stream device with non-standard baudrate Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Stream device with non-standard baudrate Konstantin Kr
Next: Re: Stream device with non-standard baudrate Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 12 Jun 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·