# Writing to the Serial Port

The serial port can be written to programmatically in a script, using the following methods:

Function | Description
--- | ---
Flush() | Flushes all buffers of the device by script. This method can be used to consume the device's buffers if it is not consumed otherwise (e.g. an attached Receive Data block).
Write(string) | Writes a string to the serial port with ASCII encoding (e.g. RS232.Write("HelloFromVS").
WriteData(byte[]) | Writes an array of bytes to the port (e.g. RS232.WriteData(new Byte(){0,8,0,255,64,64}).
Reconfigure() | Reconfigures properties of the serial device while the project is in deployment mode (aka runtime). Takes a Dictionary data type, which stores the new parameters of the device. Note: For more information about using this method, see the Reconfiguring an RS 232 Device Through Script topic.