Enums ¶ ERROR (Enum) TCP_WRITE_STATE (Enum)
CAA Net Base Services ¶ Enums ERROR (Enum) TCP_WRITE_STATE (Enum) Examples HoTo (GVL) Function Blocks TCP TCP_Client (FunctionBlock) TCP_Connection (FunctionBlock) IPAddress (Property) TCP_Read (FunctionBlock) TCP_ReadBuffer (FunctionBlock) TCP_Server (FunctionBlock) TCP_Write (FunctionBlock) TCP_WriteBuffer (FunctionBlock) UDP UDP_Peer (FunctionBlock) UDP_Receive (FunctionBlock) UDP_ReceiveBuffer (FunctionBlock) UDP_Send (FunctionBlock) UDP_SendBuffer (FunctionBlock) Functions Async DummyJob (Function) UDP IPSTRING_TO_UDINT (Function) IS_MULTICAST_GROUP (Function) UDINT_TO_IPSTRING (Function) UDP_GetDataSize (Function) GlobalConstants Constants (GVL) Param (ParamList) Structs IP_ADDR (Struct)
ERROR (ENUM) ¶ TYPE ERROR : This data structure describes errors, which might occur during handling functions of CAA_NetBaseServices.lib. Attributes: qualified_only InOut: Name Initial Comment NO_ERROR 0 No error occurred FIRST_ERROR 6000 Reserved TIME_OUT 6001 Reserved INVALID_ADDR 6002 IP address not valid INVALID_HANDLE 6003 Handle not valid INVALID_DATAPOINTER 6004 Data pointer not valid INVALID_DATASIZE 6005 Data size not valid UDP_RECEIVE_ERROR 6006 Not able to receive a UDP datagram UDP_SEND_ERROR 6007 Not able to send a UDP datagram UDP_SEND_NOT_COMPLETE 6008 Reserved UDP_OPEN_ERROR 6009 Not able to create the port UDP_CLOSE_ERROR 6010 Not able to release the port TCP_SEND_ERROR 6011 Not able to send a TCP message TCP_RECEIVE_ERROR 6012 Not able to receive a TCP message TCP_OPEN_ERROR 6013 Not able to create a TCP port TCP_CONNECT_ERROR 6014 Not able to establish a TCP connection TCP_CLOSE_ERROR 6015 Not able to release the TCP connecteion TCP_SERVER_ERROR 6016 Reserved WRONG_PARAMETER 6017 A parameter has an invalid value ERROR_UNKNOWN 6018 Reserved TCP_NO_CONNECTION 6019 There is no TCP connection IOCTL_ERROR 6020 Internal error (e.g. IOCTL not supported) FIRST_MF 6050 Reserved LAST_ERROR 6099 Reserved
TCP_WRITE_STATE (ENUM) ¶ TYPE TCP_WRITE_STATE : InOut: Name Initial IDLE 0 SENDING DONE
HoTo (GVL) ¶ Attributes: qualified_only InOut: Name Type iDummy INT
Function Blocks ¶ TCP TCP_Client (FunctionBlock) TCP_Connection (FunctionBlock) IPAddress (Property) TCP_Read (FunctionBlock) TCP_ReadBuffer (FunctionBlock) TCP_Server (FunctionBlock) TCP_Write (FunctionBlock) TCP_WriteBuffer (FunctionBlock) UDP UDP_Peer (FunctionBlock) UDP_Receive (FunctionBlock) UDP_ReceiveBuffer (FunctionBlock) UDP_Send (FunctionBlock) UDP_SendBuffer (FunctionBlock)
TCP ¶ TCP_Client (FunctionBlock) TCP_Connection (FunctionBlock) IPAddress (Property) TCP_Read (FunctionBlock) TCP_ReadBuffer (FunctionBlock) TCP_Server (FunctionBlock) TCP_Write (FunctionBlock) TCP_WriteBuffer (FunctionBlock)
TCP_Connection (FB) ¶ FUNCTION_BLOCK TCP_Connection EXTENDS CBM.LTrig The next free connection is determined by handle exchange and set to active. As long as xActive is TRUE the handle of the connection is valid. If xActiveis FALSE the handle of the connection is invalid. hConnection can be used as input hConnection for function blocks TCP_Write , TCP_WriteBuffer , TCP_Read and TCP_ReadBuffer . InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input hServer CAA.HANDLE Output eError ERROR xActive BOOL hConnection CAA.HANDLE Properties: IPAddress Structure: IPAddress (Property)
TCP_Read (FB) ¶ FUNCTION_BLOCK TCP_Read EXTENDS CBM.LTrig This function block serves to read data from the previously established connection given in hConnection . As long as xEnable is TRUE the handle of the connection is valid. The pointer pData specifies the memory area to write the read data to. szSize defines the max number of bytes to read. When the data was read successfully, xReady is set to TRUE and szCount indicates the actually read number of bytes. InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input hConnection CAA.HANDLE szSize CAA.SIZE pData CAA.PVOID Output eError ERROR xReady BOOL szCount CAA.SIZE
TCP_ReadBuffer (FB) ¶ FUNCTION_BLOCK TCP_ReadBuffer EXTENDS CBM.LTrig Like TCP_Read this function block serves to read data from the previously established connection given in hConnection . As long as xEnable is TRUE the handle of the connection is valid. The function block returns the handle of the buffer containing the data. If xReady is TRUE , data has been read successfully and the handle of the buffer is valid. The buffer is passed on and not copied like at TCP_Read . InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input hConnection CAA.HANDLE Output eError ERROR xReady BOOL hBuffer CAA.HANDLE