Writing the PLC program

Top  Previous  Next

 

TrySim automatically assignes PLC-addresses when creating new elements. If your program shall run at a real PLC later, you have naturally to adapt these addresses.

 

In order to look at all the given addresses clearly arranged and to alter them, if necessary, select Machine|Address table. If you have followed the order when generating the elements, this list will look as follows:

 

 

1.) Open OrganizationBlock 1

Open the OB 1 (OrganizationBlock1) by Block|Open. You can also click onto the Symbol .

 

2.) Generate network for 'box forwards'

 Generate a SR-flipflop by clicking the symbol (at the top right) within the toolbar.

 

Enter the address Q 0.0 into the field directly above the flipflop. The corresponding edit field will automatically be active at the moment you enter a letter. You can also activate it explicitly by ENTER. Q 0.0 means Motor forwards. After the         input you have to close the editing window by ENTER.

 

Put an Or-box in front of the S-input. Therefore click on the ??..-name in front of the input, or move the cursor by the arrow keys. Then select the symbol out of the toolbar.

 

Name the inputs of the Or-box I 0.2 (this is the limit switch on the left) and I 0.4 (this is the pushbutton Start).

 

Name the R-input with I 0.3 (this is the limit switch on the right). Instead of entering the text I 0.3, you can also click on the limit switch and after this on the operand ??.

 

Name also the assignment at the Q-output of the flipflop with Q 0.0, or delete it by the del-key.

 

3.) Generate network for 'box backwards'

Change into the following network by page-down-key, or click on the twin-arrow indicating below at the right side of the network-window.

 

Generate a further SR-flipflop Q 0.1 (Motor backwards).

 

Name the S-input with I 0.3 (limit switch on the right) and the R-input with I 0.2 (limit switch on the left) and delete the assignment at the Q-output.

 

4.) Download program to the PLC

Download the program to the PLC by clicking on the symbol near the on the toolbar.

 

5.) Save

The program is now finished, and you should save it by Project|Save all or .

 

Start the simulation

 

 

Note: This of course is not a nice program, for instance the outputs 'motor forwards' and 'motor backwards' are not latched against each other. But it is easy to write and that was our priority here.

 

Start the simulation