comport-help.pd 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. #N canvas 67 105 1015 636 10;
  2. #X obj 488 438 comport 1 9600;
  3. #X msg 276 421 66;
  4. #X msg 234 421 64;
  5. #X text 273 403 point;
  6. #X text 231 403 stream;
  7. #X msg 318 421 86;
  8. #X text 315 403 position;
  9. #X msg 380 421 70;
  10. #X msg 420 421 71;
  11. #X text 376 403 run;
  12. #X text 416 403 sleep;
  13. #X msg 314 61 bits 8;
  14. #X msg 340 87 stopbit 0;
  15. #X msg 400 147 parity 0;
  16. #X text 467 146 parity 1=even \, -1=odd \, 0=off;
  17. #X text 363 60 databits 5 \, 6 \, 7 \, 8;
  18. #X obj 488 412 r comctl;
  19. #X obj 694 458 s comctl;
  20. #X text 500 166 use handshake xon/off 1=on 0=off;
  21. #X text 512 186 cts/rts hardwarehandshake 1=on 0=off;
  22. #X msg 460 207 pollintervall 1;
  23. #X msg 482 229 close;
  24. #X msg 503 250 open 1;
  25. #X text 521 228 Close Serial port;
  26. #X msg 666 413 devicename /dev/ttyS1;
  27. #X text 35 511 (C) 1998-2005 IEM Winfried Ritsch GPL (see LICENSE.txt)
  28. ;
  29. #X obj 135 50 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -262144
  30. -1 -1 0 1;
  31. #X text 550 249 Open serial port by number;
  32. #X text 804 413 open the serial port by name;
  33. #X msg 606 353 dtr \$1;
  34. #X obj 575 354 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -250685
  35. -1 0 1;
  36. #X obj 595 374 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -258113
  37. -1 0 1;
  38. #X msg 626 373 rts \$1;
  39. #X text 655 352 dtr output;
  40. #X text 675 372 rts output;
  41. #X msg 367 300 help;
  42. #X msg 585 332 verbose \$1;
  43. #X obj 554 334 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -250685
  44. -1 0 1;
  45. #X text 560 206 set poll interval for read in ms;
  46. #X msg 321 254 info;
  47. #X floatatom 569 527 10 0 0 1 baud - -;
  48. #X floatatom 644 568 3 0 0 3 parity - -;
  49. #X floatatom 669 568 3 0 0 2 stop - -;
  50. #X floatatom 694 567 3 0 0 3 data - -;
  51. #X floatatom 770 529 3 0 0 0 port - -;
  52. #X msg 544 291 devices;
  53. #X obj 141 74 % 255;
  54. #X floatatom 179 91 5 0 0 0 - - -;
  55. #X text 602 290 print available devices (wait for it...);
  56. #X obj 142 113 key;
  57. #X obj 170 130 sel 0;
  58. #X floatatom 249 147 4 0 0 0 ascii - -;
  59. #X msg 524 271 open 0;
  60. #X obj 719 533 tgl 15 0 empty empty rts/cts -10 20 1 11 -24198 -258699
  61. -1 0 1;
  62. #X obj 745 549 tgl 15 0 empty empty xon/xoff -14 20 1 11 -24198 -258699
  63. -1 0 1;
  64. #X text 508 567 serial packet format:;
  65. #X text 660 517 handshaking:;
  66. #X text 466 599 flow control inputs:;
  67. #X obj 594 599 tgl 15 0 empty empty dsr 0 20 1 11 -24198 -258699 -1
  68. 0 1;
  69. #X obj 619 599 tgl 15 0 empty empty cts 0 20 1 11 -24198 -258699 -1
  70. 0 1;
  71. #N canvas 307 43 789 479 bauds 0;
  72. #X msg 319 274 baud 57600;
  73. #X msg 357 312 baud 230400;
  74. #X msg 338 293 baud 115200;
  75. #X msg 300 255 baud 38400;
  76. #X msg 281 236 baud 19200;
  77. #X msg 262 217 baud 9600;
  78. #X msg 243 198 baud 4800;
  79. #X msg 224 179 baud 2400;
  80. #X obj 431 403 s comctl;
  81. #X msg 205 160 baud 1800;
  82. #X msg 186 141 baud 1200;
  83. #X msg 167 122 baud 600;
  84. #X msg 148 103 baud 300;
  85. #X msg 129 84 baud 200;
  86. #X msg 91 46 baud 134;
  87. #X msg 72 27 baud 110;
  88. #X msg 53 8 baud 75;
  89. #X msg 34 -11 baud 50;
  90. #X msg 15 -30 baud 0;
  91. #X msg 110 65 baud 150;
  92. #X text 368 255 this is a special baud rate that can be configured
  93. ;
  94. #X text 12 -48 standard baud rates for linux:;
  95. #X text 64 -31 0 deasserts control lines and resets the serial port
  96. ;
  97. #X text 435 312 won't work with standard setup. See setserial;
  98. #X msg 431 231 baud \$1;
  99. #X text 518 269 on-the-fly with setserial:;
  100. #X text 519 298 gives 14400 baud instead of 38400;
  101. #X text 517 284 "setserial /dev/ttyS0 spd_cust divisor 8";
  102. #X msg 419 163 115200;
  103. #X floatatom 392 104 7 1 115200 1 divisor - -;
  104. #X obj 431 192 / 1;
  105. #X obj 392 123 sel 0;
  106. #X floatatom 431 212 7 0 0 0 - - -;
  107. #X text 482 103 (1-115200);
  108. #X obj 419 143 t b f;
  109. #X text 390 86 On Windows some other baud rates might work:;
  110. #X connect 0 0 8 0;
  111. #X connect 1 0 8 0;
  112. #X connect 2 0 8 0;
  113. #X connect 3 0 8 0;
  114. #X connect 4 0 8 0;
  115. #X connect 5 0 8 0;
  116. #X connect 6 0 8 0;
  117. #X connect 7 0 8 0;
  118. #X connect 9 0 8 0;
  119. #X connect 10 0 8 0;
  120. #X connect 11 0 8 0;
  121. #X connect 12 0 8 0;
  122. #X connect 13 0 8 0;
  123. #X connect 14 0 8 0;
  124. #X connect 15 0 8 0;
  125. #X connect 16 0 8 0;
  126. #X connect 17 0 8 0;
  127. #X connect 18 0 8 0;
  128. #X connect 19 0 8 0;
  129. #X connect 24 0 8 0;
  130. #X connect 28 0 30 0;
  131. #X connect 29 0 31 0;
  132. #X connect 30 0 32 0;
  133. #X connect 31 1 34 0;
  134. #X connect 32 0 24 0;
  135. #X connect 34 0 28 0;
  136. #X connect 34 1 30 1;
  137. #X restore 314 37 pd bauds;
  138. #X msg 420 167 xonxoff \$1;
  139. #X obj 387 167 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -250685
  140. -1 0 1;
  141. #X msg 440 187 rtscts \$1;
  142. #X obj 408 187 tgl 15 0 empty empty empty 0 -6 0 8 -241291 -250685
  143. -1 0 1;
  144. #X text 17 -4 comport: a serial port interface;
  145. #X msg 243 176 13;
  146. #X obj 795 530 tgl 15 0 empty empty open -6 20 1 11 -24198 -258699
  147. -1 0 1;
  148. #X msg 565 312 ports;
  149. #X obj 820 564 print port_list;
  150. #X text 611 311 list available ports on right outlet;
  151. #X msg 275 208 48 49 50 51 52 53 54 55 56 57;
  152. #X text 137 207 send a list of bytes:;
  153. #X msg 295 228 print hello_world;
  154. #X text 196 228 send some text:;
  155. #X msg 646 393 hupcl \$1;
  156. #X obj 614 394 tgl 15 0 empty empty empty 17 7 0 10 -257985 -258113
  157. -1 0 1;
  158. #X text 704 386 hang up connection on last close;
  159. #X text 717 398 (not on Windows);
  160. #X obj 934 520 print other;
  161. #X text 205 176 <CR>:;
  162. #X text 143 254 status list on right outlet:;
  163. #X text 257 300 print usage info:;
  164. #X obj 845 527 tgl 15 0 empty empty hupcl -6 20 1 11 -24198 -258699
  165. -1 0 1;
  166. #X msg 452 110 1;
  167. #X msg 482 110 1.5;
  168. #X msg 513 110 2;
  169. #X text 444 127 number of stopbits (Windows only);
  170. #X msg 380 127 stopbit \$1;
  171. #X text 403 86 extra stopbit 1=on \, 0=off (linux \, MacOS);
  172. #X text 16 30 You can send bytes directly (0-255):;
  173. #X text 12 112 or from the terminal:;
  174. #X text 56 420 messages for the bird patch:;
  175. #X floatatom 870 540 10 0 0 1 rxerrors - -;
  176. #X obj 569 490 route baud dsr cts parity stop data rtscts xonxoff port
  177. open ports hupcl rxerrors;
  178. #X text 37 526 2006-2010 Martin Peach;
  179. #X msg 685 433 retries 10;
  180. #X text 754 432 how many times to retry a lost connection;
  181. #X text 761 206 (default is 1 tick 10ms);
  182. #X connect 0 1 94 0;
  183. #X connect 1 0 0 0;
  184. #X connect 2 0 0 0;
  185. #X connect 5 0 0 0;
  186. #X connect 7 0 0 0;
  187. #X connect 8 0 0 0;
  188. #X connect 11 0 17 0;
  189. #X connect 12 0 17 0;
  190. #X connect 13 0 17 0;
  191. #X connect 16 0 0 0;
  192. #X connect 20 0 17 0;
  193. #X connect 21 0 17 0;
  194. #X connect 22 0 17 0;
  195. #X connect 24 0 17 0;
  196. #X connect 26 0 46 0;
  197. #X connect 29 0 17 0;
  198. #X connect 30 0 29 0;
  199. #X connect 31 0 32 0;
  200. #X connect 32 0 17 0;
  201. #X connect 35 0 0 0;
  202. #X connect 36 0 17 0;
  203. #X connect 37 0 36 0;
  204. #X connect 39 0 0 0;
  205. #X connect 45 0 17 0;
  206. #X connect 46 0 0 0;
  207. #X connect 46 0 47 0;
  208. #X connect 49 0 50 0;
  209. #X connect 50 1 51 0;
  210. #X connect 50 1 0 0;
  211. #X connect 52 0 17 0;
  212. #X connect 61 0 17 0;
  213. #X connect 62 0 61 0;
  214. #X connect 63 0 17 0;
  215. #X connect 64 0 63 0;
  216. #X connect 66 0 0 0;
  217. #X connect 68 0 17 0;
  218. #X connect 71 0 0 0;
  219. #X connect 73 0 0 0;
  220. #X connect 75 0 17 0;
  221. #X connect 76 0 75 0;
  222. #X connect 84 0 88 0;
  223. #X connect 85 0 88 0;
  224. #X connect 86 0 88 0;
  225. #X connect 88 0 17 0;
  226. #X connect 94 0 40 0;
  227. #X connect 94 1 58 0;
  228. #X connect 94 2 59 0;
  229. #X connect 94 3 41 0;
  230. #X connect 94 4 42 0;
  231. #X connect 94 5 43 0;
  232. #X connect 94 6 53 0;
  233. #X connect 94 7 54 0;
  234. #X connect 94 8 44 0;
  235. #X connect 94 9 67 0;
  236. #X connect 94 10 69 0;
  237. #X connect 94 11 83 0;
  238. #X connect 94 12 93 0;
  239. #X connect 94 13 79 0;
  240. #X connect 96 0 17 0;