SERIO
Function Block - Serial communication.
Inputs
Input |
Data type |
Description |
RUN |
BOOL |
Enable communication (opens the comm port). |
SND |
BOOL |
TRUE if data has to be sent. |
CONF |
STRING |
Configuration of the communication port. |
DATASND |
STRING |
Data to send. |
Outputs
Output |
Data type |
Description |
OPEN |
BOOL |
TRUE if the communication port is open. |
RCV |
BOOL |
TRUE if data has been received. |
ERR |
BOOL |
TRUE if error detected during sending data. |
DATARCV |
STRING |
Received data. |
Remarks
The RUN input does not include an edge detection. The block tries to open the port on each call if RUN is TRUE and if the port is still not successfully open. The CONF input is used for settings when opening the port. Please refer to your OEM instructions for further details about possible parameters.
The SND input does not include an edge detection. Characters are sent on each call if SND is TRUE and DATASND is not empty.
The DATARCV string is erased on each cycle with received data (if any). Your application is responsible for checking or storing received character immediately after the call to SERIO block.
SERIO is available during simulation. In that case, the CONF input defines the communication port according to the syntax of the MODE command. For example:
'COM1:9600,N,8,1'
The SERIO block may not be supported on some targets. Refer to your OEM instructions for further details.
ST Language
MySer is a declared instance of SERIO function block.
MySer (RUN, SND, CONF, DATASND);
OPEN := MySer.OPEN;
RCV := MySer.RCV;
ERR := MySer.ERR;
DATARCV := MySer.DATARCV;
FBD Language
LD Language
SERIO |
IEC 61131-3 Automation platform > Programming - Reference guide > Advanced operations > SERIO |
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and Passwords