Serial I/O

From TNtech Wiki
(Difference between revisions)
Jump to: navigation, search
(Pipe (FIFO) interface)
(Standard serial interface)
Line 61: Line 61:
 
  | [[File:exs_001.png | thumb|center|300px | <div align="center"> Serial echo (vitual port)</div>]]  
 
  | [[File:exs_001.png | thumb|center|300px | <div align="center"> Serial echo (vitual port)</div>]]  
 
  ||
 
  ||
  | [[File:exs_002.png | thumb|center|300px | <div align="center"> Writing a vector to port </div>]]
+
  | [[File:exs_002.png | thumb|center|300px | <div align="center"> Writing a vector to a port </div>]]
 
||
 
||
 
  | [[File:exs_003.png | thumb|center|300px | <div align="center"> Communication with Scratch Sensor board </div>]]
 
  | [[File:exs_003.png | thumb|center|300px | <div align="center"> Communication with Scratch Sensor board </div>]]
 
  |}
 
  |}
 
</center>
 
</center>

Revision as of 07:51, 15 September 2013

Introduction

Small set of Scilab/Xcos blocks designed for serial communication in Linux. Source code available on request, please send e-mail to fabo(dot)peter(at)gmail(dot)com.

Pipe (FIFO) interface

Simple interprocess communications (peer to peer) via Linux (POSIX) system FIFO.

PipeWrite.gif Block for writing into the FIFO. Input scalar value (double) is converted to a string terminated with '\n' and entered into FIFO.
PipeRead.gif Block for reading from FIFO. Reads strings terminated with '\n' from FIFO and converts it into double.

Usage

  • debugging
  • real-time data exchange with others programs (Scada ...)
  • communication with separated GUI programs
  • etc ...

Examples

Writing data to the pipe
How stuff works ...
Reading from pipe(s)
Reading/writing from/to pipes

Standard serial interface

Communication with standard serial devices (/dev/tty****) - USART, USB/RS232 adapters with FTDI chips and virtual serial ports (/dev/pts/*)

SerialWrite.gif Block for writing <0.0 ... 255.0> double vector[max 32] in the serial device. Negative values are ignored.
SerialRead.gif Block for reading double vector[max 32] from serial device with timeout. Standard value range <0.0 ... 255.0>, -1 after timeout.

Usage

  • communication with sensors with serial interface
  • communication with laboratory instruments
  • control of single board computers
  • etc ....

Examples

Serial echo (vitual port)
Writing a vector to a port
Communication with Scratch Sensor board
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox