Difference between revisions of "Component: TCP/IP (W5500) (W5500) (Comms: Networking)"
From Flowcode Help
Jump to navigationJump to searchLine 14: | Line 14: | ||
==TCP/IP (W5500) component== | ==TCP/IP (W5500) component== | ||
TCP/IP component designed to work with the W5500 device used on the ETH WIZ Click | TCP/IP component designed to work with the W5500 device used on the ETH WIZ Click | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Detailed description== | ==Detailed description== | ||
Line 187: | Line 181: | ||
| 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;" | '''CreateUDPSocket''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateUDPSocket''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | This macro creates a socket for sending and receiving UDP data. | | colspan="2" | This macro creates a socket for sending and receiving UDP data. | ||
Line 408: | Line 378: | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | | 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'' | ||
|} | |} | ||
Line 436: | Line 387: | ||
| 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;" | '''RxFlushData''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RxFlushData''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | Once data reception has been completed, this macro should be called to discard the data packet and allow other data packets to be read. | | colspan="2" | Once data reception has been completed, this macro should be called to discard the data packet and allow other data packets to be read. | ||
Line 495: | Line 427: | ||
|- | |- | ||
| colspan="2" | This macro returns a non-zero value when the next 6 bytes of data in the specified channel's reception buffer are the same as the Internet E-block's MAC address entered in the component's property page. | | colspan="2" | This macro returns a non-zero value when the next 6 bytes of data in the specified channel's reception buffer are the same as the Internet E-block's MAC address entered in the component's property page. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|- | |- | ||
Line 531: | Line 444: | ||
| 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;" | '''RxMatch_2_Bytes''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RxMatch_2_Bytes''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | This macro returns a non-zero value when the next 2 bytes of data in the specified channel's reception buffer are the same as those passed as parameters. There are similar functions that check for 4 bytes and 6 bytes. | | colspan="2" | This macro returns a non-zero value when the next 2 bytes of data in the specified channel's reception buffer are the same as those passed as parameters. There are similar functions that check for 4 bytes and 6 bytes. | ||
Line 589: | Line 473: | ||
| 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;" | '''RxMatch_4_Bytes''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RxMatch_4_Bytes''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | This macro returns a non-zero value when the next 4 bytes of data in the specified channel's reception buffer are the same as those passed as parameters. There are similar functions that check for 2 bytes and 6 bytes. | | colspan="2" | This macro returns a non-zero value when the next 4 bytes of data in the specified channel's reception buffer are the same as those passed as parameters. There are similar functions that check for 2 bytes and 6 bytes. | ||
Line 711: | Line 556: | ||
− | === | + | ===RxReadArray=== |
{| 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;" | '''RxReadArray''' |
|- | |- | ||
| colspan="2" | A call to this macro will return a byte of data in the reception buffer of the specified channel. It will also internally increment a pointer to that data so that the next call to 'Rx_readbyte' (or any other read function) will read the next byte | | colspan="2" | A call to this macro will return a byte of data in the reception buffer of the specified channel. It will also internally increment a pointer to that data so that the next call to 'Rx_readbyte' (or any other read function) will read the next byte | ||
Line 725: | Line 570: | ||
| colspan="2" | Specifies the communications channel 0-3 | | colspan="2" | Specifies the communications channel 0-3 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | === | + | ===RxReadByte=== |
{| 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;" | '''RxReadByte''' |
|- | |- | ||
| colspan="2" | A call to this macro will return a byte of data in the reception buffer of the specified channel. It will also internally increment a pointer to that data so that the next call to 'Rx_readbyte' (or any other read function) will read the next byte | | colspan="2" | A call to this macro will return a byte of data in the reception buffer of the specified channel. It will also internally increment a pointer to that data so that the next call to 'Rx_readbyte' (or any other read function) will read the next byte | ||
Line 1,112: | Line 967: | ||
− | === | + | ===TxSendArray=== |
{| 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;" | '''TxSendArray''' |
|- | |- | ||
| colspan="2" | This macro fills the specified channel's transmit buffer with data. | | colspan="2" | This macro fills the specified channel's transmit buffer with data. | ||
Line 1,130: | Line 985: | ||
|- | |- | ||
| colspan="2" | Data byte to append to Tx buffer. | | colspan="2" | Data byte to append to Tx buffer. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| 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-void-icon.png]] - VOID | ||
Line 1,136: | Line 996: | ||
− | === | + | ===TxSendByte=== |
{| 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;" | '''TxSendByte''' |
|- | |- | ||
− | | colspan="2" | This macro fills the specified channel's transmit buffer with data | + | | colspan="2" | This macro fills the specified channel's transmit buffer with data. |
|- | |- | ||
|- | |- | ||
Line 1,416: | Line 1,276: | ||
|- | |- | ||
| colspan="2" | List of network interfaces connected to the PC. Sets which interface we are communicating via. | | colspan="2" | List of network interfaces connected to the PC. Sets which interface we are communicating via. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | DHCP | ||
+ | |- | ||
+ | | colspan="2" | | ||
|} | |} | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_TCPIP_W5500.fcfx FC_Comp_Source_TCPIP_W5500.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TCPIP_W5500.fcfx FC_Comp_Source_TCPIP_W5500.fcfx] |
Latest revision as of 08:59, 9 June 2025
Author | Matrix TSL |
Version | 1.0 |
Category | Comms: Networking |
Contents
- 1 TCP/IP (W5500) component
- 2 Detailed description
- 3 Examples
- 4 Macro reference
- 4.1 CreateIPSocket
- 4.2 CreateMACSocket
- 4.3 CreateTCPSocket
- 4.4 CreateUDPSocket
- 4.5 GetSocketStatus
- 4.6 Initialise
- 4.7 MIAC_Module_GetData
- 4.8 MIAC_Module_Message
- 4.9 MIAC_Module_PushData
- 4.10 MIAC_Module_SetData
- 4.11 RxDataAvailable
- 4.12 RxDataSize
- 4.13 RxFlushData
- 4.14 RxMatchMyIP
- 4.15 RxMatchMyMAC
- 4.16 RxMatch_2_Bytes
- 4.17 RxMatch_4_Bytes
- 4.18 RxMatch_6_Bytes
- 4.19 RxReadArray
- 4.20 RxReadByte
- 4.21 RxReadHeader
- 4.22 RxReadString
- 4.23 RxSkipBytes
- 4.24 SetDestination
- 4.25 SetGateway
- 4.26 SetMACAddress
- 4.27 SetMyIP
- 4.28 SetSubnetMask
- 4.29 TCPClose
- 4.30 TCPConnect
- 4.31 TCPListen
- 4.32 TxEnd
- 4.33 TxSendArray
- 4.34 TxSendByte
- 4.35 TxSendMyIP
- 4.36 TxSendMyMAC
- 4.37 TxSendString
- 4.38 TxStart
- 5 Property reference
- 6 Component Source Code
TCP/IP (W5500) component
TCP/IP component designed to work with the W5500 device used on the ETH WIZ Click
Detailed description
No detailed description exists yet for this component
Examples
HTTP Server
Simple example showing the W5500 component being used stand alone to create a web server.
Network Comms
Here are some examples using the Network Communication component linked to the W5500 component.
Macro reference
CreateIPSocket
CreateMACSocket
CreateTCPSocket
![]() |
CreateTCPSocket |
This macro creates a socket for sending and receiving TCP data. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Src_Port |
Port Number | |
![]() |
Return |
CreateUDPSocket
![]() |
CreateUDPSocket |
This macro creates a socket for sending and receiving UDP data. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Src_Port |
Port Number | |
![]() |
Return |
GetSocketStatus
![]() |
GetSocketStatus |
This returns the state of the requested channel's socket. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Return |
Initialise
MIAC_Module_GetData
![]() |
MIAC_Module_GetData |
![]() |
Index |
![]() |
Return |
MIAC_Module_Message
![]() |
MIAC_Module_Message |
![]() |
CAN_ID |
![]() |
CMD_ID |
![]() |
Return |
MIAC_Module_PushData
![]() |
MIAC_Module_PushData |
![]() |
Data |
![]() |
Return |
MIAC_Module_SetData
![]() |
MIAC_Module_SetData |
![]() |
Count |
![]() |
D0 |
![]() |
D1 |
![]() |
D2 |
![]() |
D3 |
![]() |
D4 |
![]() |
D5 |
![]() |
Return |
RxDataAvailable
RxDataSize
![]() |
RxDataSize |
This macro is used to detect the size of data collected by the Rx_data_available macro. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Return |
RxFlushData
RxMatchMyIP
RxMatchMyMAC
RxMatch_2_Bytes
RxMatch_4_Bytes
RxMatch_6_Bytes
RxReadArray
RxReadByte
RxReadHeader
RxReadString
RxSkipBytes
SetDestination
SetGateway
SetMACAddress
SetMyIP
SetSubnetMask
TCPClose
TCPConnect
TCPListen
TxEnd
![]() |
TxEnd |
Once the transmit buffer has been filled with data, call this macro to actually send the data. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Return |
TxSendArray
TxSendByte
![]() |
TxSendByte |
This macro fills the specified channel's transmit buffer with data. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Data |
Data byte to append to Tx buffer. | |
![]() |
Return |
TxSendMyIP
TxSendMyMAC
TxSendString
TxStart
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TCPIP_W5500.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TCPIP_W5500.fcfx