This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| logicpython:cubloc_api:opencom [2026/04/10 08:53] – [Parameters] mfranklin | logicpython:cubloc_api:opencom [2026/04/14 04:47] (current) – removed mfranklin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OpenCom ====== | ||
| - | |||
| - | Enable serial communication on a CUBLOC-style '' | ||
| - | |||
| - | ===== Syntax ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import OpenCom | ||
| - | |||
| - | OpenCom(channel: | ||
| - | </ | ||
| - | |||
| - | ===== Parameters ===== | ||
| - | |||
| - | * **channel**: | ||
| - | * **baudRate**: | ||
| - | * **protocol**: | ||
| - | * **recvSize**: | ||
| - | * **sendSize**: | ||
| - | |||
| - | ==== `protocol` bit layout ==== | ||
| - | |||
| - | ^ Field ^ Bits ^ Meaning ^ | ||
| - | | Data bits | 1..0 | 00=5 bits, 01=6 bits, 10=7 bits, 11=8 bits | | ||
| - | | Stop bits | 2 | 0=1 stop bit, 1=2 stop bits | | ||
| - | | Parity | 4..3 | 00=None, 10=Even, 11=Odd (01 is reserved and raises '' | ||
| - | |||
| - | ==== Common `protocol` values ==== | ||
| - | |||
| - | ^ protocol ^ Frame format ^ | ||
| - | | 3 | 8N1 | | ||
| - | | 11 | 8E1 | | ||
| - | | 19 | 8O1 | | ||
| - | | 7 | 8N2 | | ||
| - | |||
| - | ===== Exceptions ===== | ||
| - | |||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | |||
| - | ===== Example ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import OpenCom | ||
| - | |||
| - | # Example usage | ||
| - | OpenCom(0, 115200, 3, 64, 64) | ||
| - | </ | ||
| - | |||
| - | ===== Related APIs ===== | ||
| - | |||
| - | * [[logicpython: | ||