Difference between revisions of "Component: TCP/IP (Raspberry Pi) (Comms: Networking)"
From Flowcode Help
Jump to navigationJump to search| (2 intermediate revisions by the same user not shown) | |||
| Line 48: | Line 48: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 55: | Line 61: | ||
==Macro reference== | ==Macro reference== | ||
| − | === | + | ===AcceptClose=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AcceptClose''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Close the accept socket |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| − | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| + | |} | ||
| + | |||
| + | |||
| + | ===AcceptOpen=== | ||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| − | | | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AcceptOpen''' | ||
|- | |- | ||
| − | | | + | | colspan="2" | |
| − | |||
|- | |- | ||
| − | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 79: | Line 89: | ||
| − | === | + | ===Connect=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connect''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Attempt to connect to the given address and port. First open a socket on the local device using the Socket function and check that it is successful. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| − | | width="90%" | | + | | width="90%" | Address |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Remote destination address |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| − | | width="90%" | | + | | width="90%" | Port |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Remote destination port |
|- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| − | === | + | ===Initialise=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Initialises the TCP/IP component |
|- | |- | ||
|- | |- | ||
| − | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| Line 146: | Line 146: | ||
| − | === | + | ===Receive=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Receive''' |
| + | |- | ||
| + | | colspan="2" | Receive data into the data buffer. Returns the number of bytes received | ||
| + | |- | ||
|- | |- | ||
| − | | | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
| + | | width="90%" | Data | ||
|- | |- | ||
| + | | colspan="2" | Data byte buffer to receive the data | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| − | | width="90%" | | + | | width="90%" | Count |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Maximum number of bytes to read |
|- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| − | === | + | ===Send=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Send data |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
| − | | width="90%" | + | | width="90%" | Data |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | | | + | | colspan="2" | Data byte buffer to send |
| − | |||
|- | |- | ||
| − | | | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| + | | width="90%" | Count | ||
|- | |- | ||
| + | | colspan="2" | Number of bytes to send | ||
|- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| − | === | + | ===SocketClose=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SocketClose''' |
|- | |- | ||
| − | | colspan="2" | Close the | + | | colspan="2" | Close the socket |
|- | |- | ||
|- | |- | ||
| Line 207: | Line 208: | ||
| − | === | + | ===SocketOpen=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SocketOpen''' |
| + | |- | ||
| + | | colspan="2" | Attempts to create a socket on the local device. Type =0 for TCP, =1 for UDP This must be successfully done before attempting connection with a remote destination. Returns 1 if successful, 0 if not. | ||
| + | |- | ||
|- | |- | ||
| − | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
| + | | width="90%" | Type | ||
|- | |- | ||
| + | | colspan="2" | Type of socket to create | ||
|- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| − | |||
| − | |||
Latest revision as of 13:13, 7 February 2023
| Author | Matrix Ltd. |
| Version | 1.9 |
| Category | Comms: Networking |
Contents
TCP/IP (Raspberry Pi) component
TCP/IP sockets component for use with Raspberry Pi. Raspberry Pi Only
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TCPIP_RPI.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TCPIP_RPI.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
AcceptClose
| AcceptClose | |
| Close the accept socket | |
| Return | |
AcceptOpen
| AcceptOpen | |
| Return | |
Connect
Initialise
| Initialise | |
| Initialises the TCP/IP component | |
| Return | |
Listen
| Listen | |
| Bind the socket to a port on the local host and set to listen mode. First open a socket on the local device using the Socket function and check that it is successful. | |
| Port | |
| Return | |
Receive
| Receive | |
| Receive data into the data buffer. Returns the number of bytes received | |
| Data | |
| Data byte buffer to receive the data | |
| Count | |
| Maximum number of bytes to read | |
| Return | |
Send
| Send | |
| Send data | |
| Data | |
| Data byte buffer to send | |
| Count | |
| Number of bytes to send | |
| Return | |
SocketClose
| SocketClose | |
| Close the socket | |
| Return | |
SocketOpen
Property reference
| Properties | |
| Label | |