Component: SerialPort ( Comms)

From Flowcode Help
Jump to navigationJump to search
Author MatrixTSL
Version 0.1
Category Comms


SerialPort component

Allows connection to a serial port e.g. a standard serial COM port from the browser.

Detailed description

No detailed description exists yet for this component

Examples

Simple Data

Example program showing how to use communicate to a standard serial COM port.

FC6 Icon.png Web Serial Port Example

Macro reference

Close

Fc9-comp-macro.png Close
Closes the serial port 
Fc9-void-icon.png - VOID Return


GetProductId

Fc9-comp-macro.png GetProductId
Returns the productId of the selected USB COM port 
Fc9-s32-icon.png - LONG Return


GetVendorId

Fc9-comp-macro.png GetVendorId
Returns the vendortId of the selected USB COM port 
Fc9-s32-icon.png - LONG Return


Open

Fc9-comp-macro.png Open
Attempts to open a serial port that has already been selected using RequestPort Returns true if port is successfully opened 
Fc9-bool-icon.png - BOOL Return


ReceiveString

Fc9-comp-macro.png ReceiveString
Receives a string from the serial port 
Fc9-s32-icon.png - LONG Timeout
Time (in ms) to wait for data 
Fc9-s32-icon.png - LONG NumChars
Number of characters to try to receive 
Fc9-string-icon.png - STRING Return


RequestPort

Fc9-comp-macro.png RequestPort
Asks the user which serial port to use. Returns the selected COM port as a hex string in the form 0xVVVVPPPP where VVVV and PPPP are the vendorID and productID of the USB device. 
Fc9-string-icon.png - STRING Return


SendString

Fc9-comp-macro.png SendString
Sends a text string through an open serial port 
Fc9-string-icon.png - STRING sText
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Comms Settings
Fc9-type-16-icon.png Baud Rate
The baud rate for the serial communication 
Fc9-type-21-icon.png Custom Baud
A custom baud rate that is not limited to those in the drop-down list (must be a positive integer greater than 0) 
Fc9-type-16-icon.png Data Bits
Data bits per frame (default = 8) 
Fc9-type-16-icon.png Stop Bits
Number of stop bits at the end of a frame (default = 1) 
Fc9-type-16-icon.png Parity
The parity mode for serial communication (default = none) 
Fc9-type-21-icon.png Buffer Size
Size of the read and write buffers used (default = 255) (must be an integer greater than 0)  
Fc9-type-7-icon.png Flow Control
The flow control mode for communication (default = none) 
Fc9-type-11-icon.png Filters
Limits the list of available COM ports to specific USB devices, for example: { usbVendorId: 0x2A03, usbProductId: 0x0043 }, { usbVendorId: 0x2341, usbProductId: 0x0043 }, { usbVendorId: 0x2341, usbProductId: 0x0001 } (leave blank for all COM ports)  

Component Source Code

Please click here to download the component source project: FC_Comp_Source_WEBEXP_SerialPort.fcsx

Please click here to view the component source code (Beta): FC_Comp_Source_WEBEXP_SerialPort.fcsx