Component: Serial Monitor (Runtime Tools)

From Flowcode Help
Revision as of 16:24, 7 January 2022 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Author Matrix Ltd
Version 1.0
Category Runtime Tools


Serial Monitor component

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

Component Pack

FREE

Detailed description

No detailed description exists yet for this component

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

Fc9-comp-macro.png ReceiveByte
Attempts to receive a byte using the COM port No valid return data is provided by the return value 256. 0 - 255 indicates valid data.  
Fc9-u8-icon.png - BYTE Timeout
 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png ClosePort
Closes the currently open COM port, ending communications and allowing it to be accessed via another application. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendByte
Sends a single byte to be sent out via the COM port. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetDTRState
Allows the DTR signal to be enabled or disabled. 
Fc9-u8-icon.png - BYTE State
A value of 0 disables the DTR, 1 or above willl enable the DTR. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
Fc9-h32-icon.png - HANDLE Return


Fc9-comp-macro.png SetFlowControl
Allows the Flowcontrol signals to be enabled or disabled. 
Fc9-u8-icon.png - BYTE State
A value of 0 disables flow control, 1 or above willl enable flow control. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OpenPort
Opens the currently selected COM port, allowing data to be sent and received. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetProp
Allows the COM port property to be set from a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-u32-icon.png - ULONG PropVal
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-string-icon.png - STRING Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png COM Port
Selects which port to communicate with, only lists ports which are currently available.  
Fc9-type-7-icon.png Refresh COM Ports
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. 
Fc9-type-14-icon.png Baud
Baud rate passed to the COM port to control the rate of data. 
Fc9-type-16-icon.png Connection Type
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. 
Fc9-type-16-icon.png Connection
Port connection status. Closed - Port is unavailable and not in use. Open - Port is available for data communications. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations