EasyManuals Logo

Embedded Systems LogiMachine5 Power User Manual

Embedded Systems LogiMachine5 Power
254 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #224 background imageLoading...
Page #224 background image
224
Functions
Include library before calling serial functions:
require('serial')
Opens given port, returns: port handle, or, in case of error, nil plus error message
port, err = serial.open(device, params)
Parameters:
device port device name, required
params parameters table, optional, (defaults are in bold):
o baudrate 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200,
230400
o parity "none", "even", "odd"
o databits 5, 6, 7, 8
o stopbits 1, 2
o duplex "full", "half" (Note: "half" is required for RS-485)
Reads the specified number of bytes, execution is blocked until read is complete
res, err = port:read(bytes)
Parameters:
bytes number of bytes to read
Reads until timeout occurs or the specified number of bytes is received, whichever happens
first.
Returns data plus number of bytes read, or, in case of error, nil plus error message.
res, err = port:read(bytes, timeout)
Parameters:
bytes number of bytes to read
timeout maximum time to wait for read to complete, minimum value and timer
resolution is 0.1 seconds
Flushes any read/unsent bytes
port:flush()
Closes serial port, no other port functions may be called afterwards
port:close()

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Embedded Systems LogiMachine5 Power and is the answer not in the manual?

Embedded Systems LogiMachine5 Power Specifications

General IconGeneral
BrandEmbedded Systems
ModelLogiMachine5 Power
CategoryController
LanguageEnglish