西门子S7-200,S7-200 Smart, S7-300, S7-400都具有PPI或MPI串口,其波特率缺省为:187.5

Windows下波特率不能是特殊值,只能是1200/2400/.../115200

Linux下,波特率可以是特殊值。但似乎不能比115200更大,原因如下:

其中baud_base是基准晶振频率/16,通常是115200,你需要设的是custom_divisor这个值,最终的波特率为baud_base/custom_divisor,比如你需要28800,因为115200/4=28800,所以要设置custom_divisor=4