5-7
5-5 Communication Parameters Setting
Communication Parameters
Setting
Parameter values are assigned to the variables (INT type array data) which are connected to the communication
parameter terminal “PARA” of non-procedural FB.  In this paragraph, how to do this using ST language is described.
   IF PSET THEN
     PARA[0]   :=  INT#1 ;      (*SX station No.*)
     PARA[1]   :=  INT#0 ;      (*SX station No.*)
     PARA[2]   :=  INT#50 ;    (*Message port No.*)
     PARA[4]   :=  INT#3 ;      (*Transmission speed: 9600 bps*)
     PARA[5]   :=  INT#1 ;      (*8 bits*)
     PARA[6]   :=  INT#1 ;      (*Even parity*)
     PARA[7]   :=  INT#1 ;      (*Stop bit: 1*)
     PARA[8]   :=  INT#0 ;      (*DTE designation*)
     PARA[9]   :=  INT#1 ;      (*Signal control*)
     PARA[10] :=  INT#0 ;      (*Signal flow control: None*)
     PARA[11] :=  INT#1 ;      (*XON/XOFF control: None*)
     PARA[16] :=  INT#0 ;      (*Code conversion: None*)
     PARA[17] :=  INT#1 ;      (*Frame detection variable length*)
     PARA[18] :=  INT#0 ;      (*Received bytes: Variable length*)
     PARA[19] :=  INT#1 ;      (*Number of starting code bytes: 1*)
     PARA[20] :=  INT#2 ;      (*Starting code: STX*)
     PARA[25] :=  INT#1 ;      (*Number of end code bytes: 1*)
     PARA[26] :=  INT#2 ;      (*End code: ETX*)
     PARA[31] :=  INT#1 ;      (*BCC: none*)
     PARA[34] :=  INT#1 ;      (*Code type: ASCII*)
     PARA[35] :=  INT#1000 ;(*Send timer: 10 s*)
     PSET  :=   FALSE  ;
   END_IF
Starting and end codes are also set by INT type.  
For example, when you want to set ":" for starting 
code, it is described by "INT 16#003A" or 
"INT #58" because the code for ":" is "3A."
<Sample variable declaration>
Because it is used by the POU on which an expansion FB is pasted, communication parameter variable "PARA" must be 
 
<Sample setting program>
This sample program assigns necessary communication parameter values to INT type array data "PARA."  
When no setting changes are required, setting is made during the first scan.  It is not necessary for each scan.
  VAR_GLOBAL
      PARA : _C_PAR_TYP11 ;
      PSET : BOOL := TRUE ;
      SDAT : _C_SND_TYP11 ;
      SSET : BOOL := TRUE ;
   END_VAR
 VAR_EXTERNAL
      PARA : _C_PAR_TYP11 ;
      PSET :  BOOL ;
   END_VAR
Global variable declaration
Local variable declaration
Data type "_C_PAR_TYP11" is 
automatically declared when non-procedural 
FB is pasted.
Setting operation flag
Used by the POU for writing send data
After all necessary parameters are set, the processing for 
the above setting will not be executed from the next scan 
when the flag is set to "FALSE."
    declaration in 2 locations, as below:
global.  Therefore, it is necessary to make a variable