The serial object works only with ports and devices supported by the standard serial driver. It does not work with USB ports and devices, unless a USB to Serial adaptor is connected.
Specifies the serial port to be used by the serial object. If alphabetic shortcuts (a-z) are used, specifies the first logical serial port in the computer, and - are used to specify additional ports.
If actual portnames are used, the symbol is the name given by the Operating System to your port. The serial object can be used to create a list of available portnames and alphabetic shortcuts. If the port chosen is currently in use or unavailable when the serial object is instantiated, an error message will be displayed and the object will not function. If no port is specified, the default port is .to the
An optional argument may be used after the port name or alphabetic shortcut to specify the baud rate of the serial port (the default rate is 4800 baud). Any value is allowable (although not all ports can be set to all baud rates). Some common rates are 300, 600, 1200, 1800, 2400, 3600, 7200, 9600, 19200, 38400, 57600 and 115200.
After the baud rate, the next arguments specifies the number of data bits for the serial port (the default is 8 data bits). Other possible values are 5, 6 and 7.
The next argument specifies the number of stop bits for the serial port. The default is 1. Other possible values are 1.5 (Windows only) and 2.
parity [int or symbol]
The next argument specifies the parity for the serial port (the default is no parity, specified byor ).Other possible values are , (odd), , and (odd).
Toggles automatically opening the serial port.
Sets the port's baud rate.
Sets the input buffer size used by the serial object. The maximum input buffer size is 1024.
Sets the data chunk size (data list length) for output.
Sets the number of data bits (acceptable values are 5, 6, 7, or 8).
defer [int] (default: 1)
Defer output of messages to the lower priority main thread. Most applicable when using Overdrive.
(Mac only) Toggles drain enable. When enabled, communication waits until all data has been transmitted to the terminal when writing. The default value is 0 (disabled).
Enables or disables the DTR (data terminal ready) function of the serial port used by the serial object.
Sets the parity for the port. The options are:
0: no parity
0 = 'no'
1 = 'odd'
2 = 'even'
poll [float] (default: 0.)
If non-zero, the value of this attribute determines the rate in milliseconds at which to poll for data. You may use this instead of connecting a metro to bang the serial object at a regular interval. When zero, the polling is disabled.
Used by the object Inspector only. Users should use the
0 = 'Bluetooth-Incoming-Port'
Sets the number of stop bits used when communicating with the serial port.
Enables Xon/Xoff serial flow control.
Common Box Attributes
When a number or list is received in its inlet, serial sends the data out the specified serial port at the current baud rate.
When serial receives a message and characters have been received in the serial port, the received characters are sent as numbers in the order they were received.
When serial receives a message, characters have been received in the serial port, and chunking is enabled, the received characters are sent as a list in the order the characters were received. The length of the list is determined by the argument to the message (see the message listing for for more information).
Out right outlet: Reports error and status messages.
|Using Max with Hardware||Using Max with Hardware|
|Max Comm Tutorial 2: Serial Communication||Max Comm Tutorial 2: Serial Communication|