Component: Network Communications (Comms: Networking)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.5
Category Comms: Networking


Network Communications component

A component designed to simplify the process of TCP/IP communications. Compatible with most of the Flowcode supported TCP/IP and WIFI components. A useful building block for creating components such as IoT and Modbus TCP.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_NetworkComms.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_NetworkComms.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

AcceptClose

Fc9-comp-macro.png AcceptClose
Goes with the AcceptOpen function to close the new thread handle. 
Fc9-void-icon.png - VOID Return


AcceptOpen

Fc9-comp-macro.png AcceptOpen
Required for systems where there can be multiple incoming threads Returns 1 if there is incoming comms requiring a new thread, else returns 0 
Fc9-u8-icon.png - BYTE Return


Connect

Fc9-comp-macro.png Connect
Connects to an IP address as a client on the specified port. Some TCP/IP modules (RPI and ESP8266) will accept a URL instead of an IP address. Returns: 0=Fail, 1=OK 
Fc9-string-icon.png - STRING Address
IP address as a string e.g. "192.168.1.1" or URL on some TCP/IP modules 
Fc9-u16-icon.png - UINT Port
Port number to connect to. 
Fc9-bool-icon.png - BOOL Return


Initialise

Fc9-comp-macro.png Initialise
Initialises the network communications component. 
Fc9-void-icon.png - VOID Return


Listen

Fc9-comp-macro.png Listen
Bind the socket to a port on the local host and set to listen mode. First Open a Socket on the local host Returns: 0=Fail, 1=OK 
Fc9-u16-icon.png - UINT Port
Port number to listen on. 
Fc9-bool-icon.png - BOOL Return


Receive

Fc9-comp-macro.png Receive
Attempts to receive up to a specified number of bytes from the active connection. Returns the number of bytes received. 
Fc9-string-icon.png - STRING Data
Data Array to store the data into. 
Fc9-u16-icon.png - UINT Count
Maximum number of bytes to read 
Fc9-u16-icon.png - UINT Timeout
Maximum time to wait in mS (approx) 
Fc9-u16-icon.png - UINT Return


Send

Fc9-comp-macro.png Send
Sends the specified number of bytes via the active connection. Returns the number of bytes sent, 0=Fail. 
Fc9-string-icon.png - STRING Data
Array containing the data to send 
Fc9-u16-icon.png - UINT Count
Number of bytes to send from the data array 
Fc9-u16-icon.png - UINT Return


SocketClose

Fc9-comp-macro.png SocketClose
Closes the current socket connection 
Fc9-void-icon.png - VOID Return


SocketOpen

Fc9-comp-macro.png SocketOpen
Attempts to create a socket on the local device. This must be succesful to allow TCP/IP communications with a remote destination. Returns: 0=Fail / 1=OK 
Fc9-bool-icon.png - BOOL Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-type-16-icon.png TCP IP Channel
Allows for several parallel TCP/IP communications channels to be active at once by selecting unique TCP IP channels for each Network Comms component. Default 0. 
Fc9-type-10-icon.png Status
 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Simulation Control
Allows the user to decide what happens when simulating. Simulation DLL forces all simulated TCP/IP comms to go directly via the simulation DLL bypassing any additional components. Component simulation forces the attached component to provide the simulation and maybe other aspects such as SPI/I2C communications. 
Fc9-type-16-icon.png Network Interface
Some computers may have several network interfaces such as ethernet ports and wifi access. Select the correct network interface for the network you wish to connect to. Use the IP address to confirm you are connected to the right network. 
Fc9-type-10-icon.png IP Address
IP Address of the selected network interface.