Y_IM_SerialReceive
- This function block (FB) handles the serial receive command over the CP040
- The FB provides the serial receive
- The FB shall be usable in IEC programs.
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
|
VAR_IN_OUT
|
||||
| V | InputData | Yt_ByteArray60 | Array of 60 bytes with actual values of the CP040 module. To have a consistent data access, please define the type of the connected variable as "IN Port". | |
| V | OutputData | Yt_ByteArray60 | Array of 60 bytes with set values for the CP040 module. To have a consistent data access, please define the type of the connected variable as "OUT Port". | |
| V | ReceivedData | Yt_ByteArray1024 | Array of 1024 bytes for received data. | |
| VAR_INPUT | ||||
| B | Enable | BOOL | The function block will continue to execute every scan while Enable is TRUE and there are no errors. |
FALSE |
| E | Reset | BOOL | With Reset = TRUE the communication to the CP040 is reset and all received data are deleted. | FALSE |
| E | Offset | UINT | Offset (in bytes) for saving the received data in "ReceivedData" array. | UINT#0 |
| VAR_OUTPUT | ||||
| B | Valid | BOOL | The Valid output indicates that the function block is operating normally and the outputs of the function block are valid. | |
| B | Busy | BOOL | For function blocks with Execute input, the Busy output is set to TRUE upon the rising edge of the Execute, and set to FALSE when Done, CommandAborted or Error outputs becomes TRUE. In the case of a function block with an Enable input, Busy indicates that the function block is operating, but may not be ready to provide valid outputs. | |
| B | NewDataReceived | BOOL | TRUE indicates that new data were received. | |
| B | Error | BOOL | The Error output is set to TRUE if an error has occurred during the operation of the function block. The output is cleared when the Execute or Enable input becomes FALSE. | |
| B | ErrorID | UINT | The ErrorID output provides the identifier of the error when there is an active error in the function block execution. The output is cleared when the Execute or Enable input becomes FALSE. | |
| B | Length | UINT | Length of received data in bytes. | |
Notes
- The Offset plus the received data are not allowed to be larger than 1024 bytes, otherwise an error is returned.
Error Description
See the
Function Block ErrorID List