Jump to content

Component: TCP/IP DUMMY (NM7010A) (Comms: Networking): Difference between revisions

From Flowcode Help
Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 2.0 |- | width="20%" style="color:gray..."
 
No edit summary
Line 20: Line 20:


==Detailed description==
==Detailed description==




Line 36: Line 38:


==Examples==
==Examples==





Revision as of 14:43, 16 January 2023

Author Matrix Ltd
Version 2.0
Category Comms: Networking


TCP/IP DUMMY component

TCP/IP component designed to work with the WIZ3100 range of modules from Wiznet. Also available in the form of the version 1 EB023 E-block which uses the NM7010A module.

Component Source Code

Please click here for the component source code: FC_Comp_Source_TCPIP_EB023-00-1_Dummy.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

InitialiseSim
Resets and initialises the Internet E-Block. It sets up the gateway address, subnet mask, device IP address and device MAC address as defined in the properties of the Flowcode component. This macro must be called before any other TCP_IP component macros  
- VOID Return


TxSendMyIP
This macro fills the specified channel's transmit buffer with 4 bytes of data representing this Internet E-Block's IP address as specified in the component's property page. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


TxSendString_Sim
This macro fills the specified channel's transmit buffer with data. It can fill the buffer with a string of information. 
- BYTE Channel
Specifies the communications channel 0-3 
- STRING Data
Data byte to append to Tx buffer. 
- BYTE Length
 
- VOID Return


RxReadHeader_Sim
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  
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Idx
 
- BYTE Return


RxMatch_6_Bytes_Sim
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 those passed as parameters. There are similar functions that check for 2 bytes and 4 bytes. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Byte1
Specifies the value of the first byte 
- BYTE Byte2
Specifies the value of the second byte 
- BYTE Byte3
Specifies the value of the third byte 
- BYTE Byte4
Specifies the value of the fourth byte 
- BYTE Byte5
Specifies the value of the fifth byte 
- BYTE Byte6
Specifies the value of the sixth byte 
- BYTE Return


RxMatchMyIP
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 the Internet E-block's IP address. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


TxStart_Sim
This macro indicates the start of data transmission for the specified buffer. In TCP mode, data transmission can only begin once the socket has become established. In other modes, data transmission can occur as soon as the socket has been opened. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


TCPClose_Sim
When an established TCP connection has finished transmission of data, either the local application (i.e. your code) or the remote application (i.e. the application at the other end of the connection) can initiate closure of the socket. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxDataAvailable_Sim
This macro is used to check whether or not data has been received by the Internet E-Block. A return value of zero indicated that no data has been received. A positive return value indicates that data is available. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


RxMatch_4_Bytes
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. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Byte1
Specifies the value of the first byte 
- BYTE Byte2
Specifies the value of the second byte 
- BYTE Byte3
Specifies the value of the third byte 
- BYTE Byte4
Specifies the value of the fourth byte 
- BYTE Return


SetMyIP
This macro sets up the Internet E-Block's own IP address. In most circumstances, this macro will not be required as the IP address setting in the component property page will remain constant throughout your application. 
- BYTE IP0
First Byte of IP address 
- BYTE IP1
Second Byte of IP address 
- BYTE IP2
Third Byte of IP address 
- BYTE IP3
Fourth Byte of IP address 
- VOID Return


TxSendString
This macro fills the specified channel's transmit buffer with data. It can fill the buffer with a string of information. 
- BYTE Channel
Specifies the communications channel 0-3 
- STRING Data
Data byte to append to Tx buffer. 
- BYTE Length
 
- VOID Return


SetDestination_Sim
This is used in IP and UDP modes to set the destination of the intended data transfer. The destination IP address needs to be set for both IP and UDP modes. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Dst_IP0
Specifies the first byte of an IP address 
- BYTE Dst_IP1
Specifies the second byte of an IP address 
- BYTE Dst_IP2
Specifies the third byte of an IP address 
- BYTE Dst_IP3
Specifies the fourth byte of an IP address 
- BYTE Dst_Port_Hi
Port High Byte 
- BYTE Dst_Port_Lo
Port Low Byte 
- VOID Return


TxSendMyMAC_Sim
This macro fills the specified channel's transmit buffer with 6 bytes of data representing this Internet E-Block's MAC address as specified in the component's property page. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxSkipBytes_Sim
Often when receiving data packets, it may be necessary to ignore large sections of the data. This can be achieved by reading each byte individually (and ignoring the returned data), but a better way is to use this Rx_skipbytes macro. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Count
Specifies how many bytes to skip 
- VOID Return


CreateIPSocket_Sim
Note that sockets on up to 4 channels can be simultaneously opened and these channels are numbered 0 to 3. Note that sockets with different modes can be opened on different channels. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Protocol
Specifies which IP protocol to use 
- BYTE Broadcast
Allows broadcast type packets to be sent and received 
- BYTE Return


RxReadHeader
Once data in a particular channel has been received, the header will be filled with information about the received data. This macro will return the information in the header. The idx parameter specifies which byte of information in the header to read  
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Idx
Specifies the byte index to return 
- BYTE Return


TxSendMyIP_Sim
This macro fills the specified channel's transmit buffer with 4 bytes of data representing this Internet E-Block's IP address as specified in the component's property page. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxSkipBytes
Often when receiving data packets, it may be necessary to ignore large sections of the data. This can be achieved by reading each byte individually (and ignoring the returned data), but a better way is to use this Rx_skipbytes macro. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Count
Specifies how many bytes to skip 
- VOID Return


CreateIPSocket
Note that sockets on up to 4 channels can be simultaneously opened and these channels are numbered 0 to 3. Note that sockets with different modes can be opened on different channels. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Protocol
Specifies which IP protocol to use 
- BYTE Broadcast
Allows broadcast type packets to be sent and received 
- BYTE Return


SetDestination
This is used in IP and UDP modes to set the destination of the intended data transfer. The destination IP address needs to be set for both IP and UDP modes. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Dst_IP0
Specifies the first byte of an IP address 
- BYTE Dst_IP1
Specifies the second byte of an IP address 
- BYTE Dst_IP2
Specifies the third byte of an IP address 
- BYTE Dst_IP3
Specifies the fourth byte of an IP address 
- BYTE Dst_Port_Hi
Port High Byte 
- BYTE Dst_Port_Lo
Port Low Byte 
- BYTE Return


CreateTCPSocket_Sim
This macro creates a socket for sending and receiving TCP data. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Src_Port_Hi
Port High Byte 
- BYTE Src_Port_Lo
Port Low Byte 
- BYTE Return


GetSocketStatus_Sim
This returns the state of the requested channel's socket. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


TxEnd_Sim
Once the transmit buffer has been filled with data, call this macro to actually send the data. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxReadString_Sim
A call to this macro will return a string 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  
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Length
 
- STRING Return


RxMatchMyIP_Sim
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 the Internet E-block's IP address. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


TxStart
This macro indicates the start of data transmission for the specified buffer. In TCP mode, data transmission can only begin once the socket has become established. In other modes, data transmission can occur as soon as the socket has been opened. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


CreateMACSocket_Sim
This macro creates a socket for sending and receiving Ethernet data using raw data. 
- BYTE Promiscuous
Receive everything (1) or just data bound for your MAC (0) 
- BYTE Broadcast
Allows broadcast messages to be accepted (1) or rejected (0) 
- BYTE Error
Allowsmessages with errors to be accepted (1) or rejected (0) 
- BYTE Return


TCPListen_Sim
This macro puts a previously opened TCP channel in "passive open" mode. This is the required mode when writing a TCP server application (e.g. a web server to display HTML web pages). 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxReadByte
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  
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


CreateUDPSocket
This macro creates a socket for sending and receiving UDP data. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Src_Port_Hi
Port High Byte 
- BYTE Src_Port_Lo
Port Low Byte 
- BYTE Return


RxMatch_6_Bytes
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 those passed as parameters. There are similar functions that check for 2 bytes and 4 bytes. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Byte1
Specifies the value of the first byte 
- BYTE Byte2
Specifies the value of the second byte 
- BYTE Byte3
Specifies the value of the third byte 
- BYTE Byte4
Specifies the value of the fourth byte 
- BYTE Byte5
Specifies the value of the fifth byte 
- BYTE Byte6
Specifies the value of the sixth byte 
- BYTE Return


TCPConnect_Sim
This macro puts a previously opened TCP channel in "active open" mode. This is the required mode when writing a TCP client application (e.g. using SMTP to send an email). 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Dst_IP0
First Byte of IP address 
- BYTE Dst_IP1
Second Byte of IP address 
- BYTE Dst_IP2
Third Byte of IP address 
- BYTE Dst_IP3
Fourth Byte of IP address 
- BYTE Dst_Port_Hi
High Byte of destination port 
- BYTE Dst_Port_Lo
Low Byte of destination port 
- BYTE Return


RxMatch_2_Bytes
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. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Byte1
Specifies the value of the first byte 
- BYTE Byte2
Specifies the value of the second byte 
- BYTE Return


TxEnd
Once the transmit buffer has been filled with data, call this macro to actually send the data. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxReadString
A call to this macro will return a string 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  
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Length
 
- STRING Return


CreateTCPSocket
This macro creates a socket for sending and receiving TCP data. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Src_Port_Hi
Port High Byte 
- BYTE Src_Port_Lo
Port Low Byte 
- BYTE Return


RxDataAvailable
This macro is used to check whether or not data has been received by the Internet E-Block. A return value of zero indicated that no data has been received. A positive return value indicates that data is available. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


TxSendByte
This macro fills the specified channel's transmit buffer with data. It can fill the buffer with a single byte of data, or with a string of information. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Data
Data byte to append to Tx buffer. 
- VOID Return


TCPListen
This macro puts a previously opened TCP channel in "passive open" mode. This is the required mode when writing a TCP server application (e.g. a web server to display HTML web pages). 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


TxSendByte_Sim
This macro fills the specified channel's transmit buffer with data. It can fill the buffer with a single byte of data, or with a string of information. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Data
Data byte to append to Tx buffer. 
- VOID Return


RxFlushData
Once data reception has been completed, this macro should be called to discard the data packet and allow other data packets to be read. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


TCPConnect
This macro puts a previously opened TCP channel in "active open" mode. This is the required mode when writing a TCP client application (e.g. using SMTP to send an email). 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Dst_IP0
First Byte of IP address 
- BYTE Dst_IP1
Second Byte of IP address 
- BYTE Dst_IP2
Third Byte of IP address 
- BYTE Dst_IP3
Fourth Byte of IP address 
- BYTE Dst_Port_Hi
High Byte of destination port 
- BYTE Dst_Port_Lo
Low Byte of destination port 
- BYTE Return


RxReadByte_Sim
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  
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


RxMatchMyMAC
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. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


RxFlushData_Sim
Once data reception has been completed, this macro should be called to discard the data packet and allow other data packets to be read. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxDataSize
This macro is used to detect the size of data collected by the Rx_data_available macro. 
- BYTE Channel
Specifies the communications channel 0-3 
- UINT Return


CreateMACSocket
This macro creates a socket for sending and receiving Ethernet data using raw data. 
- BYTE Promiscuous
Receive everything (1) or just data bound for your MAC (0) 
- BYTE Broadcast
Allows broadcast messages to be accepted (1) or rejected (0) 
- BYTE Error
Allowsmessages with errors to be accepted (1) or rejected (0) 
- BYTE Return


CreateUDPSocket_Sim
This macro creates a socket for sending and receiving UDP data. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Src_Port_Hi
Port High Byte 
- BYTE Src_Port_Lo
Port Low Byte 
- BYTE Return


TxSendMyMAC
This macro fills the specified channel's transmit buffer with 6 bytes of data representing this Internet E-Block's MAC address as specified in the component's property page. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


RxMatch_4_Bytes_Sim
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. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Byte1
Specifies the value of the first byte 
- BYTE Byte2
Specifies the value of the second byte 
- BYTE Byte3
Specifies the value of the third byte 
- BYTE Byte4
Specifies the value of the fourth byte 
- BYTE Return


RxDataSize_Sim
This macro is used to detect the size of data collected by the Rx_data_available macro. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


RxMatch_2_Bytes_Sim
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. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Byte1
Specifies the value of the first byte 
- BYTE Byte2
Specifies the value of the second byte 
- BYTE Return


RxMatchMyMAC_Sim
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 the Internet E-block's IP address. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


TCPClose
When an established TCP connection has finished transmission of data, either the local application (i.e. your code) or the remote application (i.e. the application at the other end of the connection) can initiate closure of the socket. 
- BYTE Channel
Specifies the communications channel 0-3 
- VOID Return


GetSocketStatus
This returns the state of the requested channel's socket. 
- BYTE Channel
Specifies the communications channel 0-3 
- BYTE Return


Initialise
Resets and initialises the Internet E-Block. It sets up the gateway address, subnet mask, device IP address and device MAC address as defined in the properties of the Flowcode component. This macro must be called before any other TCP_IP component macros  
- VOID Return



Property reference

Properties