4 |
Programming Serial Communications
The program communicates through two ports using WRITE and READ terms. For ex- ample:
State: Get_Setpoint
Write ªEnter New Setpointº to Operator_Panel.
Read SetPoint1 from Operator_Panel, then go to Check_Setpoint State.
The Write Term sends the string of characters, Enter New Setpoint, to the port defined as the Operator_Panel. This same port is then monitored for input by the Read Term in the next Statement. The variable Setpoint1 is set to the value entered through the specified port.
In this example the WRITE and READ term information is directed to a particular port.
Operator_Panel in this case is defined in ECLiPS as Port 1 or Port 2. Use the ECLiPS, DE-
FINE or LIST menus to make the port definitions. The default names are Port_1 and
Port_2.
The Read and Write Terms may also be used without being directed to any particular channel, for example:
State: Choose_Recipe
Write ªEnter Recipe Numberº.
Read Recipe_Number, then go to StartBatch State.
Since no port is specified in this example, information is sent to the programming port. For a more detailed discussion of programming serial input and output, refer to the Ref- erence Section of the ECLiPS User's Manual.
State Logic Processor for Series |
|