serial speed

Mark Waddingham mark at livecode.com
Fri May 3 11:36:17 EDT 2019


On 2019-05-03 17:01, runrevlist--- via use-livecode wrote:
> LC is ver well suited for all kinds of programs communicating with
> robots, 3D printers, milling machines etc. if only we could have a
> decent speed. I am not even asking for the preferred speed of 22…..
> The arduino IDE can easily communicate at that speed, why not LC?

Which platform are you using?

On Windows, any limit in baudrate is determined by Win32: the 
serialControlString
property is passed to the 'BuildCommDCBW' Win32 API function to parse 
(which doesn't
explicitly mention a baudrate limit).

On Mac/Linux, however, there is an 'artificial' limit - the engine 
parses the control
string itself in those cases and maps the integer baudrate value to a 
system constant...

So the reason it is limited to 57600 baud will be because when that code 
was written, the only constants which were defined by the system were 
those up to 57600 baud (it would appear at least.

This would need a (simple) engine patch to enable speeds up to the ones 
which are defined (on macOS there are constants up to 230400, Linux has 
a few higher ones defined too) when using 'the serialControlString' 
property.

> Does any one have a solution or idea how to increase this silly speed
> limit of LC?

Alternatively, you might be able to open the serial device from LC as 
you do now and then use the 'stty' shell command to tweak the settings:

    stty -F /dev/tty... <baudrate>

Here <baudrate> is one which is known by the system. For Linux this 
appears to be a reasonably normative list 
<https://superuser.com/questions/488449/is-there-any-way-to-check-which-baud-rates-are-supported-on-a-serial-device> 
(although a baudrate being there doesn't mean the device supports it).

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list