Component: Serial Monitor (Matrix Tools)

From Flowcode Help
Jump to: navigation, search


Author Matrix Ltd
Version 1.0 (Release)
Category Matrix Tools


Contents

Image Serial Monitor component

Allows data from a COM port to be piped through to the console window for easy program status and debugging.

Examples

Here is a simple example showing how to pass data from a device such as an Arduino back into Flowcode for debugging purposes. The example is designed to run on an Arduino Uno R3 with an LED connected to pin D2 and a potentiometer connected to pin A0. The program loops switching the LED on and off and reporting the status to the console, the ADC is also sampled as a voltage string and this is also passed back to the console.

FC6 Icon.png Serial Monitor Demo

The incoming data can be seen on the Flowcode console even when the simulation is not running.

ArdInData.jpg

Outgoing data can be sent back to the embedded hardware by typing data directly into the RX Queue tab of the console.

ArdOutData.png

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

This component does not contain any simulation macros


Property reference

COM Port

This property is of type Fixed list of ints and can be referenced with the variable name COM_port.

Selects which port to communicate with, only lists ports which are currently available.

Refresh COM Ports

This property is of type True or false and can be referenced with the variable name Refresh.

When set to yes the COM port list is rescanned for newly connected or available ports.

Note that refreshing the ports list may take a few seconds depending on the number of connected ports.

Baud

This property is of type Signed integer and can be referenced with the variable name baud_rate.

Baud rate passed to the COM port to control the rate of data.

Connection Type

This property is of type Fixed list of ints and can be referenced with the variable name ConnType.

Decides how to work with the COM port.

Manual - Port needs to be manually opened and closed by the user. Port may become locked if left open. Port is automatically closed when programming.

Automatic - Port handling is automatic but port may be left open when closing the project. Port is automatically closed when programming and reopened after 20 seconds.

Connection

This property is of type Fixed list of ints and can be referenced with the variable name Conn.

Port connection status.

Closed - Port is unavailable and not in use.

Open - Port is available for data communications.

Personal tools