Serial DAT

From TouchDesigner 088 Wiki


The Serial DAT is used for serial communication through an external port, using the RS-232 protocol. These ports are usually a 9 pin connector, or a USB port on new machines. (Using a USB port requires a USB-to-serial adapter and driver.) All of a computer's available serial ports can be found in the Device Manager in the Windows operating system under Computer –> Manage -> Devices -> Serial… -> COM ports. Their names begin with 'COM'. Example: COM1, COM2, COM3.

To send bytes out this connection, see the send methods in the serialDAT_Class, or in Tscript the send Command.

See also Arduino and Serial CHOP.

PythonIcon.png serialDAT_Class


Active /script - This check box enables the serial connection.

Port /port - Selects the COM port that the serial connection will use. Default port names 1 through 8 are available in the popup menu, though any name can be manually entered in this field.

Baud Rate /baudrate - The maximum number of bits of information, including "control" bits, that are transmitted per second. Check your input device's default baud rate and set accordingly.

Data Bits /databits - This parameter sets the number of data bits sent in each. Data bits are transmitted "backwards". Backwards refers to the order of transmission, which is from least significant bit (LSB) to most significant bit (MSB). To interpret the data bits, you must read from right to left.

Parity /parity - This parameter can be set to none, even, or odd. The optional parity bit follows the data bits and is included as a simple means of error checking. Parity bits work by specifying ahead of time whether the parity of the transmission is to be even or odd. If the parity is set to be odd, the transmitter will then set the parity bit in such a way as to make an odd number of 1's among the data bits and the parity bit.

Stop Bits /stopbits - The last part of transmission packet consists of 1 or 2 Stop bits. The connection will now wait for the next Start bit.

Format /format - Interpret the incoming data as binary or ASCII data. If the format is Per Byte, one row is appended for each binary byte received. If the format is Per Line, one row is appended for each null or newline delimited message received.

  • Per Byte - (formerly called 'binary')
  • Per Line - (formerly called 'Ascii') null/newln delimited
  • Full Message - Full incoming msg

Script DAT /script - the Script DAT will execute once for each message coming in. The first argument is the message, the second argument is the line number (index starting at 0) in the DAT of the message.

Execute From /executeloc - Determines the location the script is run from.

  • Current Node /current - The script is executed from the current node location (for example, where 'cc' points to).
  • Script DAT /script - The script is executed from the location of the DAT specified in the Script DAT parameter.
  • Specified Component /comp - The script is executed from the component specified in the Component parameter below.

From Component /component - The component who's state change will trigger the DAT to execute its script when Execute is set to On Panel Change. This component is also the path that the script will be executed from if the Execute From parameter is set to Specified Component .

Clamp Output /clamp - The DAT is limited to 100 messages by default but with Clamp Output, this can be set to anything including unlimited.

Maximum Lines /maxlines - Limits the number of messages, older messages are removed from the list first.

Clear Output /clear - Deletes all lines except the heading. To clear with a script command, here is an example: opparm -c /serial1 clear

Value Column /valcol - Outputs the raw decimal value of the message in a separate column. Use this when the incoming data is binary, and not readable ASCII.

See Also